summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--chrome/browser/app_modal_dialog_mac.mm2
-rw-r--r--chrome/browser/browser_main.cc6
-rw-r--r--chrome/browser/browser_process.h2
-rw-r--r--chrome/browser/browser_process_impl.cc6
-rw-r--r--chrome/browser/browser_process_impl.h4
-rw-r--r--chrome/browser/browsing_data_appcache_helper.cc2
-rw-r--r--chrome/browser/dom_ui/ntp_resource_cache.cc1
-rw-r--r--chrome/browser/gtk/browser_actions_toolbar_gtk.h1
-rw-r--r--chrome/browser/gtk/content_blocked_bubble_gtk.h3
-rw-r--r--chrome/browser/gtk/options/content_settings_window_gtk.cc1
-rw-r--r--chrome/browser/in_process_webkit/dom_storage_permission_request.cc1
-rw-r--r--chrome/browser/mach_broker_mac.cc1
-rw-r--r--chrome/browser/sync/glue/data_type_controller.h1
-rw-r--r--chrome/browser/tab_contents/render_view_context_menu_mac.mm3
-rw-r--r--chrome/browser/tab_contents/render_view_host_manager.h1
-rw-r--r--chrome/browser/translate/translate_manager_unittest.cc4
-rw-r--r--chrome/common/extensions/extension_l10n_util.cc4
-rw-r--r--chrome/common/notification_registrar.cc30
-rw-r--r--chrome/common/notification_registrar.h5
-rw-r--r--chrome/test/testing_browser_process.h2
-rw-r--r--chrome_frame/test/net/fake_external_tab.cc2
21 files changed, 45 insertions, 37 deletions
diff --git a/chrome/browser/app_modal_dialog_mac.mm b/chrome/browser/app_modal_dialog_mac.mm
index 3d1c82a..2a21c1da 100644
--- a/chrome/browser/app_modal_dialog_mac.mm
+++ b/chrome/browser/app_modal_dialog_mac.mm
@@ -6,6 +6,8 @@
#import <Cocoa/Cocoa.h>
+#include "base/logging.h"
+
AppModalDialog::~AppModalDialog() {
}
diff --git a/chrome/browser/browser_main.cc b/chrome/browser/browser_main.cc
index 0d76b8e..91c6cad 100644
--- a/chrome/browser/browser_main.cc
+++ b/chrome/browser/browser_main.cc
@@ -586,17 +586,17 @@ int BrowserMain(const MainFunctionParams& parameters) {
// If we're running tests (ui_task is non-null), then the ResourceBundle
// has already been initialized.
if (parameters.ui_task) {
- g_browser_process->set_application_locale("en-US");
+ g_browser_process->SetApplicationLocale("en-US");
} else {
// Mac starts it earlier in Platform::WillInitializeMainMessageLoop (because
// it is needed when loading the MainMenu.nib and the language doesn't
// depend on anything since it comes from Cocoa.
#if defined(OS_MACOSX)
- g_browser_process->set_application_locale(l10n_util::GetLocaleOverride());
+ g_browser_process->SetApplicationLocale(l10n_util::GetLocaleOverride());
#else
std::string app_locale = ResourceBundle::InitSharedInstance(
local_state->GetString(prefs::kApplicationLocale));
- g_browser_process->set_application_locale(app_locale);
+ g_browser_process->SetApplicationLocale(app_locale);
#endif // !defined(OS_MACOSX)
}
diff --git a/chrome/browser/browser_process.h b/chrome/browser/browser_process.h
index de74567..52b7578 100644
--- a/chrome/browser/browser_process.h
+++ b/chrome/browser/browser_process.h
@@ -129,7 +129,7 @@ class BrowserProcess {
// Returns the locale used by the application.
virtual const std::string& GetApplicationLocale() = 0;
- virtual void set_application_locale(const std::string& locale) = 0;
+ virtual void SetApplicationLocale(const std::string& locale) = 0;
DownloadRequestManager* download_request_manager();
diff --git a/chrome/browser/browser_process_impl.cc b/chrome/browser/browser_process_impl.cc
index 1fbefa1..f3cb9700 100644
--- a/chrome/browser/browser_process_impl.cc
+++ b/chrome/browser/browser_process_impl.cc
@@ -41,6 +41,7 @@
#include "chrome/common/chrome_constants.h"
#include "chrome/common/chrome_paths.h"
#include "chrome/common/chrome_switches.h"
+#include "chrome/common/extensions/extension_l10n_util.h"
#include "chrome/common/notification_service.h"
#include "chrome/common/pref_names.h"
#include "chrome/common/url_constants.h"
@@ -425,6 +426,11 @@ void BrowserProcessImpl::CreateNotificationUIManager() {
created_notification_ui_manager_ = true;
}
+void BrowserProcessImpl::SetApplicationLocale(const std::string& locale) {
+ locale_ = locale;
+ extension_l10n_util::SetProcessLocale(locale);
+}
+
// The BrowserProcess object must outlive the file thread so we use traits
// which don't do any management.
template <>
diff --git a/chrome/browser/browser_process_impl.h b/chrome/browser/browser_process_impl.h
index 166b0bb..50ab5a2 100644
--- a/chrome/browser/browser_process_impl.h
+++ b/chrome/browser/browser_process_impl.h
@@ -194,9 +194,7 @@ class BrowserProcessImpl : public BrowserProcess, public NonThreadSafe {
DCHECK(!locale_.empty());
return locale_;
}
- virtual void set_application_locale(const std::string& locale) {
- locale_ = locale;
- }
+ virtual void SetApplicationLocale(const std::string& locale);
virtual base::WaitableEvent* shutdown_event() {
return shutdown_event_.get();
diff --git a/chrome/browser/browsing_data_appcache_helper.cc b/chrome/browser/browsing_data_appcache_helper.cc
index 9e62809..8fa342e 100644
--- a/chrome/browser/browsing_data_appcache_helper.cc
+++ b/chrome/browser/browsing_data_appcache_helper.cc
@@ -3,6 +3,8 @@
// found in the LICENSE file.
#include "chrome/browser/browsing_data_appcache_helper.h"
+
+#include "chrome/browser/chrome_thread.h"
#include "chrome/browser/net/chrome_url_request_context.h"
#include "chrome/browser/profile.h"
#include "webkit/appcache/appcache_database.h"
diff --git a/chrome/browser/dom_ui/ntp_resource_cache.cc b/chrome/browser/dom_ui/ntp_resource_cache.cc
index 732807b..0d0fc06 100644
--- a/chrome/browser/dom_ui/ntp_resource_cache.cc
+++ b/chrome/browser/dom_ui/ntp_resource_cache.cc
@@ -15,6 +15,7 @@
#include "base/string_util.h"
#include "base/values.h"
#include "chrome/browser/browser_theme_provider.h"
+#include "chrome/browser/chrome_thread.h"
#include "chrome/browser/dom_ui/chrome_url_data_manager.h"
#include "chrome/browser/google_util.h"
#include "chrome/browser/pref_service.h"
diff --git a/chrome/browser/gtk/browser_actions_toolbar_gtk.h b/chrome/browser/gtk/browser_actions_toolbar_gtk.h
index fa71555..024e81b 100644
--- a/chrome/browser/gtk/browser_actions_toolbar_gtk.h
+++ b/chrome/browser/gtk/browser_actions_toolbar_gtk.h
@@ -11,6 +11,7 @@
#include <string>
#include "base/linked_ptr.h"
+#include "base/task.h"
#include "chrome/browser/extensions/extension_toolbar_model.h"
#include "chrome/common/notification_observer.h"
#include "chrome/common/notification_registrar.h"
diff --git a/chrome/browser/gtk/content_blocked_bubble_gtk.h b/chrome/browser/gtk/content_blocked_bubble_gtk.h
index 8d2d7a7..d201574 100644
--- a/chrome/browser/gtk/content_blocked_bubble_gtk.h
+++ b/chrome/browser/gtk/content_blocked_bubble_gtk.h
@@ -5,6 +5,9 @@
#ifndef CHROME_BROWSER_GTK_CONTENT_BLOCKED_BUBBLE_GTK_H_
#define CHROME_BROWSER_GTK_CONTENT_BLOCKED_BUBBLE_GTK_H_
+#include <map>
+#include <string>
+
#include "chrome/browser/gtk/info_bubble_gtk.h"
#include "chrome/common/content_settings_types.h"
#include "chrome/common/notification_registrar.h"
diff --git a/chrome/browser/gtk/options/content_settings_window_gtk.cc b/chrome/browser/gtk/options/content_settings_window_gtk.cc
index 9f1cfa3..ab0b420 100644
--- a/chrome/browser/gtk/options/content_settings_window_gtk.cc
+++ b/chrome/browser/gtk/options/content_settings_window_gtk.cc
@@ -7,6 +7,7 @@
#include <string>
#include "app/l10n_util.h"
+#include "base/message_loop.h"
#include "chrome/browser/browser.h"
#include "chrome/browser/browser_list.h"
#include "chrome/browser/browser_process.h"
diff --git a/chrome/browser/in_process_webkit/dom_storage_permission_request.cc b/chrome/browser/in_process_webkit/dom_storage_permission_request.cc
index d15e49b..6bc84a2 100644
--- a/chrome/browser/in_process_webkit/dom_storage_permission_request.cc
+++ b/chrome/browser/in_process_webkit/dom_storage_permission_request.cc
@@ -5,6 +5,7 @@
#include "chrome/browser/in_process_webkit/dom_storage_permission_request.h"
#include "chrome/browser/browser_list.h"
+#include "chrome/browser/chrome_thread.h"
#include "chrome/browser/message_box_handler.h"
DOMStoragePermissionRequest::DOMStoragePermissionRequest(
diff --git a/chrome/browser/mach_broker_mac.cc b/chrome/browser/mach_broker_mac.cc
index 6ae3391..39f3fce 100644
--- a/chrome/browser/mach_broker_mac.cc
+++ b/chrome/browser/mach_broker_mac.cc
@@ -5,6 +5,7 @@
#include "chrome/browser/mach_broker_mac.h"
#include "base/logging.h"
+#include "chrome/browser/chrome_thread.h"
#include "chrome/browser/extensions/extension_host.h"
#include "chrome/browser/renderer_host/render_process_host.h"
#include "chrome/common/child_process_info.h"
diff --git a/chrome/browser/sync/glue/data_type_controller.h b/chrome/browser/sync/glue/data_type_controller.h
index 61114d4..669e2ff 100644
--- a/chrome/browser/sync/glue/data_type_controller.h
+++ b/chrome/browser/sync/glue/data_type_controller.h
@@ -8,6 +8,7 @@
#include <map>
#include "base/callback.h"
+#include "chrome/browser/chrome_thread.h"
#include "chrome/browser/sync/engine/model_safe_worker.h"
#include "chrome/browser/sync/syncable/model_type.h"
#include "chrome/browser/sync/unrecoverable_error_handler.h"
diff --git a/chrome/browser/tab_contents/render_view_context_menu_mac.mm b/chrome/browser/tab_contents/render_view_context_menu_mac.mm
index e38cfdf..870831c 100644
--- a/chrome/browser/tab_contents/render_view_context_menu_mac.mm
+++ b/chrome/browser/tab_contents/render_view_context_menu_mac.mm
@@ -6,10 +6,11 @@
#include "app/l10n_util_mac.h"
#include "base/compiler_specific.h"
+#include "base/message_loop.h"
+#include "base/scoped_nsobject.h"
#include "base/sys_string_conversions.h"
#include "chrome/browser/profile.h"
#include "grit/generated_resources.h"
-#include "base/scoped_nsobject.h"
// Obj-C bridge class that is the target of all items in the context menu.
// Relies on the tag being set to the command id. Uses |context_| to
diff --git a/chrome/browser/tab_contents/render_view_host_manager.h b/chrome/browser/tab_contents/render_view_host_manager.h
index 4aa9351..648fab3 100644
--- a/chrome/browser/tab_contents/render_view_host_manager.h
+++ b/chrome/browser/tab_contents/render_view_host_manager.h
@@ -6,6 +6,7 @@
#define CHROME_BROWSER_TAB_CONTENTS_RENDER_VIEW_HOST_MANAGER_H_
#include "base/basictypes.h"
+#include "base/logging.h"
#include "base/scoped_ptr.h"
#include "chrome/browser/renderer_host/render_view_host_delegate.h"
#include "chrome/common/notification_registrar.h"
diff --git a/chrome/browser/translate/translate_manager_unittest.cc b/chrome/browser/translate/translate_manager_unittest.cc
index 95211cd..ca228ea 100644
--- a/chrome/browser/translate/translate_manager_unittest.cc
+++ b/chrome/browser/translate/translate_manager_unittest.cc
@@ -445,7 +445,7 @@ TEST_F(TranslateManagerTest, UnsupportedUILanguage) {
TestingBrowserProcess* browser_process =
static_cast<TestingBrowserProcess*>(g_browser_process);
std::string original_lang = browser_process->GetApplicationLocale();
- browser_process->set_application_locale("qbz");
+ browser_process->SetApplicationLocale("qbz");
// Simulate navigating to a page in a language supported by the translate
// server.
@@ -454,7 +454,7 @@ TEST_F(TranslateManagerTest, UnsupportedUILanguage) {
// No info-bar should be shown.
EXPECT_TRUE(GetTranslateInfoBar() == NULL);
- browser_process->set_application_locale(original_lang);
+ browser_process->SetApplicationLocale(original_lang);
}
// Tests that the translate preference is honored.
diff --git a/chrome/common/extensions/extension_l10n_util.cc b/chrome/common/extensions/extension_l10n_util.cc
index e7406b2..1de16fe 100644
--- a/chrome/common/extensions/extension_l10n_util.cc
+++ b/chrome/common/extensions/extension_l10n_util.cc
@@ -13,7 +13,6 @@
#include "base/linked_ptr.h"
#include "base/string_util.h"
#include "base/values.h"
-#include "chrome/browser/browser_process.h"
#include "chrome/common/extensions/extension.h"
#include "chrome/common/extensions/extension_constants.h"
#include "chrome/common/extensions/extension_file_util.h"
@@ -174,8 +173,7 @@ std::string NormalizeLocale(const std::string& locale) {
}
std::string CurrentLocaleOrDefault() {
- std::string current_locale =
- NormalizeLocale(g_browser_process->GetApplicationLocale());
+ std::string current_locale = NormalizeLocale(*GetProcessLocale());
if (current_locale.empty())
current_locale = "en";
diff --git a/chrome/common/notification_registrar.cc b/chrome/common/notification_registrar.cc
index 9119a5d..175a3f6 100644
--- a/chrome/common/notification_registrar.cc
+++ b/chrome/common/notification_registrar.cc
@@ -15,7 +15,7 @@ struct NotificationRegistrar::Record {
NotificationObserver* observer;
NotificationType type;
NotificationSource source;
- ChromeThread::ID thread_id;
+ PlatformThreadId thread_id;
};
bool NotificationRegistrar::Record::operator==(const Record& other) const {
@@ -35,7 +35,7 @@ NotificationRegistrar::~NotificationRegistrar() {
void NotificationRegistrar::Add(NotificationObserver* observer,
NotificationType type,
const NotificationSource& source) {
- Record record = { observer, type, source, GetCurrentThreadIdentifier() };
+ Record record = { observer, type, source, PlatformThread::CurrentId() };
DCHECK(std::find(registered_.begin(), registered_.end(), record) ==
registered_.end()) << "Duplicate registration.";
@@ -55,7 +55,7 @@ void NotificationRegistrar::Remove(NotificationObserver* observer,
type.value << " from list of size " << registered_.size() << ".";
return;
}
- CheckCalledOnValidWellKnownThread(found->thread_id);
+ CheckCalledOnValidThread(found->thread_id);
registered_.erase(found);
@@ -82,7 +82,7 @@ void NotificationRegistrar::RemoveAll() {
NotificationService* service = NotificationService::current();
if (service) {
for (size_t i = 0; i < registered_.size(); i++) {
- CheckCalledOnValidWellKnownThread(registered_[i].thread_id);
+ CheckCalledOnValidThread(registered_[i].thread_id);
service->RemoveObserver(registered_[i].observer,
registered_[i].type,
registered_[i].source);
@@ -95,19 +95,11 @@ bool NotificationRegistrar::IsEmpty() const {
return registered_.empty();
}
-ChromeThread::ID NotificationRegistrar::GetCurrentThreadIdentifier() {
- ChromeThread::ID thread_id;
- if (!ChromeThread::GetCurrentThreadIdentifier(&thread_id)) {
- // If we are not created in well known thread, GetCurrentThreadIdentifier
- // fails. Assign thread_id to an ID not used.
- thread_id = ChromeThread::ID_COUNT;
- }
- return thread_id;
-}
-
-void NotificationRegistrar::CheckCalledOnValidWellKnownThread(
- ChromeThread::ID thread_id) {
- if (ChromeThread::IsWellKnownThread(thread_id)) {
- CHECK(ChromeThread::CurrentlyOn(thread_id));
- }
+// static
+void NotificationRegistrar::CheckCalledOnValidThread(
+ PlatformThreadId thread_id) {
+ PlatformThreadId current_thread_id = PlatformThread::CurrentId();
+ CHECK(current_thread_id == thread_id) << "called on invalid thread: "
+ << thread_id << " vs. "
+ << current_thread_id;
}
diff --git a/chrome/common/notification_registrar.h b/chrome/common/notification_registrar.h
index 3d71783..03f86e6 100644
--- a/chrome/common/notification_registrar.h
+++ b/chrome/common/notification_registrar.h
@@ -8,7 +8,7 @@
#include <vector>
#include "base/basictypes.h"
-#include "chrome/browser/chrome_thread.h"
+#include "base/platform_thread.h"
#include "chrome/common/notification_observer.h"
// Aids in registering for notifications and ensures that all registered
@@ -40,8 +40,7 @@ class NotificationRegistrar {
bool IsEmpty() const;
private:
- ChromeThread::ID GetCurrentThreadIdentifier();
- void CheckCalledOnValidWellKnownThread(ChromeThread::ID thread_id);
+ static void CheckCalledOnValidThread(PlatformThreadId thread_id);
struct Record;
diff --git a/chrome/test/testing_browser_process.h b/chrome/test/testing_browser_process.h
index b32717f..690f8af 100644
--- a/chrome/test/testing_browser_process.h
+++ b/chrome/test/testing_browser_process.h
@@ -144,7 +144,7 @@ class TestingBrowserProcess : public BrowserProcess {
return app_locale_;
}
- virtual void set_application_locale(const std::string& app_locale) {
+ virtual void SetApplicationLocale(const std::string& app_locale) {
app_locale_ = app_locale;
}
diff --git a/chrome_frame/test/net/fake_external_tab.cc b/chrome_frame/test/net/fake_external_tab.cc
index ba8a974..c68a3c1 100644
--- a/chrome_frame/test/net/fake_external_tab.cc
+++ b/chrome_frame/test/net/fake_external_tab.cc
@@ -221,7 +221,7 @@ void FakeExternalTab::Initialize() {
// BrowserProcessImpl's constructor should set g_browser_process.
DCHECK(g_browser_process);
// Set the app locale and create the child threads.
- g_browser_process->set_application_locale("en-US");
+ g_browser_process->SetApplicationLocale("en-US");
g_browser_process->db_thread();
g_browser_process->file_thread();
g_browser_process->io_thread();