summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordarin@chromium.org <darin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2008-11-11 05:42:05 +0000
committerdarin@chromium.org <darin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2008-11-11 05:42:05 +0000
commitf00e3445a8f44e5d3271ac63e10cc34bc02dc86b (patch)
treeea0924f2617d765987993cc2187b80e1b429a461
parent542944a740ffd4ab7a89f392baa3f06fe88af258 (diff)
downloadchromium_src-f00e3445a8f44e5d3271ac63e10cc34bc02dc86b.zip
chromium_src-f00e3445a8f44e5d3271ac63e10cc34bc02dc86b.tar.gz
chromium_src-f00e3445a8f44e5d3271ac63e10cc34bc02dc86b.tar.bz2
Eliminate another dependency of port on glue.
R=eseidel Review URL: http://codereview.chromium.org/10288 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@5163 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--webkit/glue/chromium_bridge_impl.cc6
-rw-r--r--webkit/port/platform/chromium/ChromiumBridge.h3
-rw-r--r--webkit/port/platform/chromium/Language.cpp64
3 files changed, 40 insertions, 33 deletions
diff --git a/webkit/glue/chromium_bridge_impl.cc b/webkit/glue/chromium_bridge_impl.cc
index 010e7e3..0289f81 100644
--- a/webkit/glue/chromium_bridge_impl.cc
+++ b/webkit/glue/chromium_bridge_impl.cc
@@ -67,6 +67,12 @@ void ChromiumBridge::prefetchDNS(const String& hostname) {
webkit_glue::PrefetchDns(webkit_glue::StringToStdString(hostname));
}
+// Language -------------------------------------------------------------------
+
+String ChromiumBridge::computedDefaultLanguage() {
+ return webkit_glue::StdWStringToString(webkit_glue::GetWebKitLocale());
+}
+
// Screen ---------------------------------------------------------------------
int ChromiumBridge::screenDepth(Widget* widget) {
diff --git a/webkit/port/platform/chromium/ChromiumBridge.h b/webkit/port/platform/chromium/ChromiumBridge.h
index d83db48..2777c22 100644
--- a/webkit/port/platform/chromium/ChromiumBridge.h
+++ b/webkit/port/platform/chromium/ChromiumBridge.h
@@ -49,6 +49,9 @@ namespace WebCore {
// DNS ----------------------------------------------------------------
static void prefetchDNS(const String& hostname);
+ // Language -----------------------------------------------------------
+ static String computedDefaultLanguage();
+
// Screen -------------------------------------------------------------
static int screenDepth(Widget*);
static int screenDepthPerComponent(Widget*);
diff --git a/webkit/port/platform/chromium/Language.cpp b/webkit/port/platform/chromium/Language.cpp
index b21f7d4..343cac2 100644
--- a/webkit/port/platform/chromium/Language.cpp
+++ b/webkit/port/platform/chromium/Language.cpp
@@ -1,47 +1,45 @@
-/*
- * Copyright (C) 2007 Apple 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:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. 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.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``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 APPLE COMPUTER, INC. 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.
- */
+// Copyright (c) 2008, 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.
#include "config.h"
#include "Language.h"
-#include "CString.h"
+#include "ChromiumBridge.h"
#include "PlatformString.h"
-#include "webkit/glue/glue_util.h"
-#include "webkit/glue/webkit_glue.h"
-
namespace WebCore {
String defaultLanguage()
{
static String computedDefaultLanguage;
- if (!computedDefaultLanguage.isEmpty())
- return computedDefaultLanguage;
-
- computedDefaultLanguage =
- webkit_glue::StdWStringToString(webkit_glue::GetWebKitLocale());
+ if (computedDefaultLanguage.isEmpty())
+ computedDefaultLanguage = ChromiumBridge::computedDefaultLanguage();
return computedDefaultLanguage;
}