Title: [118384] trunk/Source
Revision
118384
Author
[email protected]
Date
2012-05-24 09:29:22 -0700 (Thu, 24 May 2012)

Log Message

[Chromium] Move queryLocalizedString to Platform.h
https://bugs.webkit.org/show_bug.cgi?id=85762

Reviewed by Adam Barth.

Part of a refactoring series. See tracking bug 82948.

Source/Platform:

* Platform.gypi:
* chromium/public/Platform.h:
(WebKit):
(Platform):
(WebKit::Platform::queryLocalizedString):
* chromium/public/WebLocalizedString.h: Added.
(WebKit):

Source/WebKit/chromium:

* WebKit.gyp:
* public/platform/WebKitPlatformSupport.h:
(WebKit::WebKitPlatformSupport::getPluginList):
* public/platform/WebLocalizedString.h:
* src/LocalizedStrings.cpp:
(WebCore::query):

Modified Paths

Added Paths

Diff

Modified: trunk/Source/Platform/ChangeLog (118383 => 118384)


--- trunk/Source/Platform/ChangeLog	2012-05-24 16:25:12 UTC (rev 118383)
+++ trunk/Source/Platform/ChangeLog	2012-05-24 16:29:22 UTC (rev 118384)
@@ -1,3 +1,20 @@
+2012-05-24  Mark Pilgrim  <[email protected]>
+
+        [Chromium] Move queryLocalizedString to Platform.h
+        https://bugs.webkit.org/show_bug.cgi?id=85762
+
+        Reviewed by Adam Barth.
+
+        Part of a refactoring series. See tracking bug 82948.
+
+        * Platform.gypi:
+        * chromium/public/Platform.h:
+        (WebKit):
+        (Platform):
+        (WebKit::Platform::queryLocalizedString):
+        * chromium/public/WebLocalizedString.h: Added.
+        (WebKit):
+
 2012-05-23  Sheriff Bot  <[email protected]>
 
         Unreviewed, rolling out r118218.

Modified: trunk/Source/Platform/Platform.gypi (118383 => 118384)


--- trunk/Source/Platform/Platform.gypi	2012-05-24 16:25:12 UTC (rev 118383)
+++ trunk/Source/Platform/Platform.gypi	2012-05-24 16:29:22 UTC (rev 118384)
@@ -68,6 +68,7 @@
             'chromium/public/WebLayer.h',
             'chromium/public/WebLayerTreeView.h',
             'chromium/public/WebLayerTreeViewClient.h',
+            'chromium/public/WebLocalizedString.h',
             'chromium/public/WebMediaHints.h',
             'chromium/public/WebMediaStreamCenter.h',
             'chromium/public/WebMediaStreamCenterClient.h',

Modified: trunk/Source/Platform/chromium/public/Platform.h (118383 => 118384)


--- trunk/Source/Platform/chromium/public/Platform.h	2012-05-24 16:25:12 UTC (rev 118383)
+++ trunk/Source/Platform/chromium/public/Platform.h	2012-05-24 16:29:22 UTC (rev 118384)
@@ -36,6 +36,7 @@
 #include "WebData.h"
 #include "WebGamepads.h"
 #include "WebGraphicsContext3D.h"
+#include "WebLocalizedString.h"
 #include "WebString.h"
 
 namespace WebKit {
@@ -59,6 +60,7 @@
 class WebThemeEngine;
 class WebThread;
 class WebWorkerRunLoop;
+struct WebLocalizedString;
 
 class Platform {
 public:
@@ -165,6 +167,14 @@
     virtual void cacheMetadata(const WebURL&, double responseTime, const char* data, size_t dataSize) { }
 
 
+    // Resources -----------------------------------------------------------
+
+    // Returns a localized string resource (with substitution parameters).
+    virtual WebString queryLocalizedString(WebLocalizedString::Name) { return WebString(); }
+    virtual WebString queryLocalizedString(WebLocalizedString::Name, const WebString& parameter) { return WebString(); }
+    virtual WebString queryLocalizedString(WebLocalizedString::Name, const WebString& parameter1, const WebString& parameter2) { return WebString(); }
+
+
     // Threads -------------------------------------------------------
 
     // Creates an embedder-defined thread.

Copied: trunk/Source/Platform/chromium/public/WebLocalizedString.h (from rev 118383, trunk/Source/WebKit/chromium/public/platform/WebLocalizedString.h) (0 => 118384)


--- trunk/Source/Platform/chromium/public/WebLocalizedString.h	                        (rev 0)
+++ trunk/Source/Platform/chromium/public/WebLocalizedString.h	2012-05-24 16:29:22 UTC (rev 118384)
@@ -0,0 +1,89 @@
+/*
+ * Copyright (C) 2009 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ *     * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *     * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ *     * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef WebLocalizedString_h
+#define WebLocalizedString_h
+
+namespace WebKit {
+
+struct WebLocalizedString {
+    enum Name {
+        AXButtonActionVerb,
+        AXCheckedCheckBoxActionVerb,
+        AXHeadingText,
+        AXImageMapText,
+        AXLinkActionVerb,
+        AXLinkText,
+        AXListMarkerText,
+        AXRadioButtonActionVerb,
+        AXTextFieldActionVerb,
+        AXUncheckedCheckBoxActionVerb,
+        AXWebAreaText,
+        CalendarClear,
+        CalendarToday,
+        DateFormatDayInMonthLabel,
+        DateFormatMonthLabel,
+        DateFormatYearLabel,
+        DetailsLabel,
+        FileButtonChooseFileLabel,
+        FileButtonChooseMultipleFilesLabel,
+        FileButtonNoFileSelectedLabel,
+        InputElementAltText,
+        KeygenMenuHighGradeKeySize,
+        KeygenMenuMediumGradeKeySize,
+        MissingPluginText,
+        MultipleFileUploadText,
+        ResetButtonDefaultLabel,
+        SearchableIndexIntroduction,
+        SearchMenuClearRecentSearchesText,
+        SearchMenuNoRecentSearchesText,
+        SearchMenuRecentSearchesText,
+        SubmitButtonDefaultLabel,
+        ValidationPatternMismatch,
+        ValidationRangeOverflow,
+        ValidationRangeUnderflow,
+        ValidationStepMismatch,
+        ValidationTooLong,
+        ValidationTypeMismatch,
+        ValidationTypeMismatchForEmail,
+        ValidationTypeMismatchForMultipleEmail,
+        ValidationTypeMismatchForURL,
+        ValidationValueMissing,
+        ValidationValueMissingForCheckbox,
+        ValidationValueMissingForFile,
+        ValidationValueMissingForMultipleFile,
+        ValidationValueMissingForRadio,
+        ValidationValueMissingForSelect,
+    };
+};
+
+} // namespace WebKit
+
+#endif

Modified: trunk/Source/WebKit/chromium/ChangeLog (118383 => 118384)


--- trunk/Source/WebKit/chromium/ChangeLog	2012-05-24 16:25:12 UTC (rev 118383)
+++ trunk/Source/WebKit/chromium/ChangeLog	2012-05-24 16:29:22 UTC (rev 118384)
@@ -1,3 +1,19 @@
+2012-05-24  Mark Pilgrim  <[email protected]>
+
+        [Chromium] Move queryLocalizedString to Platform.h
+        https://bugs.webkit.org/show_bug.cgi?id=85762
+
+        Reviewed by Adam Barth.
+
+        Part of a refactoring series. See tracking bug 82948.
+
+        * WebKit.gyp:
+        * public/platform/WebKitPlatformSupport.h:
+        (WebKit::WebKitPlatformSupport::getPluginList):
+        * public/platform/WebLocalizedString.h:
+        * src/LocalizedStrings.cpp:
+        (WebCore::query):
+
 2012-05-24  Dana Jansens  <[email protected]>
 
         [chromium] Only display frames created with memory allocations meant to be displayed

Modified: trunk/Source/WebKit/chromium/WebKit.gyp (118383 => 118384)


--- trunk/Source/WebKit/chromium/WebKit.gyp	2012-05-24 16:25:12 UTC (rev 118383)
+++ trunk/Source/WebKit/chromium/WebKit.gyp	2012-05-24 16:29:22 UTC (rev 118384)
@@ -317,7 +317,6 @@
                 'public/platform/WebLayer.h',
                 'public/platform/WebLayerTreeView.h',
                 'public/platform/WebLayerTreeViewClient.h',
-                'public/platform/WebLocalizedString.h',
                 'public/platform/WebNonCopyable.h',
                 'public/platform/WebPoint.h',
                 'public/platform/WebPrivateOwnPtr.h',

Modified: trunk/Source/WebKit/chromium/public/platform/WebKitPlatformSupport.h (118383 => 118384)


--- trunk/Source/WebKit/chromium/public/platform/WebKitPlatformSupport.h	2012-05-24 16:25:12 UTC (rev 118383)
+++ trunk/Source/WebKit/chromium/public/platform/WebKitPlatformSupport.h	2012-05-24 16:29:22 UTC (rev 118384)
@@ -33,7 +33,6 @@
 
 #include "WebCommon.h"
 #include "WebGraphicsContext3D.h"
-#include "WebLocalizedString.h"
 #include "WebSerializedScriptValue.h"
 #include "WebString.h"
 #include "WebURL.h"
@@ -116,14 +115,6 @@
     virtual void getPluginList(bool refresh, WebPluginListBuilder*) { }
 
 
-    // Resources -----------------------------------------------------------
-
-    // Returns a localized string resource (with substitution parameters).
-    virtual WebString queryLocalizedString(WebLocalizedString::Name) { return WebString(); }
-    virtual WebString queryLocalizedString(WebLocalizedString::Name, const WebString& parameter) { return WebString(); }
-    virtual WebString queryLocalizedString(WebLocalizedString::Name, const WebString& parameter1, const WebString& parameter2) { return WebString(); }
-
-
     // Shared Workers ------------------------------------------------------
 
     virtual WebSharedWorkerRepository* sharedWorkerRepository() { return 0; }

Modified: trunk/Source/WebKit/chromium/public/platform/WebLocalizedString.h (118383 => 118384)


--- trunk/Source/WebKit/chromium/public/platform/WebLocalizedString.h	2012-05-24 16:25:12 UTC (rev 118383)
+++ trunk/Source/WebKit/chromium/public/platform/WebLocalizedString.h	2012-05-24 16:29:22 UTC (rev 118384)
@@ -28,62 +28,4 @@
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#ifndef WebLocalizedString_h
-#define WebLocalizedString_h
-
-namespace WebKit {
-
-struct WebLocalizedString {
-    enum Name {
-        AXButtonActionVerb,
-        AXCheckedCheckBoxActionVerb,
-        AXHeadingText,
-        AXImageMapText,
-        AXLinkActionVerb,
-        AXLinkText,
-        AXListMarkerText,
-        AXRadioButtonActionVerb,
-        AXTextFieldActionVerb,
-        AXUncheckedCheckBoxActionVerb,
-        AXWebAreaText,
-        CalendarClear,
-        CalendarToday,
-        DateFormatDayInMonthLabel,
-        DateFormatMonthLabel,
-        DateFormatYearLabel,
-        DetailsLabel,
-        FileButtonChooseFileLabel,
-        FileButtonChooseMultipleFilesLabel,
-        FileButtonNoFileSelectedLabel,
-        InputElementAltText,
-        KeygenMenuHighGradeKeySize,
-        KeygenMenuMediumGradeKeySize,
-        MissingPluginText,
-        MultipleFileUploadText,
-        ResetButtonDefaultLabel,
-        SearchableIndexIntroduction,
-        SearchMenuClearRecentSearchesText,
-        SearchMenuNoRecentSearchesText,
-        SearchMenuRecentSearchesText,
-        SubmitButtonDefaultLabel,
-        ValidationPatternMismatch,
-        ValidationRangeOverflow,
-        ValidationRangeUnderflow,
-        ValidationStepMismatch,
-        ValidationTooLong,
-        ValidationTypeMismatch,
-        ValidationTypeMismatchForEmail,
-        ValidationTypeMismatchForMultipleEmail,
-        ValidationTypeMismatchForURL,
-        ValidationValueMissing,
-        ValidationValueMissingForCheckbox,
-        ValidationValueMissingForFile,
-        ValidationValueMissingForMultipleFile,
-        ValidationValueMissingForRadio,
-        ValidationValueMissingForSelect,
-    };
-};
-
-} // namespace WebKit
-
-#endif
+#include "../../../../Platform/chromium/public/WebLocalizedString.h"

Modified: trunk/Source/WebKit/chromium/src/LocalizedStrings.cpp (118383 => 118384)


--- trunk/Source/WebKit/chromium/src/LocalizedStrings.cpp	2012-05-24 16:25:12 UTC (rev 118383)
+++ trunk/Source/WebKit/chromium/src/LocalizedStrings.cpp	2012-05-24 16:29:22 UTC (rev 118384)
@@ -36,9 +36,9 @@
 
 #include "WebKit.h"
 #include "platform/WebKitPlatformSupport.h"
-#include "platform/WebLocalizedString.h"
 #include "platform/WebString.h"
 
+#include <public/WebLocalizedString.h>
 #include <wtf/text/StringBuilder.h>
 #include <wtf/text/WTFString.h>
 
@@ -49,17 +49,17 @@
 
 static String query(WebLocalizedString::Name name)
 {
-    return WebKit::webKitPlatformSupport()->queryLocalizedString(name);
+    return WebKit::Platform::current()->queryLocalizedString(name);
 }
 
 static String query(WebLocalizedString::Name name, const WebString& parameter)
 {
-    return WebKit::webKitPlatformSupport()->queryLocalizedString(name, parameter);
+    return WebKit::Platform::current()->queryLocalizedString(name, parameter);
 }
 
 static String query(WebLocalizedString::Name name, const WebString& parameter1, const WebString& parameter2)
 {
-    return WebKit::webKitPlatformSupport()->queryLocalizedString(name, parameter1, parameter2);
+    return WebKit::Platform::current()->queryLocalizedString(name, parameter1, parameter2);
 }
 
 String searchableIndexIntroduction()
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to