Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3409)

Unified Diff: chrome/common/localized_error.cc

Issue 10830218: Move localized_error from chrome/renderer into chrome/common. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: add comment Created 8 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/common/localized_error.cc
diff --git a/chrome/renderer/localized_error.cc b/chrome/common/localized_error.cc
similarity index 98%
rename from chrome/renderer/localized_error.cc
rename to chrome/common/localized_error.cc
index 430c4afc9957475a75443a998a7959d43fadc5fa..56dd428a71e22ef395ec374b47713064dcd80540 100644
--- a/chrome/renderer/localized_error.cc
+++ b/chrome/common/localized_error.cc
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "chrome/renderer/localized_error.h"
+#include "chrome/common/localized_error.h"
#include "base/i18n/rtl.h"
#include "base/logging.h"
@@ -12,7 +12,6 @@
#include "base/values.h"
#include "chrome/common/extensions/extension_icon_set.h"
#include "chrome/common/extensions/extension_set.h"
-#include "content/public/renderer/render_thread.h"
#include "googleurl/src/gurl.h"
#include "grit/chromium_strings.h"
#include "grit/generated_resources.h"
@@ -27,7 +26,6 @@
#endif
using WebKit::WebURLError;
-using content::RenderThread;
namespace {
@@ -442,7 +440,8 @@ DictionaryValue* GetStandardMenuItemsText() {
const char LocalizedError::kHttpErrorDomain[] = "http";
void LocalizedError::GetStrings(const WebKit::WebURLError& error,
- DictionaryValue* error_strings) {
+ DictionaryValue* error_strings,
+ const std::string& locale) {
bool rtl = LocaleIsRTL();
error_strings->SetString("textdirection", rtl ? "rtl" : "ltr");
@@ -654,9 +653,7 @@ void LocalizedError::GetStrings(const WebKit::WebURLError& error,
if (learn_more_url.is_valid()) {
// Add the language parameter to the URL.
- std::string query = learn_more_url.query() + "&hl=" +
- RenderThread::Get()->GetLocale();
-
+ std::string query = learn_more_url.query() + "&hl=" + locale;
GURL::Replacements repl;
repl.SetQueryStr(query);
learn_more_url = learn_more_url.ReplaceComponents(repl);

Powered by Google App Engine
This is Rietveld 408576698