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

Side by Side Diff: chrome/browser/browser_process_impl.cc

Issue 11345008: Remove content::NotificationObserver dependency from most Prefs code. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address review comments. Created 8 years, 1 month 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/browser_process_impl.h" 5 #include "chrome/browser/browser_process_impl.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <map> 8 #include <map>
9 #include <set> 9 #include <set>
10 #include <vector> 10 #include <vector>
(...skipping 586 matching lines...) Expand 10 before | Expand all | Expand 10 after
597 return NULL; 597 return NULL;
598 } 598 }
599 599
600 bool BrowserProcessImpl::plugin_finder_disabled() const { 600 bool BrowserProcessImpl::plugin_finder_disabled() const {
601 if (plugin_finder_disabled_pref_.get()) 601 if (plugin_finder_disabled_pref_.get())
602 return plugin_finder_disabled_pref_->GetValue(); 602 return plugin_finder_disabled_pref_->GetValue();
603 else 603 else
604 return false; 604 return false;
605 } 605 }
606 606
607 void BrowserProcessImpl::Observe(int type, 607 void BrowserProcessImpl::OnPreferenceChanged(PrefServiceBase* service,
608 const content::NotificationSource& source, 608 const std::string& pref) {
609 const content::NotificationDetails& details) { 609 if (pref == prefs::kDefaultBrowserSettingEnabled) {
610 if (type == chrome::NOTIFICATION_PREF_CHANGED) { 610 ApplyDefaultBrowserPolicy();
611 std::string* pref = content::Details<std::string>(details).ptr(); 611 } else if (pref == prefs::kDisabledSchemes) {
612 if (*pref == prefs::kDefaultBrowserSettingEnabled) { 612 ApplyDisabledSchemesPolicy();
613 ApplyDefaultBrowserPolicy(); 613 } else if (pref == prefs::kAllowCrossOriginAuthPrompt) {
614 } else if (*pref == prefs::kDisabledSchemes) { 614 ApplyAllowCrossOriginAuthPromptPolicy();
615 ApplyDisabledSchemesPolicy();
616 } else if (*pref == prefs::kAllowCrossOriginAuthPrompt) {
617 ApplyAllowCrossOriginAuthPromptPolicy();
618 }
619 } else {
620 NOTREACHED();
621 } 615 }
622 } 616 }
623 617
624 #if (defined(OS_WIN) || defined(OS_LINUX)) && !defined(OS_CHROMEOS) 618 #if (defined(OS_WIN) || defined(OS_LINUX)) && !defined(OS_CHROMEOS)
625 void BrowserProcessImpl::StartAutoupdateTimer() { 619 void BrowserProcessImpl::StartAutoupdateTimer() {
626 autoupdate_timer_.Start(FROM_HERE, 620 autoupdate_timer_.Start(FROM_HERE,
627 base::TimeDelta::FromHours(kUpdateCheckIntervalHours), 621 base::TimeDelta::FromHours(kUpdateCheckIntervalHours),
628 this, 622 this,
629 &BrowserProcessImpl::OnAutoupdateTimer); 623 &BrowserProcessImpl::OnAutoupdateTimer);
630 } 624 }
(...skipping 319 matching lines...) Expand 10 before | Expand all | Expand 10 after
950 } 944 }
951 945
952 void BrowserProcessImpl::OnAutoupdateTimer() { 946 void BrowserProcessImpl::OnAutoupdateTimer() {
953 if (CanAutorestartForUpdate()) { 947 if (CanAutorestartForUpdate()) {
954 DLOG(WARNING) << "Detected update. Restarting browser."; 948 DLOG(WARNING) << "Detected update. Restarting browser.";
955 RestartBackgroundInstance(); 949 RestartBackgroundInstance();
956 } 950 }
957 } 951 }
958 952
959 #endif // (defined(OS_WIN) || defined(OS_LINUX)) && !defined(OS_CHROMEOS) 953 #endif // (defined(OS_WIN) || defined(OS_LINUX)) && !defined(OS_CHROMEOS)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698