| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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) |
| OLD | NEW |