summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbenwells@chromium.org <benwells@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-12-12 03:04:15 +0000
committerbenwells@chromium.org <benwells@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-12-12 03:04:15 +0000
commitd2caaa2a67a44bc69b89aeda45752e91384dcef0 (patch)
tree7e4d5d1fe8d488ca9525900efa0b9306f839e703
parentb89d6b3ed6f0a1f4865d20b6def6a09e25cedefc (diff)
downloadchromium_src-d2caaa2a67a44bc69b89aeda45752e91384dcef0.zip
chromium_src-d2caaa2a67a44bc69b89aeda45752e91384dcef0.tar.gz
chromium_src-d2caaa2a67a44bc69b89aeda45752e91384dcef0.tar.bz2
Respect default browser policy
This got broken with an earlier change to perform the change to the default browser setting on the FILE thread. The file thread isn't created at the point the default browser policy is enforced, this change moves the code to later in the startup process. BUG=106610 TEST=Manual testing performed with a hacked Chromium to always set Chrome as the default regardless of local policy. QA should test with all the policy machinery setup. Linux and Mac should be tested as well. Review URL: http://codereview.chromium.org/8872047 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@113977 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/browser/browser_process_impl.cc7
-rw-r--r--chrome/browser/browser_process_impl.h5
-rw-r--r--chrome/browser/chrome_browser_main.cc4
3 files changed, 14 insertions, 2 deletions
diff --git a/chrome/browser/browser_process_impl.cc b/chrome/browser/browser_process_impl.cc
index 50e2a95..cb752ff 100644
--- a/chrome/browser/browser_process_impl.cc
+++ b/chrome/browser/browser_process_impl.cc
@@ -803,8 +803,6 @@ void BrowserProcessImpl::CreateLocalState() {
// Initialize the notification for the default browser setting policy.
local_state_->RegisterBooleanPref(prefs::kDefaultBrowserSettingEnabled,
false);
- if (local_state_->IsManagedPreference(prefs::kDefaultBrowserSettingEnabled))
- ApplyDefaultBrowserPolicy();
pref_change_registrar_.Add(prefs::kDefaultBrowserSettingEnabled, this);
// Initialize the preference for the plugin finder policy.
@@ -833,6 +831,11 @@ void BrowserProcessImpl::CreateLocalState() {
local_state_->RegisterBooleanPref(prefs::kAllowCrossOriginAuthPrompt, false);
}
+void BrowserProcessImpl::PreMainMessageLoopRun() {
+ if (local_state_->IsManagedPreference(prefs::kDefaultBrowserSettingEnabled))
+ ApplyDefaultBrowserPolicy();
+}
+
void BrowserProcessImpl::CreateIconManager() {
DCHECK(!created_icon_manager_ && icon_manager_.get() == NULL);
created_icon_manager_ = true;
diff --git a/chrome/browser/browser_process_impl.h b/chrome/browser/browser_process_impl.h
index 141a5d9..a9bea3d 100644
--- a/chrome/browser/browser_process_impl.h
+++ b/chrome/browser/browser_process_impl.h
@@ -51,6 +51,11 @@ class BrowserProcessImpl : public BrowserProcess,
void PreStartThread(content::BrowserThread::ID identifier);
void PostStartThread(content::BrowserThread::ID identifier);
+ // Called after the threads have been created but before the message loops
+ // starts running. Allows the browser process to do any initialization that
+ // requires all threads running.
+ void PreMainMessageLoopRun();
+
// Most cleanup is done by these functions, driven from
// ChromeBrowserMain based on notifications from the content
// framework, rather than in the destructor, so that we can
diff --git a/chrome/browser/chrome_browser_main.cc b/chrome/browser/chrome_browser_main.cc
index 6bf567e..31bc2b9 100644
--- a/chrome/browser/chrome_browser_main.cc
+++ b/chrome/browser/chrome_browser_main.cc
@@ -1446,6 +1446,10 @@ int ChromeBrowserMainParts::PreMainMessageLoopRunImpl() {
// watch the other threads and they must be running.
browser_process_->watchdog_thread();
+ // Do any initializating in the browser process that requires all threads
+ // running.
+ browser_process_->PreMainMessageLoopRun();
+
#if defined(USE_WEBKIT_COMPOSITOR)
// We need to ensure WebKit has been initialized before we start the WebKit
// compositor. This is done by the ResourceDispatcherHost on creation.