| 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 599 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 610 return NULL; | 610 return NULL; |
| 611 } | 611 } |
| 612 | 612 |
| 613 bool BrowserProcessImpl::plugin_finder_disabled() const { | 613 bool BrowserProcessImpl::plugin_finder_disabled() const { |
| 614 if (plugin_finder_disabled_pref_.get()) | 614 if (plugin_finder_disabled_pref_.get()) |
| 615 return plugin_finder_disabled_pref_->GetValue(); | 615 return plugin_finder_disabled_pref_->GetValue(); |
| 616 else | 616 else |
| 617 return false; | 617 return false; |
| 618 } | 618 } |
| 619 | 619 |
| 620 void BrowserProcessImpl::Observe(int type, | 620 void BrowserProcessImpl::OnPreferenceChanged(PrefServiceBase* service, |
| 621 const content::NotificationSource& source, | 621 const std::string& pref) { |
| 622 const content::NotificationDetails& details) { | 622 if (pref == prefs::kDefaultBrowserSettingEnabled) { |
| 623 if (type == chrome::NOTIFICATION_PREF_CHANGED) { | 623 ApplyDefaultBrowserPolicy(); |
| 624 std::string* pref = content::Details<std::string>(details).ptr(); | 624 } else if (pref == prefs::kDisabledSchemes) { |
| 625 if (*pref == prefs::kDefaultBrowserSettingEnabled) { | 625 ApplyDisabledSchemesPolicy(); |
| 626 ApplyDefaultBrowserPolicy(); | 626 } else if (pref == prefs::kAllowCrossOriginAuthPrompt) { |
| 627 } else if (*pref == prefs::kDisabledSchemes) { | 627 ApplyAllowCrossOriginAuthPromptPolicy(); |
| 628 ApplyDisabledSchemesPolicy(); | |
| 629 } else if (*pref == prefs::kAllowCrossOriginAuthPrompt) { | |
| 630 ApplyAllowCrossOriginAuthPromptPolicy(); | |
| 631 } | |
| 632 } else { | |
| 633 NOTREACHED(); | |
| 634 } | 628 } |
| 635 } | 629 } |
| 636 | 630 |
| 637 #if (defined(OS_WIN) || defined(OS_LINUX)) && !defined(OS_CHROMEOS) | 631 #if (defined(OS_WIN) || defined(OS_LINUX)) && !defined(OS_CHROMEOS) |
| 638 void BrowserProcessImpl::StartAutoupdateTimer() { | 632 void BrowserProcessImpl::StartAutoupdateTimer() { |
| 639 autoupdate_timer_.Start(FROM_HERE, | 633 autoupdate_timer_.Start(FROM_HERE, |
| 640 base::TimeDelta::FromHours(kUpdateCheckIntervalHours), | 634 base::TimeDelta::FromHours(kUpdateCheckIntervalHours), |
| 641 this, | 635 this, |
| 642 &BrowserProcessImpl::OnAutoupdateTimer); | 636 &BrowserProcessImpl::OnAutoupdateTimer); |
| 643 } | 637 } |
| (...skipping 324 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 968 } | 962 } |
| 969 | 963 |
| 970 void BrowserProcessImpl::OnAutoupdateTimer() { | 964 void BrowserProcessImpl::OnAutoupdateTimer() { |
| 971 if (CanAutorestartForUpdate()) { | 965 if (CanAutorestartForUpdate()) { |
| 972 DLOG(WARNING) << "Detected update. Restarting browser."; | 966 DLOG(WARNING) << "Detected update. Restarting browser."; |
| 973 RestartBackgroundInstance(); | 967 RestartBackgroundInstance(); |
| 974 } | 968 } |
| 975 } | 969 } |
| 976 | 970 |
| 977 #endif // (defined(OS_WIN) || defined(OS_LINUX)) && !defined(OS_CHROMEOS) | 971 #endif // (defined(OS_WIN) || defined(OS_LINUX)) && !defined(OS_CHROMEOS) |
| OLD | NEW |