summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsatorux@chromium.org <satorux@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-02-16 04:27:46 +0000
committersatorux@chromium.org <satorux@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-02-16 04:27:46 +0000
commit45b6ccca5839076449c44e927fd09a713fea7de6 (patch)
tree8c3559ae8ee7ff11902282af1e013269a20998c3
parent5b899a41e7c2b43f44f7b09e91ae507115571c86 (diff)
downloadchromium_src-45b6ccca5839076449c44e927fd09a713fea7de6.zip
chromium_src-45b6ccca5839076449c44e927fd09a713fea7de6.tar.gz
chromium_src-45b6ccca5839076449c44e927fd09a713fea7de6.tar.bz2
Fix a bug that caused Chrome OS system preferences not to work in the guest mode.
Before this change, we were initializing Chrome OS system preferences in ProfileImpl's constructor, but this didn't work in the guest mode, since we'll switch the profile implementation (GuestSessionProfile) afterward in the guest mode. BUG=chromium-os:11912 TEST=confirm that "Enable tap-to-click" works both in the guest and the normal mode. Review URL: http://codereview.chromium.org/6484033 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@75067 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/browser/profiles/profile.cc16
-rw-r--r--chrome/browser/profiles/profile.h3
-rw-r--r--chrome/browser/profiles/profile_impl.cc10
-rw-r--r--chrome/browser/profiles/profile_impl.h1
-rw-r--r--chrome/browser/ui/browser_init.cc7
-rw-r--r--chrome/test/testing_profile.h2
6 files changed, 34 insertions, 5 deletions
diff --git a/chrome/browser/profiles/profile.cc b/chrome/browser/profiles/profile.cc
index 9815e4f..d54c56c 100644
--- a/chrome/browser/profiles/profile.cc
+++ b/chrome/browser/profiles/profile.cc
@@ -57,6 +57,8 @@
#include "chrome/browser/password_manager/native_backend_gnome_x.h"
#include "chrome/browser/password_manager/native_backend_kwallet_x.h"
#include "chrome/browser/password_manager/password_store_x.h"
+#elif defined(OS_CHROMEOS)
+#include "chrome/browser/chromeos/preferences.h"
#endif
using base::Time;
@@ -591,6 +593,11 @@ class OffTheRecordProfileImpl : public Profile,
virtual void SetupChromeOSEnterpriseExtensionObserver() {
profile_->SetupChromeOSEnterpriseExtensionObserver();
}
+
+ virtual void InitChromeOSPreferences() {
+ // The off-the-record profile shouldn't have Chrome OS's preferences.
+ // The preferences are associated with the regular user profile.
+ }
#endif // defined(OS_CHROMEOS)
virtual void ExitedOffTheRecordMode() {
@@ -743,6 +750,15 @@ class GuestSessionProfile : public OffTheRecordProfileImpl {
virtual PersonalDataManager* GetPersonalDataManager() {
return GetOriginalProfile()->GetPersonalDataManager();
}
+
+ virtual void InitChromeOSPreferences() {
+ chromeos_preferences_.reset(new chromeos::Preferences());
+ chromeos_preferences_->Init(GetPrefs());
+ }
+
+ private:
+ // The guest user should be able to customize Chrome OS preferences.
+ scoped_ptr<chromeos::Preferences> chromeos_preferences_;
};
#endif
diff --git a/chrome/browser/profiles/profile.h b/chrome/browser/profiles/profile.h
index 04fcfb9..61db6b8 100644
--- a/chrome/browser/profiles/profile.h
+++ b/chrome/browser/profiles/profile.h
@@ -527,6 +527,9 @@ class Profile {
// Creates ChromeOS's EnterpriseExtensionListener.
virtual void SetupChromeOSEnterpriseExtensionObserver() = 0;
+ // Initializes Chrome OS's preferences.
+ virtual void InitChromeOSPreferences() = 0;
+
#endif // defined(OS_CHROMEOS)
// Returns the helper object that provides the proxy configuration service
diff --git a/chrome/browser/profiles/profile_impl.cc b/chrome/browser/profiles/profile_impl.cc
index 402b628..15f9e9a 100644
--- a/chrome/browser/profiles/profile_impl.cc
+++ b/chrome/browser/profiles/profile_impl.cc
@@ -313,11 +313,6 @@ ProfileImpl::ProfileImpl(const FilePath& path)
ssl_config_service_manager_.reset(
SSLConfigServiceManager::CreateDefaultManager(this));
-#if defined(OS_CHROMEOS)
- chromeos_preferences_.reset(new chromeos::Preferences());
- chromeos_preferences_->Init(prefs);
-#endif
-
pinned_tab_service_.reset(new PinnedTabService(this));
// Initialize the BackgroundModeManager - this has to be done here before
@@ -1490,6 +1485,11 @@ void ProfileImpl::SetupChromeOSEnterpriseExtensionObserver() {
chromeos_enterprise_extension_observer_.reset(
new chromeos::EnterpriseExtensionObserver(this));
}
+
+void ProfileImpl::InitChromeOSPreferences() {
+ chromeos_preferences_.reset(new chromeos::Preferences());
+ chromeos_preferences_->Init(GetPrefs());
+}
#endif // defined(OS_CHROMEOS)
PrefProxyConfigTracker* ProfileImpl::GetProxyConfigTracker() {
diff --git a/chrome/browser/profiles/profile_impl.h b/chrome/browser/profiles/profile_impl.h
index 923375b..09ab45a 100644
--- a/chrome/browser/profiles/profile_impl.h
+++ b/chrome/browser/profiles/profile_impl.h
@@ -137,6 +137,7 @@ class ProfileImpl : public Profile,
virtual void ChangeAppLocale(const std::string& locale, AppLocaleChangedVia);
virtual chromeos::ProxyConfigServiceImpl* GetChromeOSProxyConfigServiceImpl();
virtual void SetupChromeOSEnterpriseExtensionObserver();
+ virtual void InitChromeOSPreferences();
#endif // defined(OS_CHROMEOS)
virtual PrefProxyConfigTracker* GetProxyConfigTracker();
diff --git a/chrome/browser/ui/browser_init.cc b/chrome/browser/ui/browser_init.cc
index 8b3cba1..f08a830 100644
--- a/chrome/browser/ui/browser_init.cc
+++ b/chrome/browser/ui/browser_init.cc
@@ -502,6 +502,13 @@ bool BrowserInit::LaunchBrowser(const CommandLine& command_line,
}
#if defined(OS_CHROMEOS)
+ // Initialize Chrome OS preferences like touch pad sensitivity. For the
+ // preferences to work in the guest mode, the initialization has to be
+ // done after |profile| is switched to the off-the-record profile (which
+ // is actually GuestSessionProfile in the guest mode). See the
+ // GetOffTheRecordProfile() call above.
+ profile->InitChromeOSPreferences();
+
// Create the WmMessageListener so that it can listen for messages regardless
// of what window has focus.
chromeos::WmMessageListener::GetInstance();
diff --git a/chrome/test/testing_profile.h b/chrome/test/testing_profile.h
index 572c96d..ec2f82a 100644
--- a/chrome/test/testing_profile.h
+++ b/chrome/test/testing_profile.h
@@ -252,6 +252,8 @@ class TestingProfile : public Profile {
}
virtual void SetupChromeOSEnterpriseExtensionObserver() {
}
+ virtual void InitChromeOSPreferences() {
+ }
virtual void ChangeAppLocale(const std::string&, AppLocaleChangedVia) {
}
#endif // defined(OS_CHROMEOS)