<!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>[27266] trunk</title>
</head>
<body>

<div id="msg">
<dl>
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/27266">27266</a></dd>
<dt>Author</dt> <dd>timothy@apple.com</dd>
<dt>Date</dt> <dd>2007-10-30 14:26:19 -0700 (Tue, 30 Oct 2007)</dd>
</dl>

<h3>Log Message</h3>
<pre>WebCore:

        Reviewed by John Sullivan.

        - Allow showing and closing the inspector programatically.
        - Add showConsole() and showTimeline() methods. 

        * WebCore.base.exp: Add exports for WebKit.
        * page/InspectorController.cpp:
        (WebCore::callSimpleFunction): Renamed from callClearFunction().
        (WebCore::unloading): Renamed to close().
        (WebCore::InspectorController::InspectorController):
        (WebCore::InspectorController::inspect): Moved showing code to show().
        (WebCore::InspectorController::setWindowVisible): Show the timeline or console if needed.
        (WebCore::InspectorController::show): Code factored out of inspect().
        (WebCore::InspectorController::showConsole): Call show() and the JS showConsole().
        (WebCore::InspectorController::showTimeline): Call show() and the JS showTimeline().
        (WebCore::InspectorController::close):
        (WebCore::InspectorController::clearScriptResources): Call the new callSimpleFunction.
        (WebCore::InspectorController::clearDatabaseScriptResources): Ditto.
        (WebCore::InspectorController::clearScriptConsoleMessages): Ditto.
        (WebCore::InspectorController::clearNetworkTimeline): Ditto.
        * page/InspectorController.h: Add and rename methods.
        * page/inspector/inspector.js: Add showConsole() and showTimeline().

WebKit:

        Reviewed by John Sullivan.

        Various semi-related changes:
        - A WebView can now be asked for it's WebInspector. There is one
          WebInspector per WebView. 
        - Refactor the WebInspector class and move obsolete methods to
          a special category.
        - Add new WebInspector methods to show, hide and show the
          console/timeline panels.
        - Add an isDisabled method to WebCache.
        - Allow WebLocalizableStrings.h to be used in C files.

        * Misc/WebCache.h: Add isDisabled.
        * Misc/WebCache.mm:
        (+[WebCache isDisabled]): New method.

        * Misc/WebLocalizableStrings.h: Changes to allow use in plain C files.

        * WebCoreSupport/WebInspectorClient.mm:
        (-[WebInspectorWindowController showWindow:]): Call super if already visible
          so the window will be ordered front.
        (-[WebInspectorWindowController showWebInspector:]): Method used by menu items,
          so they are enabled and work when the Inspector window is key.
        (-[WebInspectorWindowController showErrorConsole:]): Ditto.
        (-[WebInspectorWindowController showNetworkTimeline:]): Ditto.

        * WebInspector/WebInspector.h: Add and remove methods.
        * WebInspector/WebInspector.mm:
        (-[WebInspector webViewClosed]): Called when the WebView is closed/dealloced.
          Clears the _webView pointer.
        (-[WebInspector show:]): Calls thru to the Page's InspectorController.
        (-[WebInspector showConsole:]): Ditto.
        (-[WebInspector showTimeline:]): Ditto.
        (-[WebInspector close:]): Ditto.
        (-[WebInspector attach:]): Ditto.
        (-[WebInspector detach:]): Ditto.
        (+[WebInspector sharedWebInspector]): Moved to the obsolete category.
        (+[WebInspector webInspector]): Ditto.
        (-[WebInspector setWebFrame:]): Ditto.
        (-[WebInspector window]): Ditto.
        (-[WebInspector showWindow:]): Ditto.

        * WebView/WebView.mm:
        (-[WebViewPrivate dealloc]): Release the WebInspector.
        (-[WebView _close]): Call webViewClosed on the WebInspector.
        (-[WebView inspector]): Create a WebInspector if needed and return it.
        * WebView/WebViewPrivate.h: Add the inspector method.

WebKitTools:

        Reviewed by John Sullivan.
        
        - Place the Localizable.strings file in mac or win directories
          if that location exists.
        - Also look for UI_STRING in .c files.

        * Scripts/extract-localizable-strings:</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkWebCoreChangeLog">trunk/WebCore/ChangeLog</a></li>
<li><a href="#trunkWebCoreWebCorebaseexp">trunk/WebCore/WebCore.base.exp</a></li>
<li><a href="#trunkWebCorepageChromecpp">trunk/WebCore/page/Chrome.cpp</a></li>
<li><a href="#trunkWebCorepageInspectorControllercpp">trunk/WebCore/page/InspectorController.cpp</a></li>
<li><a href="#trunkWebCorepageInspectorControllerh">trunk/WebCore/page/InspectorController.h</a></li>
<li><a href="#trunkWebCorepageinspectorinspectorjs">trunk/WebCore/page/inspector/inspector.js</a></li>
<li><a href="#trunkWebKitChangeLog">trunk/WebKit/ChangeLog</a></li>
<li><a href="#trunkWebKitMiscWebCacheh">trunk/WebKit/Misc/WebCache.h</a></li>
<li><a href="#trunkWebKitMiscWebCachemm">trunk/WebKit/Misc/WebCache.mm</a></li>
<li><a href="#trunkWebKitMiscWebLocalizableStringsh">trunk/WebKit/Misc/WebLocalizableStrings.h</a></li>
<li><a href="#trunkWebKitWebCoreSupportWebInspectorClientmm">trunk/WebKit/WebCoreSupport/WebInspectorClient.mm</a></li>
<li><a href="#trunkWebKitWebInspectorWebInspectorh">trunk/WebKit/WebInspector/WebInspector.h</a></li>
<li><a href="#trunkWebKitWebInspectorWebInspectormm">trunk/WebKit/WebInspector/WebInspector.mm</a></li>
<li><a href="#trunkWebKitWebViewWebViewmm">trunk/WebKit/WebView/WebView.mm</a></li>
<li><a href="#trunkWebKitWebViewWebViewPrivateh">trunk/WebKit/WebView/WebViewPrivate.h</a></li>
<li><a href="#trunkWebKitToolsChangeLog">trunk/WebKitTools/ChangeLog</a></li>
<li><a href="#trunkWebKitToolsScriptsextractlocalizablestrings">trunk/WebKitTools/Scripts/extract-localizable-strings</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/WebCore/ChangeLog (27265 => 27266)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebCore/ChangeLog        2007-10-30 21:18:18 UTC (rev 27265)
+++ trunk/WebCore/ChangeLog        2007-10-30 21:26:19 UTC (rev 27266)
</span><span class="lines">@@ -1,3 +1,28 @@
</span><ins>+2007-10-29  Timothy Hatcher  &lt;timothy@apple.com&gt;
+
+        Reviewed by John Sullivan.
+
+        - Allow showing and closing the inspector programatically.
+        - Add showConsole() and showTimeline() methods. 
+
+        * WebCore.base.exp: Add exports for WebKit.
+        * page/InspectorController.cpp:
+        (WebCore::callSimpleFunction): Renamed from callClearFunction().
+        (WebCore::unloading): Renamed to close().
+        (WebCore::InspectorController::InspectorController):
+        (WebCore::InspectorController::inspect): Moved showing code to show().
+        (WebCore::InspectorController::setWindowVisible): Show the timeline or console if needed.
+        (WebCore::InspectorController::show): Code factored out of inspect().
+        (WebCore::InspectorController::showConsole): Call show() and the JS showConsole().
+        (WebCore::InspectorController::showTimeline): Call show() and the JS showTimeline().
+        (WebCore::InspectorController::close):
+        (WebCore::InspectorController::clearScriptResources): Call the new callSimpleFunction.
+        (WebCore::InspectorController::clearDatabaseScriptResources): Ditto.
+        (WebCore::InspectorController::clearScriptConsoleMessages): Ditto.
+        (WebCore::InspectorController::clearNetworkTimeline): Ditto.
+        * page/InspectorController.h: Add and rename methods.
+        * page/inspector/inspector.js: Add showConsole() and showTimeline().
+
</ins><span class="cx"> 2007-10-30  Adele Peterson  &lt;adele@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Reviewed by Sam.
</span></span></pre></div>
<a id="trunkWebCoreWebCorebaseexp"></a>
<div class="modfile"><h4>Modified: trunk/WebCore/WebCore.base.exp (27265 => 27266)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebCore/WebCore.base.exp        2007-10-30 21:18:18 UTC (rev 27265)
+++ trunk/WebCore/WebCore.base.exp        2007-10-30 21:26:19 UTC (rev 27266)
</span><span class="lines">@@ -322,7 +322,13 @@
</span><span class="cx"> __ZN7WebCore16NavigationActionC1Ev
</span><span class="cx"> __ZN7WebCore16colorFromNSColorEP7NSColor
</span><span class="cx"> __ZN7WebCore18PlatformMouseEventC1EP7NSEvent
</span><ins>+__ZN7WebCore19InspectorController11showConsoleEv
+__ZN7WebCore19InspectorController12attachWindowEv
+__ZN7WebCore19InspectorController12detachWindowEv
+__ZN7WebCore19InspectorController12showTimelineEv
</ins><span class="cx"> __ZN7WebCore19InspectorController16setWindowVisibleEb
</span><ins>+__ZN7WebCore19InspectorController4showEv
+__ZN7WebCore19InspectorController5closeEv
</ins><span class="cx"> __ZN7WebCore19InspectorController7inspectEPNS_4NodeE
</span><span class="cx"> __ZN7WebCore19SelectionController16setSelectedRangeEPNS_5RangeENS_9EAffinityEbRi
</span><span class="cx"> __ZN7WebCore19SelectionController5clearEv
</span></span></pre></div>
<a id="trunkWebCorepageChromecpp"></a>
<div class="modfile"><h4>Modified: trunk/WebCore/page/Chrome.cpp (27265 => 27266)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebCore/page/Chrome.cpp        2007-10-30 21:18:18 UTC (rev 27265)
+++ trunk/WebCore/page/Chrome.cpp        2007-10-30 21:26:19 UTC (rev 27266)
</span><span class="lines">@@ -200,8 +200,7 @@
</span><span class="cx">     if (source == JSMessageSource)
</span><span class="cx">         m_client-&gt;addMessageToConsole(message, lineNumber, sourceID);
</span><span class="cx"> 
</span><del>-    if (InspectorController* inspector = m_page-&gt;inspectorController())
-        inspector-&gt;addMessageToConsole(source, level, message, lineNumber, sourceID);
</del><ins>+    m_page-&gt;inspectorController()-&gt;addMessageToConsole(source, level, message, lineNumber, sourceID);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> bool Chrome::canRunBeforeUnloadConfirmPanel()
</span></span></pre></div>
<a id="trunkWebCorepageInspectorControllercpp"></a>
<div class="modfile"><h4>Modified: trunk/WebCore/page/InspectorController.cpp (27265 => 27266)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebCore/page/InspectorController.cpp        2007-10-30 21:18:18 UTC (rev 27265)
+++ trunk/WebCore/page/InspectorController.cpp        2007-10-30 21:26:19 UTC (rev 27266)
</span><span class="lines">@@ -65,6 +65,18 @@
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><ins>+static void callSimpleFunction(JSContextRef context, JSObjectRef thisObject, const char* functionName)
+{
+    ASSERT_ARG(context, context);
+    ASSERT_ARG(thisObject, thisObject);
+
+    JSStringRef string = JSStringCreateWithUTF8CString(functionName);
+    JSObjectRef function = JSValueToObject(context, JSObjectGetProperty(context, thisObject, string, 0), 0);
+    JSStringRelease(string);
+
+    JSObjectCallAsFunction(context, function, thisObject, 0, 0, 0);
+}
+
</ins><span class="cx"> struct ConsoleMessage {
</span><span class="cx">     ConsoleMessage(MessageSource s, MessageLevel l, const String&amp; m, unsigned li, const String&amp; u)
</span><span class="cx">         : source(s)
</span><span class="lines">@@ -389,7 +401,7 @@
</span><span class="cx">     if (!controller)
</span><span class="cx">         return JSValueMakeUndefined(ctx);
</span><span class="cx"> 
</span><del>-    controller-&gt;windowUnloading();
</del><ins>+    controller-&gt;close();
</ins><span class="cx">     return JSValueMakeUndefined(ctx);
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -539,6 +551,7 @@
</span><span class="cx">     , m_controllerScriptObject(0)
</span><span class="cx">     , m_scriptContext(0)
</span><span class="cx">     , m_windowVisible(false)
</span><ins>+    , m_showAfterVisible(FocusedNodeDocumentPanel)
</ins><span class="cx">     , m_nextIdentifier(-2)
</span><span class="cx"> {
</span><span class="cx">     ASSERT_ARG(page, page);
</span><span class="lines">@@ -575,25 +588,19 @@
</span><span class="cx">     if (!node || !enabled())
</span><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    if (!m_page) {
-        m_page = m_client-&gt;createPage();
-        if (!m_page)
-            return;
</del><ins>+    show();
</ins><span class="cx"> 
</span><del>-        m_page-&gt;setParentInspectorController(this);
-    }
-
</del><span class="cx">     if (node-&gt;nodeType() != Node::ELEMENT_NODE &amp;&amp; node-&gt;nodeType() != Node::DOCUMENT_NODE)
</span><span class="cx">         node = node-&gt;parentNode();
</span><span class="cx">     m_nodeToFocus = node;
</span><span class="cx"> 
</span><del>-    if (!m_scriptObject)
</del><ins>+    if (!m_scriptObject) {
+        m_showAfterVisible = FocusedNodeDocumentPanel;
</ins><span class="cx">         return;
</span><ins>+    }
</ins><span class="cx"> 
</span><span class="cx">     if (windowVisible())
</span><span class="cx">         focusNode();
</span><del>-    else
-        m_client-&gt;showWindow();
</del><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void InspectorController::focusNode()
</span><span class="lines">@@ -656,12 +663,18 @@
</span><span class="cx">         populateScriptResources();
</span><span class="cx">         if (m_nodeToFocus)
</span><span class="cx">             focusNode();
</span><ins>+        if (m_showAfterVisible == ConsolePanel)
+            showConsole();
+        else if (m_showAfterVisible == TimelinePanel)
+            showTimeline();
</ins><span class="cx">     } else {
</span><span class="cx">         clearScriptResources();
</span><span class="cx">         clearScriptConsoleMessages();
</span><span class="cx">         clearDatabaseScriptResources();
</span><span class="cx">         clearNetworkTimeline();
</span><span class="cx">     }
</span><ins>+
+    m_showAfterVisible = FocusedNodeDocumentPanel;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void InspectorController::addMessageToConsole(MessageSource source, MessageLevel level, const String&amp; message, unsigned lineNumber, const String&amp; sourceID)
</span><span class="lines">@@ -760,8 +773,59 @@
</span><span class="cx">     m_client-&gt;showWindow();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void InspectorController::windowUnloading()
</del><ins>+void InspectorController::show()
</ins><span class="cx"> {
</span><ins>+    if (!enabled())
+        return;
+
+    if (!m_page) {
+        m_page = m_client-&gt;createPage();
+        if (!m_page)
+            return;
+        m_page-&gt;setParentInspectorController(this);
+
+        // m_client-&gt;showWindow() will be called after the page loads in scriptObjectReady()
+        return;
+    }
+
+    m_client-&gt;showWindow();
+}
+
+void InspectorController::showConsole()
+{
+    if (!enabled())
+        return;
+
+    show();
+
+    if (!m_scriptObject) {
+        m_showAfterVisible = ConsolePanel;
+        return;
+    }
+
+    callSimpleFunction(m_scriptContext, m_scriptObject, &quot;showConsole&quot;);
+}
+
+void InspectorController::showTimeline()
+{
+    if (!enabled())
+        return;
+
+    show();
+
+    if (!m_scriptObject) {
+        m_showAfterVisible = TimelinePanel;
+        return;
+    }
+
+    callSimpleFunction(m_scriptContext, m_scriptObject, &quot;showTimeline&quot;);
+}
+
+void InspectorController::close()
+{
+    if (!enabled())
+        return;
+
</ins><span class="cx">     m_client-&gt;closeWindow();
</span><span class="cx">     if (m_page)
</span><span class="cx">         m_page-&gt;setParentInspectorController(0);
</span><span class="lines">@@ -1199,18 +1263,6 @@
</span><span class="cx">     JSObjectCallAsFunction(m_scriptContext, addMessage, m_scriptObject, 1, &amp;messageObject, 0);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-static void callClearFunction(JSContextRef context, JSObjectRef thisObject, const char* functionName)
-{
-    ASSERT_ARG(context, context);
-    ASSERT_ARG(thisObject, thisObject);
-
-    JSStringRef string = JSStringCreateWithUTF8CString(functionName);
-    JSObjectRef function = JSValueToObject(context, JSObjectGetProperty(context, thisObject, string, 0), 0);
-    JSStringRelease(string);
-
-    JSObjectCallAsFunction(context, function, thisObject, 0, 0, 0);
-}
-
</del><span class="cx"> void InspectorController::clearScriptResources()
</span><span class="cx"> {
</span><span class="cx">     if (!m_scriptContext || !m_scriptObject)
</span><span class="lines">@@ -1222,7 +1274,7 @@
</span><span class="cx">         resource-&gt;setScriptObject(0, 0);
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    callClearFunction(m_scriptContext, m_scriptObject, &quot;clearResources&quot;);
</del><ins>+    callSimpleFunction(m_scriptContext, m_scriptObject, &quot;clearResources&quot;);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void InspectorController::clearDatabaseScriptResources()
</span><span class="lines">@@ -1237,7 +1289,7 @@
</span><span class="cx">         resource-&gt;setScriptObject(0, 0);
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    callClearFunction(m_scriptContext, m_scriptObject, &quot;clearDatabaseResources&quot;);
</del><ins>+    callSimpleFunction(m_scriptContext, m_scriptObject, &quot;clearDatabaseResources&quot;);
</ins><span class="cx"> #endif
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -1246,7 +1298,7 @@
</span><span class="cx">     if (!m_scriptContext || !m_scriptObject)
</span><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    callClearFunction(m_scriptContext, m_scriptObject, &quot;clearConsoleMessages&quot;);
</del><ins>+    callSimpleFunction(m_scriptContext, m_scriptObject, &quot;clearConsoleMessages&quot;);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void InspectorController::clearNetworkTimeline()
</span><span class="lines">@@ -1254,7 +1306,7 @@
</span><span class="cx">     if (!m_scriptContext || !m_scriptObject)
</span><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    callClearFunction(m_scriptContext, m_scriptObject, &quot;clearNetworkTimeline&quot;);
</del><ins>+    callSimpleFunction(m_scriptContext, m_scriptObject, &quot;clearNetworkTimeline&quot;);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void InspectorController::pruneResources(ResourcesMap* resourceMap, DocumentLoader* loaderToKeep)
</span></span></pre></div>
<a id="trunkWebCorepageInspectorControllerh"></a>
<div class="modfile"><h4>Modified: trunk/WebCore/page/InspectorController.h (27265 => 27266)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebCore/page/InspectorController.h        2007-10-30 21:18:18 UTC (rev 27265)
+++ trunk/WebCore/page/InspectorController.h        2007-10-30 21:26:19 UTC (rev 27266)
</span><span class="lines">@@ -55,6 +55,12 @@
</span><span class="cx">     typedef HashMap&lt;RefPtr&lt;Frame&gt;, ResourcesMap*&gt; FrameResourcesMap;
</span><span class="cx">     typedef HashSet&lt;RefPtr&lt;InspectorDatabaseResource&gt; &gt; DatabaseResourcesSet;
</span><span class="cx"> 
</span><ins>+    typedef enum {
+        FocusedNodeDocumentPanel,
+        ConsolePanel,
+        TimelinePanel
+    } SpecialPanels;
+
</ins><span class="cx">     InspectorController(Page*, InspectorClient*);
</span><span class="cx">     ~InspectorController();
</span><span class="cx"> 
</span><span class="lines">@@ -68,6 +74,11 @@
</span><span class="cx">     void highlight(Node*);
</span><span class="cx">     void hideHighlight();
</span><span class="cx"> 
</span><ins>+    void show();
+    void showConsole();
+    void showTimeline();
+    void close();
+
</ins><span class="cx">     bool windowVisible();
</span><span class="cx">     void setWindowVisible(bool visible = true);
</span><span class="cx"> 
</span><span class="lines">@@ -82,7 +93,6 @@
</span><span class="cx">     void windowScriptObjectAvailable();
</span><span class="cx"> 
</span><span class="cx">     void scriptObjectReady();
</span><del>-    void windowUnloading();
</del><span class="cx"> 
</span><span class="cx">     void populateScriptResources();
</span><span class="cx">     void clearScriptResources();
</span><span class="lines">@@ -150,6 +160,7 @@
</span><span class="cx">     JSObjectRef m_controllerScriptObject;
</span><span class="cx">     JSContextRef m_scriptContext;
</span><span class="cx">     bool m_windowVisible;
</span><ins>+    SpecialPanels m_showAfterVisible;
</ins><span class="cx">     long long m_nextIdentifier;
</span><span class="cx"> };
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkWebCorepageinspectorinspectorjs"></a>
<div class="modfile"><h4>Modified: trunk/WebCore/page/inspector/inspector.js (27265 => 27266)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebCore/page/inspector/inspector.js        2007-10-30 21:18:18 UTC (rev 27265)
+++ trunk/WebCore/page/inspector/inspector.js        2007-10-30 21:26:19 UTC (rev 27266)
</span><span class="lines">@@ -567,6 +567,18 @@
</span><span class="cx">     document.getElementById(&quot;forward&quot;).disabled = index &gt;= this.backForwardList.length - 1;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+WebInspector.showConsole = function()
+{
+    this.showingStatusArea = true;
+    this.navigateToPanel(WebInspector.consolePanel);
+}
+
+WebInspector.showTimeline = function()
+{
+    this.showingStatusArea = true;
+    this.navigateToPanel(WebInspector.networkPanel);
+}
+
</ins><span class="cx"> WebInspector.addResource = function(resource)
</span><span class="cx"> {
</span><span class="cx">     this.resources.push(resource);
</span></span></pre></div>
<a id="trunkWebKitChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/WebKit/ChangeLog (27265 => 27266)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebKit/ChangeLog        2007-10-30 21:18:18 UTC (rev 27265)
+++ trunk/WebKit/ChangeLog        2007-10-30 21:26:19 UTC (rev 27266)
</span><span class="lines">@@ -1,3 +1,53 @@
</span><ins>+2007-10-29  Timothy Hatcher  &lt;timothy@apple.com&gt;
+
+        Reviewed by John Sullivan.
+
+        Various semi-related changes:
+        - A WebView can now be asked for it's WebInspector. There is one
+          WebInspector per WebView. 
+        - Refactor the WebInspector class and move obsolete methods to
+          a special category.
+        - Add new WebInspector methods to show, hide and show the
+          console/timeline panels.
+        - Add an isDisabled method to WebCache.
+        - Allow WebLocalizableStrings.h to be used in C files.
+
+        * Misc/WebCache.h: Add isDisabled.
+        * Misc/WebCache.mm:
+        (+[WebCache isDisabled]): New method.
+
+        * Misc/WebLocalizableStrings.h: Changes to allow use in plain C files.
+
+        * WebCoreSupport/WebInspectorClient.mm:
+        (-[WebInspectorWindowController showWindow:]): Call super if already visible
+          so the window will be ordered front.
+        (-[WebInspectorWindowController showWebInspector:]): Method used by menu items,
+          so they are enabled and work when the Inspector window is key.
+        (-[WebInspectorWindowController showErrorConsole:]): Ditto.
+        (-[WebInspectorWindowController showNetworkTimeline:]): Ditto.
+
+        * WebInspector/WebInspector.h: Add and remove methods.
+        * WebInspector/WebInspector.mm:
+        (-[WebInspector webViewClosed]): Called when the WebView is closed/dealloced.
+          Clears the _webView pointer.
+        (-[WebInspector show:]): Calls thru to the Page's InspectorController.
+        (-[WebInspector showConsole:]): Ditto.
+        (-[WebInspector showTimeline:]): Ditto.
+        (-[WebInspector close:]): Ditto.
+        (-[WebInspector attach:]): Ditto.
+        (-[WebInspector detach:]): Ditto.
+        (+[WebInspector sharedWebInspector]): Moved to the obsolete category.
+        (+[WebInspector webInspector]): Ditto.
+        (-[WebInspector setWebFrame:]): Ditto.
+        (-[WebInspector window]): Ditto.
+        (-[WebInspector showWindow:]): Ditto.
+
+        * WebView/WebView.mm:
+        (-[WebViewPrivate dealloc]): Release the WebInspector.
+        (-[WebView _close]): Call webViewClosed on the WebInspector.
+        (-[WebView inspector]): Create a WebInspector if needed and return it.
+        * WebView/WebViewPrivate.h: Add the inspector method.
+
</ins><span class="cx"> 2007-10-30  Adele Peterson  &lt;adele@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Reviewed by Darin.
</span></span></pre></div>
<a id="trunkWebKitMiscWebCacheh"></a>
<div class="modfile"><h4>Modified: trunk/WebKit/Misc/WebCache.h (27265 => 27266)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebKit/Misc/WebCache.h        2007-10-30 21:18:18 UTC (rev 27265)
+++ trunk/WebKit/Misc/WebCache.h        2007-10-30 21:26:19 UTC (rev 27266)
</span><span class="lines">@@ -30,5 +30,6 @@
</span><span class="cx"> + (NSArray *)statistics;
</span><span class="cx"> + (void)empty;
</span><span class="cx"> + (void)setDisabled:(BOOL)disabled;
</span><ins>++ (BOOL)isDisabled;
</ins><span class="cx"> 
</span><span class="cx"> @end
</span></span></pre></div>
<a id="trunkWebKitMiscWebCachemm"></a>
<div class="modfile"><h4>Modified: trunk/WebKit/Misc/WebCache.mm (27265 => 27266)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebKit/Misc/WebCache.mm        2007-10-30 21:18:18 UTC (rev 27265)
+++ trunk/WebKit/Misc/WebCache.mm        2007-10-30 21:26:19 UTC (rev 27266)
</span><span class="lines">@@ -74,4 +74,9 @@
</span><span class="cx">     WebCore::cache()-&gt;setDisabled(disabled);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>++ (BOOL)isDisabled
+{
+    return WebCore::cache()-&gt;disabled();
+}
+
</ins><span class="cx"> @end
</span></span></pre></div>
<a id="trunkWebKitMiscWebLocalizableStringsh"></a>
<div class="modfile"><h4>Modified: trunk/WebKit/Misc/WebLocalizableStrings.h (27265 => 27266)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebKit/Misc/WebLocalizableStrings.h        2007-10-30 21:18:18 UTC (rev 27265)
+++ trunk/WebKit/Misc/WebLocalizableStrings.h        2007-10-30 21:26:19 UTC (rev 27266)
</span><span class="lines">@@ -26,7 +26,11 @@
</span><span class="cx">  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
</span><span class="cx">  */
</span><span class="cx"> 
</span><del>-#import &lt;Foundation/Foundation.h&gt;
</del><ins>+#if __OBJC__
+@class NSBundle;
+#else
+typedef struct NSBundle NSBundle;
+#endif
</ins><span class="cx"> 
</span><span class="cx"> typedef struct {
</span><span class="cx">     const char *identifier;
</span><span class="lines">@@ -37,7 +41,11 @@
</span><span class="cx"> extern &quot;C&quot; {
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><ins>+#if __OBJC__
</ins><span class="cx"> NSString *WebLocalizedString(WebLocalizableStringsBundle *bundle, const char *key);
</span><ins>+#else
+CFStringRef WebLocalizedString(WebLocalizableStringsBundle *bundle, const char *key);
+#endif
</ins><span class="cx"> 
</span><span class="cx"> #ifdef __cplusplus
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkWebKitWebCoreSupportWebInspectorClientmm"></a>
<div class="modfile"><h4>Modified: trunk/WebKit/WebCoreSupport/WebInspectorClient.mm (27265 => 27266)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebKit/WebCoreSupport/WebInspectorClient.mm        2007-10-30 21:18:18 UTC (rev 27265)
+++ trunk/WebKit/WebCoreSupport/WebInspectorClient.mm        2007-10-30 21:26:19 UTC (rev 27266)
</span><span class="lines">@@ -293,8 +293,11 @@
</span><span class="cx"> 
</span><span class="cx"> - (IBAction)showWindow:(id)sender
</span><span class="cx"> {
</span><del>-    if (_visible)
</del><ins>+    if (_visible) {
+        if (!_attachedToInspectedWebView)
+            [super showWindow:sender]; // call super so the window will be ordered front if needed
</ins><span class="cx">         return;
</span><ins>+    }
</ins><span class="cx"> 
</span><span class="cx">     _visible = YES;
</span><span class="cx"> 
</span><span class="lines">@@ -471,4 +474,25 @@
</span><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+
+#pragma mark -
+
+// These methods can be used by UI elements such as menu items and toolbar buttons when the inspector is the key window.
+
+// This method is really only implemented to keep any UI elements enabled.
+- (void)showWebInspector:(id)sender
+{
+    [_inspectedWebView page]-&gt;inspectorController()-&gt;show();
+}
+
+- (void)showErrorConsole:(id)sender
+{
+    [_inspectedWebView page]-&gt;inspectorController()-&gt;showConsole();
+}
+
+- (void)showNetworkTimeline:(id)sender
+{
+    [_inspectedWebView page]-&gt;inspectorController()-&gt;showTimeline();
+}
+
</ins><span class="cx"> @end
</span></span></pre></div>
<a id="trunkWebKitWebInspectorWebInspectorh"></a>
<div class="modfile"><h4>Modified: trunk/WebKit/WebInspector/WebInspector.h (27265 => 27266)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebKit/WebInspector/WebInspector.h        2007-10-30 21:18:18 UTC (rev 27265)
+++ trunk/WebKit/WebInspector/WebInspector.h        2007-10-30 21:26:19 UTC (rev 27266)
</span><span class="lines">@@ -26,17 +26,20 @@
</span><span class="cx">  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
</span><span class="cx">  */
</span><span class="cx"> 
</span><del>-#import &lt;Foundation/Foundation.h&gt;
</del><ins>+#import &lt;Foundation/NSObject.h&gt;
</ins><span class="cx"> 
</span><del>-@class WebFrame;
</del><span class="cx"> @class WebView;
</span><span class="cx"> 
</span><span class="cx"> @interface WebInspector : NSObject
</span><span class="cx"> {
</span><span class="cx">     WebView *_webView;
</span><span class="cx"> }
</span><del>-+ (WebInspector *)sharedWebInspector;
-+ (WebInspector *)webInspector;
-- (void)setWebFrame:(WebFrame*)frame;
-- (void)showWindow:(id)sender;
</del><ins>+- (id)initWithWebView:(WebView *)webView;
+- (void)webViewClosed;
+- (void)show:(id)sender;
+- (void)showConsole:(id)sender;
+- (void)showTimeline:(id)sender;
+- (void)close:(id)sender;
+- (void)attach:(id)sender;
+- (void)detach:(id)sender;
</ins><span class="cx"> @end
</span></span></pre></div>
<a id="trunkWebKitWebInspectorWebInspectormm"></a>
<div class="modfile"><h4>Modified: trunk/WebKit/WebInspector/WebInspector.mm (27265 => 27266)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebKit/WebInspector/WebInspector.mm        2007-10-30 21:18:18 UTC (rev 27265)
+++ trunk/WebKit/WebInspector/WebInspector.mm        2007-10-30 21:26:19 UTC (rev 27266)
</span><span class="lines">@@ -38,28 +38,91 @@
</span><span class="cx"> using namespace WebCore;
</span><span class="cx"> 
</span><span class="cx"> @implementation WebInspector
</span><ins>+- (id)initWithWebView:(WebView *)webView
+{
+    if (!(self = [super init]))
+        return nil;
+    _webView = webView; // not retained to prevent a cycle
+    return self;
+}
</ins><span class="cx"> 
</span><del>-// This method name is used by the Safari 3 beta
-+ (WebInspector *)sharedWebInspector
</del><ins>+- (void)webViewClosed
</ins><span class="cx"> {
</span><del>-    return [self webInspector];
</del><ins>+    _webView = nil;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-+ (WebInspector *)webInspector
</del><ins>+- (void)show:(id)sender
</ins><span class="cx"> {
</span><ins>+    if (Page* page = core(_webView))
+        page-&gt;inspectorController()-&gt;show();
+}
+
+- (void)showConsole:(id)sender
+{
+    if (Page* page = core(_webView))
+        page-&gt;inspectorController()-&gt;showConsole();
+}
+
+- (void)showTimeline:(id)sender
+{
+    if (Page* page = core(_webView))
+        page-&gt;inspectorController()-&gt;showTimeline();
+}
+
+- (void)close:(id)sender 
+{
+    if (Page* page = core(_webView))
+        page-&gt;inspectorController()-&gt;close();
+}
+
+- (void)attach:(id)sender
+{
+    if (Page* page = core(_webView))
+        page-&gt;inspectorController()-&gt;attachWindow();
+}
+
+- (void)detach:(id)sender
+{
+    if (Page* page = core(_webView))
+        page-&gt;inspectorController()-&gt;detachWindow();
+}
+@end
+
+@implementation WebInspector (Obsolete)
++ (WebInspector *)sharedWebInspector
+{
+    // Safari 3 beta calls this method
+    static BOOL logged = NO;
+    if (!logged) {
+        NSLog(@&quot;+[WebInspector sharedWebInspector]: this method is obsolete.&quot;);
+        logged = YES;
+    }
+
</ins><span class="cx">     return [[[WebInspector alloc] init] autorelease];
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-- (void)dealloc
</del><ins>++ (WebInspector *)webInspector
</ins><span class="cx"> {
</span><del>-    [_webView release];
-    [super dealloc];
</del><ins>+    // Safari 3 beta calls this method
+    static BOOL logged = NO;
+    if (!logged) {
+        NSLog(@&quot;+[WebInspector webInspector]: this method is obsolete.&quot;);
+        logged = YES;
+    }
+
+    return [[[WebInspector alloc] init] autorelease];
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> - (void)setWebFrame:(WebFrame *)frame
</span><span class="cx"> {
</span><del>-    [_webView release];
-    _webView = [[frame webView] retain];
</del><ins>+    // Safari 3 beta calls this method
+    static BOOL logged = NO;
+    if (!logged) {
+        NSLog(@&quot;-[WebInspector setWebFrame:]: this method is obsolete.&quot;);
+        logged = YES;
+    }
+
+    _webView = [frame webView];
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> - (NSWindow *)window
</span><span class="lines">@@ -67,7 +130,7 @@
</span><span class="cx">     // Shiira calls this internal method, return nil since we can't easily return the window
</span><span class="cx">     static BOOL logged = NO;
</span><span class="cx">     if (!logged) {
</span><del>-        NSLog(@&quot;-[WebInspector window]: this method is obsolete and now returns nil. The WebInspector class will be removed in a future release.&quot;);
</del><ins>+        NSLog(@&quot;-[WebInspector window]: this method is obsolete and now returns nil.&quot;);
</ins><span class="cx">         logged = YES;
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="lines">@@ -76,8 +139,13 @@
</span><span class="cx"> 
</span><span class="cx"> - (void)showWindow:(id)sender
</span><span class="cx"> {
</span><del>-    if (Page* page = core(_webView))
-        if (InspectorController* inspectorController = page-&gt;inspectorController())
-            inspectorController-&gt;inspect(page-&gt;mainFrame()-&gt;document());
</del><ins>+    // Safari 3 beta calls this method
+    static BOOL logged = NO;
+    if (!logged) {
+        NSLog(@&quot;-[WebInspector showWindow:]: this method is obsolete.&quot;);
+        logged = YES;
+    }
+
+    [self show:sender];
</ins><span class="cx"> }
</span><span class="cx"> @end
</span></span></pre></div>
<a id="trunkWebKitWebViewWebViewmm"></a>
<div class="modfile"><h4>Modified: trunk/WebKit/WebView/WebView.mm (27265 => 27266)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebKit/WebView/WebView.mm        2007-10-30 21:18:18 UTC (rev 27265)
+++ trunk/WebKit/WebView/WebView.mm        2007-10-30 21:26:19 UTC (rev 27266)
</span><span class="lines">@@ -60,6 +60,7 @@
</span><span class="cx"> #import &quot;WebHistoryItemInternal.h&quot;
</span><span class="cx"> #import &quot;WebIconDatabase.h&quot;
</span><span class="cx"> #import &quot;WebIconDatabaseInternal.h&quot;
</span><ins>+#import &quot;WebInspector.h&quot;
</ins><span class="cx"> #import &quot;WebInspectorClient.h&quot;
</span><span class="cx"> #import &quot;WebKitErrors.h&quot;
</span><span class="cx"> #import &quot;WebKitLogging.h&quot;
</span><span class="lines">@@ -294,6 +295,8 @@
</span><span class="cx">     id scriptDebugDelegate;
</span><span class="cx">     id scriptDebugDelegateForwarder;
</span><span class="cx"> 
</span><ins>+    WebInspector *inspector;
+
</ins><span class="cx">     BOOL allowsUndo;
</span><span class="cx">         
</span><span class="cx">     float textSizeMultiplier;
</span><span class="lines">@@ -466,6 +469,7 @@
</span><span class="cx">     [applicationNameForUserAgent release];
</span><span class="cx">     [backgroundColor release];
</span><span class="cx">     
</span><ins>+    [inspector release];
</ins><span class="cx">     [hostWindow release];
</span><span class="cx"> 
</span><span class="cx">     [policyDelegateForwarder release];
</span><span class="lines">@@ -696,7 +700,9 @@
</span><span class="cx">     [self setResourceLoadDelegate:nil];
</span><span class="cx">     [self setScriptDebugDelegate:nil];
</span><span class="cx">     [self setUIDelegate:nil];
</span><del>-    
</del><ins>+
+    [_private-&gt;inspector webViewClosed];
+
</ins><span class="cx">     // setHostWindow:nil must be called before this value is set (see 5408186)
</span><span class="cx">     _private-&gt;closed = YES;
</span><span class="cx"> 
</span><span class="lines">@@ -788,6 +794,13 @@
</span><span class="cx">     return newWindowWebView;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+- (WebInspector *)inspector
+{
+    if (!_private-&gt;inspector)
+        _private-&gt;inspector = [[WebInspector alloc] initWithWebView:self];
+    return _private-&gt;inspector;
+}
+
</ins><span class="cx"> - (WebCore::Page*)page
</span><span class="cx"> {
</span><span class="cx">     return _private-&gt;page;
</span></span></pre></div>
<a id="trunkWebKitWebViewWebViewPrivateh"></a>
<div class="modfile"><h4>Modified: trunk/WebKit/WebView/WebViewPrivate.h (27265 => 27266)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebKit/WebView/WebViewPrivate.h        2007-10-30 21:18:18 UTC (rev 27265)
+++ trunk/WebKit/WebView/WebViewPrivate.h        2007-10-30 21:26:19 UTC (rev 27266)
</span><span class="lines">@@ -39,6 +39,7 @@
</span><span class="cx"> 
</span><span class="cx"> @class NSError;
</span><span class="cx"> @class WebFrame;
</span><ins>+@class WebInspector;
</ins><span class="cx"> @class WebPreferences;
</span><span class="cx"> 
</span><span class="cx"> @protocol WebFormDelegate;
</span><span class="lines">@@ -152,6 +153,8 @@
</span><span class="cx"> + (BOOL)_developerExtrasEnabled;
</span><span class="cx"> + (BOOL)_scriptDebuggerEnabled;
</span><span class="cx"> 
</span><ins>+- (WebInspector *)inspector;
+
</ins><span class="cx"> /*!
</span><span class="cx">     @method setBackgroundColor:
</span><span class="cx">     @param backgroundColor Color to use as the default background.
</span></span></pre></div>
<a id="trunkWebKitToolsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/WebKitTools/ChangeLog (27265 => 27266)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebKitTools/ChangeLog        2007-10-30 21:18:18 UTC (rev 27265)
+++ trunk/WebKitTools/ChangeLog        2007-10-30 21:26:19 UTC (rev 27266)
</span><span class="lines">@@ -1,3 +1,13 @@
</span><ins>+2007-10-29  Timothy Hatcher  &lt;timothy@apple.com&gt;
+
+        Reviewed by John Sullivan.
+        
+        - Place the Localizable.strings file in mac or win directories
+          if that location exists.
+        - Also look for UI_STRING in .c files.
+
+        * Scripts/extract-localizable-strings:
+
</ins><span class="cx"> 2007-10-30  Kevin McCullough  &lt;kmccullough@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Reviewed by Adam.
</span><span class="lines">@@ -31,7 +41,6 @@
</span><span class="cx">         (ServerConnection::getCallerFrame):
</span><span class="cx">         * Drosera/win/ServerConnection.h: Added a helper function.
</span><span class="cx"> 
</span><del>-
</del><span class="cx"> 2007-10-29  Kevin McCullough  &lt;kmccullough@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         updated reviewers for my previous changelog.
</span></span></pre></div>
<a id="trunkWebKitToolsScriptsextractlocalizablestrings"></a>
<div class="modfile"><h4>Modified: trunk/WebKitTools/Scripts/extract-localizable-strings (27265 => 27266)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebKitTools/Scripts/extract-localizable-strings        2007-10-30 21:18:18 UTC (rev 27265)
+++ trunk/WebKitTools/Scripts/extract-localizable-strings        2007-10-30 21:26:19 UTC (rev 27266)
</span><span class="lines">@@ -79,7 +79,7 @@
</span><span class="cx"> if (open EXCEPTIONS, $exceptionsFile) {
</span><span class="cx">     while (&lt;EXCEPTIONS&gt;) {
</span><span class="cx">         chomp;
</span><del>-        if (/^&quot;([^\\&quot;]|\\.)*&quot;$/ or /^[-_\/\w.]+.(h|m|mm|cpp)$/ or /^[-_\/\w.]+.(h|m|mm|cpp):&quot;([^\\&quot;]|\\.)*&quot;$/) {
</del><ins>+        if (/^&quot;([^\\&quot;]|\\.)*&quot;$/ or /^[-_\/\w.]+.(h|m|mm|c|cpp)$/ or /^[-_\/\w.]+.(h|m|mm|c|cpp):&quot;([^\\&quot;]|\\.)*&quot;$/) {
</ins><span class="cx">             if ($exception{$_}) {
</span><span class="cx">                 print &quot;$exceptionsFile:$.:exception for $_ appears twice\n&quot;;
</span><span class="cx">                 print &quot;$exceptionsFile:$exception{$_}:first appearance\n&quot;;
</span><span class="lines">@@ -98,7 +98,7 @@
</span><span class="cx">     $quotedDirectoriesString .= ' -path &quot;' . $dir . '&quot; -prune';
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-my @files = ( split &quot;\n&quot;, `find $quotedDirectoriesString -name &quot;*.h&quot; -o -name &quot;*.m&quot; -o -name &quot;*.mm&quot; -o -name &quot;*.cpp&quot;` );
</del><ins>+my @files = ( split &quot;\n&quot;, `find $quotedDirectoriesString -name &quot;*.h&quot; -o -name &quot;*.m&quot; -o -name &quot;*.mm&quot; -o -name &quot;*.c&quot; -o -name &quot;*.cpp&quot;` );
</ins><span class="cx"> 
</span><span class="cx"> for my $file (sort @files) {
</span><span class="cx">     next if $file =~ /\/WebLocalizableStrings\.h$/;
</span><span class="lines">@@ -339,7 +339,21 @@
</span><span class="cx"> utf8::decode($localizedStrings) if $^V ge chr(5).chr(8);
</span><span class="cx"> my $output = pack &quot;n*&quot;, (0xFEFF, unpack &quot;U*&quot;, $localizedStrings);
</span><span class="cx"> foreach my $directory (@directories) {
</span><del>-    open STRINGS, &quot;&gt;&quot;, &quot;$directory/$stringsFile&quot; or die;
-    print STRINGS $output;
-    close STRINGS;
</del><ins>+    if (-e &quot;$directory/mac/$stringsFile&quot;) {
+        open STRINGS, &quot;&gt;&quot;, &quot;$directory/mac/$stringsFile&quot; or die;
+        print STRINGS $output;
+        close STRINGS;
+    }
+
+    if (-e &quot;$directory/win/$stringsFile&quot;) {
+        open STRINGS, &quot;&gt;&quot;, &quot;$directory/win/$stringsFile&quot; or die;
+        print STRINGS $output;
+        close STRINGS;
+    }
+
+    if (-e &quot;$directory/$stringsFile&quot;) {
+        open STRINGS, &quot;&gt;&quot;, &quot;$directory/$stringsFile&quot; or die;
+        print STRINGS $output;
+        close STRINGS;
+    }
</ins><span class="cx"> }
</span></span></pre>
</div>
</div>

</body>
</html>