<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" /><style type="text/css"><!--
#msg dl { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fc0 solid; padding: 6px; }
#msg ul, pre { overflow: auto; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<title>[27332] trunk/WebKit</title>
</head>
<body>

<div id="msg">
<dl>
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/27332">27332</a></dd>
<dt>Author</dt> <dd>timothy@apple.com</dd>
<dt>Date</dt> <dd>2007-10-31 16:12:35 -0700 (Wed, 31 Oct 2007)</dd>
</dl>

<h3>Log Message</h3>
<pre>        Reviewed by John Sullivan.

        Move the developer extras preference to WebPreferences.

        * WebView/WebPreferenceKeysPrivate.h: Add WebKitDeveloperExtrasEnabledPreferenceKey
        * WebView/WebPreferences.m:
        (+[WebPreferences initialize]): Initialize WebKitDeveloperExtrasEnabledPreferenceKey to NO.
        (-[WebPreferences developerExtrasEnabled]): Check DisableWebKitDeveloperExtras, WebKitDeveloperExtras
          and IncludeDebugMenu in addition to WebKitDeveloperExtrasEnabledPreferenceKey.
        (-[WebPreferences setDeveloperExtrasEnabled:]): Set WebKitDeveloperExtrasEnabledPreferenceKey.
        * WebView/WebPreferencesPrivate.h: Add developerExtrasEnabled and setDeveloperExtrasEnabled:.
        * WebView/WebView.mm:
        (+[WebView _developerExtrasEnabled]): Removed.
        (-[WebView _preferencesChangedNotification:]): Check the WebPreferences object for developerExtrasEnabled.
        * WebView/WebViewPrivate.h: Removed _developerExtrasEnabled.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkWebKitChangeLog">trunk/WebKit/ChangeLog</a></li>
<li><a href="#trunkWebKitWebViewWebPreferenceKeysPrivateh">trunk/WebKit/WebView/WebPreferenceKeysPrivate.h</a></li>
<li><a href="#trunkWebKitWebViewWebPreferencesm">trunk/WebKit/WebView/WebPreferences.m</a></li>
<li><a href="#trunkWebKitWebViewWebPreferencesPrivateh">trunk/WebKit/WebView/WebPreferencesPrivate.h</a></li>
<li><a href="#trunkWebKitWebViewWebViewmm">trunk/WebKit/WebView/WebView.mm</a></li>
<li><a href="#trunkWebKitWebViewWebViewPrivateh">trunk/WebKit/WebView/WebViewPrivate.h</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkWebKitChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/WebKit/ChangeLog (27331 => 27332)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebKit/ChangeLog        2007-10-31 21:19:20 UTC (rev 27331)
+++ trunk/WebKit/ChangeLog        2007-10-31 23:12:35 UTC (rev 27332)
</span><span class="lines">@@ -1,3 +1,21 @@
</span><ins>+2007-10-31  Timothy Hatcher  &lt;timothy@apple.com&gt;
+
+        Reviewed by John Sullivan.
+
+        Move the developer extras preference to WebPreferences.
+
+        * WebView/WebPreferenceKeysPrivate.h: Add WebKitDeveloperExtrasEnabledPreferenceKey
+        * WebView/WebPreferences.m:
+        (+[WebPreferences initialize]): Initialize WebKitDeveloperExtrasEnabledPreferenceKey to NO.
+        (-[WebPreferences developerExtrasEnabled]): Check DisableWebKitDeveloperExtras, WebKitDeveloperExtras
+          and IncludeDebugMenu in addition to WebKitDeveloperExtrasEnabledPreferenceKey.
+        (-[WebPreferences setDeveloperExtrasEnabled:]): Set WebKitDeveloperExtrasEnabledPreferenceKey.
+        * WebView/WebPreferencesPrivate.h: Add developerExtrasEnabled and setDeveloperExtrasEnabled:.
+        * WebView/WebView.mm:
+        (+[WebView _developerExtrasEnabled]): Removed.
+        (-[WebView _preferencesChangedNotification:]): Check the WebPreferences object for developerExtrasEnabled.
+        * WebView/WebViewPrivate.h: Removed _developerExtrasEnabled.
+
</ins><span class="cx"> 2007-10-30  David D. Kilzer  &lt;ddkilzer@webkit.org&gt;
</span><span class="cx"> 
</span><span class="cx">         Generated files missing from WebCore's Xcode project file
</span></span></pre></div>
<a id="trunkWebKitWebViewWebPreferenceKeysPrivateh"></a>
<div class="modfile"><h4>Modified: trunk/WebKit/WebView/WebPreferenceKeysPrivate.h (27331 => 27332)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebKit/WebView/WebPreferenceKeysPrivate.h        2007-10-31 21:19:20 UTC (rev 27331)
+++ trunk/WebKit/WebView/WebPreferenceKeysPrivate.h        2007-10-31 23:12:35 UTC (rev 27332)
</span><span class="lines">@@ -62,6 +62,7 @@
</span><span class="cx"> #define WebKitUsesPageCachePreferenceKey @&quot;WebKitUsesPageCachePreferenceKey&quot;
</span><span class="cx"> #define WebKitFTPDirectoryTemplatePath @&quot;WebKitFTPDirectoryTemplatePath&quot;
</span><span class="cx"> #define WebKitForceFTPDirectoryListings @&quot;WebKitForceFTPDirectoryListings&quot;
</span><ins>+#define WebKitDeveloperExtrasEnabledPreferenceKey @&quot;WebKitDeveloperExtrasEnabledPreferenceKey&quot;
</ins><span class="cx"> 
</span><span class="cx"> // These are private both because callers should be using the cover methods and because the
</span><span class="cx"> // cover methods themselves are private.
</span></span></pre></div>
<a id="trunkWebKitWebViewWebPreferencesm"></a>
<div class="modfile"><h4>Modified: trunk/WebKit/WebView/WebPreferences.m (27331 => 27332)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebKit/WebView/WebPreferences.m        2007-10-31 21:19:20 UTC (rev 27331)
+++ trunk/WebKit/WebView/WebPreferences.m        2007-10-31 23:12:35 UTC (rev 27332)
</span><span class="lines">@@ -328,6 +328,7 @@
</span><span class="cx">         [NSNumber numberWithBool:NO],   WebKitDOMPasteAllowedPreferenceKey,
</span><span class="cx">         [NSNumber numberWithBool:YES],  WebKitUsesPageCachePreferenceKey,
</span><span class="cx">         [NSNumber numberWithInt:cacheModelForMainBundle()], WebKitCacheModelPreferenceKey,
</span><ins>+        [NSNumber numberWithBool:NO],  WebKitDeveloperExtrasEnabledPreferenceKey,
</ins><span class="cx">         nil];
</span><span class="cx"> 
</span><span class="cx">     // This value shouldn't ever change, which is assumed in the initialization of WebKitPDFDisplayModePreferenceKey above
</span><span class="lines">@@ -705,6 +706,25 @@
</span><span class="cx"> 
</span><span class="cx"> @implementation WebPreferences (WebPrivate)
</span><span class="cx"> 
</span><ins>+- (BOOL)developerExtrasEnabled
+{
+    NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
+    if ([defaults boolForKey:@&quot;DisableWebKitDeveloperExtras&quot;])
+        return NO;
+#ifdef NDEBUG
+    if ([defaults boolForKey:@&quot;WebKitDeveloperExtras&quot;] || [defaults boolForKey:@&quot;IncludeDebugMenu&quot;])
+        return YES;
+    return [self _boolValueForKey:WebKitDeveloperExtrasEnabledPreferenceKey];
+#else
+    return YES; // always enable in debug builds
+#endif
+}
+
+- (void)setDeveloperExtrasEnabled:(BOOL)flag
+{
+    [self _setBoolValue:flag forKey:WebKitDeveloperExtrasEnabledPreferenceKey];
+}
+
</ins><span class="cx"> - (BOOL)respectStandardStyleKeyEquivalents
</span><span class="cx"> {
</span><span class="cx">     return [self _boolValueForKey:WebKitRespectStandardStyleKeyEquivalentsPreferenceKey];
</span></span></pre></div>
<a id="trunkWebKitWebViewWebPreferencesPrivateh"></a>
<div class="modfile"><h4>Modified: trunk/WebKit/WebView/WebPreferencesPrivate.h (27331 => 27332)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebKit/WebView/WebPreferencesPrivate.h        2007-10-31 21:19:20 UTC (rev 27331)
+++ trunk/WebKit/WebView/WebPreferencesPrivate.h        2007-10-31 23:12:35 UTC (rev 27332)
</span><span class="lines">@@ -44,6 +44,10 @@
</span><span class="cx"> @interface WebPreferences (WebPrivate)
</span><span class="cx"> 
</span><span class="cx"> // Preferences that might be public in a future release
</span><ins>+
+- (BOOL)developerExtrasEnabled;
+- (void)setDeveloperExtrasEnabled:(BOOL)flag;
+
</ins><span class="cx"> - (BOOL)respectStandardStyleKeyEquivalents;
</span><span class="cx"> - (void)setRespectStandardStyleKeyEquivalents:(BOOL)flag;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkWebKitWebViewWebViewmm"></a>
<div class="modfile"><h4>Modified: trunk/WebKit/WebView/WebView.mm (27331 => 27332)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebKit/WebView/WebView.mm        2007-10-31 21:19:20 UTC (rev 27331)
+++ trunk/WebKit/WebView/WebView.mm        2007-10-31 23:12:35 UTC (rev 27332)
</span><span class="lines">@@ -558,21 +558,6 @@
</span><span class="cx"> }
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-+ (BOOL)_developerExtrasEnabled
-{
-    NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
-    if ([defaults boolForKey:@&quot;DisableWebKitDeveloperExtras&quot;])
-        return NO;
-#ifdef NDEBUG
-    BOOL enableDebugger = [defaults boolForKey:@&quot;WebKitDeveloperExtras&quot;];
-    if (!enableDebugger)
-        enableDebugger = [defaults boolForKey:@&quot;IncludeDebugMenu&quot;];
-    return enableDebugger;
-#else
-    return YES; // always enable in debug builds
-#endif
-}
-
</del><span class="cx"> + (BOOL)_scriptDebuggerEnabled
</span><span class="cx"> {
</span><span class="cx"> #ifdef NDEBUG
</span><span class="lines">@@ -949,7 +934,7 @@
</span><span class="cx">     settings-&gt;setDOMPasteAllowed([preferences isDOMPasteAllowed]);
</span><span class="cx">     settings-&gt;setUsesPageCache([self usesPageCache]);
</span><span class="cx">     settings-&gt;setShowsURLsInToolTips([preferences showsURLsInToolTips]);
</span><del>-    settings-&gt;setDeveloperExtrasEnabled([WebView _developerExtrasEnabled]);
</del><ins>+    settings-&gt;setDeveloperExtrasEnabled([preferences developerExtrasEnabled]);
</ins><span class="cx">     if ([preferences userStyleSheetEnabled]) {
</span><span class="cx">         NSString* location = [[preferences userStyleSheetLocation] _web_originalDataAsString];
</span><span class="cx">         settings-&gt;setUserStyleSheetLocation([NSURL URLWithString:(location ? location : @&quot;&quot;)]);
</span></span></pre></div>
<a id="trunkWebKitWebViewWebViewPrivateh"></a>
<div class="modfile"><h4>Modified: trunk/WebKit/WebView/WebViewPrivate.h (27331 => 27332)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebKit/WebView/WebViewPrivate.h        2007-10-31 21:19:20 UTC (rev 27331)
+++ trunk/WebKit/WebView/WebViewPrivate.h        2007-10-31 23:12:35 UTC (rev 27332)
</span><span class="lines">@@ -150,7 +150,6 @@
</span><span class="cx"> 
</span><span class="cx"> @interface WebView (WebPrivate)
</span><span class="cx"> 
</span><del>-+ (BOOL)_developerExtrasEnabled;
</del><span class="cx"> + (BOOL)_scriptDebuggerEnabled;
</span><span class="cx"> 
</span><span class="cx"> - (WebInspector *)inspector;
</span></span></pre>
</div>
</div>

</body>
</html>