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

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: Merge to head for commit 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 592 matching lines...) Expand 10 before | Expand all | Expand 10 after
603 } 603 }
604 604
605 safe_browsing::ClientSideDetectionService* 605 safe_browsing::ClientSideDetectionService*
606 BrowserProcessImpl::safe_browsing_detection_service() { 606 BrowserProcessImpl::safe_browsing_detection_service() {
607 DCHECK(CalledOnValidThread()); 607 DCHECK(CalledOnValidThread());
608 if (safe_browsing_service()) 608 if (safe_browsing_service())
609 return safe_browsing_service()->safe_browsing_detection_service(); 609 return safe_browsing_service()->safe_browsing_detection_service();
610 return NULL; 610 return NULL;
611 } 611 }
612 612
613 void BrowserProcessImpl::Observe(int type, 613 void BrowserProcessImpl::OnPreferenceChanged(PrefServiceBase* service,
614 const content::NotificationSource& source, 614 const std::string& pref) {
615 const content::NotificationDetails& details) { 615 if (pref == prefs::kDefaultBrowserSettingEnabled) {
616 if (type == chrome::NOTIFICATION_PREF_CHANGED) { 616 ApplyDefaultBrowserPolicy();
617 std::string* pref = content::Details<std::string>(details).ptr(); 617 } else if (pref == prefs::kDisabledSchemes) {
618 if (*pref == prefs::kDefaultBrowserSettingEnabled) { 618 ApplyDisabledSchemesPolicy();
619 ApplyDefaultBrowserPolicy(); 619 } else if (pref == prefs::kAllowCrossOriginAuthPrompt) {
620 } else if (*pref == prefs::kDisabledSchemes) { 620 ApplyAllowCrossOriginAuthPromptPolicy();
621 ApplyDisabledSchemesPolicy();
622 } else if (*pref == prefs::kAllowCrossOriginAuthPrompt) {
623 ApplyAllowCrossOriginAuthPromptPolicy();
624 }
625 } else {
626 NOTREACHED();
627 } 621 }
628 } 622 }
629 623
630 #if (defined(OS_WIN) || defined(OS_LINUX)) && !defined(OS_CHROMEOS) 624 #if (defined(OS_WIN) || defined(OS_LINUX)) && !defined(OS_CHROMEOS)
631 void BrowserProcessImpl::StartAutoupdateTimer() { 625 void BrowserProcessImpl::StartAutoupdateTimer() {
632 autoupdate_timer_.Start(FROM_HERE, 626 autoupdate_timer_.Start(FROM_HERE,
633 base::TimeDelta::FromHours(kUpdateCheckIntervalHours), 627 base::TimeDelta::FromHours(kUpdateCheckIntervalHours),
634 this, 628 this,
635 &BrowserProcessImpl::OnAutoupdateTimer); 629 &BrowserProcessImpl::OnAutoupdateTimer);
636 } 630 }
(...skipping 315 matching lines...) Expand 10 before | Expand all | Expand 10 after
952 } 946 }
953 947
954 void BrowserProcessImpl::OnAutoupdateTimer() { 948 void BrowserProcessImpl::OnAutoupdateTimer() {
955 if (CanAutorestartForUpdate()) { 949 if (CanAutorestartForUpdate()) {
956 DLOG(WARNING) << "Detected update. Restarting browser."; 950 DLOG(WARNING) << "Detected update. Restarting browser.";
957 RestartBackgroundInstance(); 951 RestartBackgroundInstance();
958 } 952 }
959 } 953 }
960 954
961 #endif // (defined(OS_WIN) || defined(OS_LINUX)) && !defined(OS_CHROMEOS) 955 #endif // (defined(OS_WIN) || defined(OS_LINUX)) && !defined(OS_CHROMEOS)
OLDNEW
« no previous file with comments | « chrome/browser/browser_process_impl.h ('k') | chrome/browser/captive_portal/captive_portal_service.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698