| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 <map> | 7 #include <map> |
| 8 #include <set> | 8 #include <set> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 47 #include "chrome/browser/profiles/profile_manager.h" | 47 #include "chrome/browser/profiles/profile_manager.h" |
| 48 #include "chrome/browser/renderer_host/chrome_resource_dispatcher_host_delegate.
h" | 48 #include "chrome/browser/renderer_host/chrome_resource_dispatcher_host_delegate.
h" |
| 49 #include "chrome/browser/safe_browsing/client_side_detection_service.h" | 49 #include "chrome/browser/safe_browsing/client_side_detection_service.h" |
| 50 #include "chrome/browser/safe_browsing/safe_browsing_service.h" | 50 #include "chrome/browser/safe_browsing/safe_browsing_service.h" |
| 51 #include "chrome/browser/shell_integration.h" | 51 #include "chrome/browser/shell_integration.h" |
| 52 #include "chrome/browser/sidebar/sidebar_manager.h" | 52 #include "chrome/browser/sidebar/sidebar_manager.h" |
| 53 #include "chrome/browser/status_icons/status_tray.h" | 53 #include "chrome/browser/status_icons/status_tray.h" |
| 54 #include "chrome/browser/tab_closeable_state_watcher.h" | 54 #include "chrome/browser/tab_closeable_state_watcher.h" |
| 55 #include "chrome/browser/ui/browser_list.h" | 55 #include "chrome/browser/ui/browser_list.h" |
| 56 #include "chrome/common/chrome_constants.h" | 56 #include "chrome/common/chrome_constants.h" |
| 57 #include "chrome/common/chrome_notification_types.h" |
| 57 #include "chrome/common/chrome_paths.h" | 58 #include "chrome/common/chrome_paths.h" |
| 58 #include "chrome/common/chrome_switches.h" | 59 #include "chrome/common/chrome_switches.h" |
| 59 #include "chrome/common/default_plugin.h" | 60 #include "chrome/common/default_plugin.h" |
| 60 #include "chrome/common/extensions/extension_l10n_util.h" | 61 #include "chrome/common/extensions/extension_l10n_util.h" |
| 61 #include "chrome/common/extensions/extension_resource.h" | 62 #include "chrome/common/extensions/extension_resource.h" |
| 62 #include "chrome/common/json_pref_store.h" | 63 #include "chrome/common/json_pref_store.h" |
| 63 #include "chrome/common/pref_names.h" | 64 #include "chrome/common/pref_names.h" |
| 64 #include "chrome/common/switch_utils.h" | 65 #include "chrome/common/switch_utils.h" |
| 65 #include "chrome/common/url_constants.h" | 66 #include "chrome/common/url_constants.h" |
| 66 #include "chrome/installer/util/google_update_constants.h" | 67 #include "chrome/installer/util/google_update_constants.h" |
| (...skipping 537 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 604 DCHECK(CalledOnValidThread()); | 605 DCHECK(CalledOnValidThread()); |
| 605 if (!created_safe_browsing_detection_service_) | 606 if (!created_safe_browsing_detection_service_) |
| 606 CreateSafeBrowsingDetectionService(); | 607 CreateSafeBrowsingDetectionService(); |
| 607 return safe_browsing_detection_service_.get(); | 608 return safe_browsing_detection_service_.get(); |
| 608 } | 609 } |
| 609 | 610 |
| 610 bool BrowserProcessImpl::plugin_finder_disabled() const { | 611 bool BrowserProcessImpl::plugin_finder_disabled() const { |
| 611 return *plugin_finder_disabled_pref_; | 612 return *plugin_finder_disabled_pref_; |
| 612 } | 613 } |
| 613 | 614 |
| 614 void BrowserProcessImpl::Observe(NotificationType type, | 615 void BrowserProcessImpl::Observe(int type, |
| 615 const NotificationSource& source, | 616 const NotificationSource& source, |
| 616 const NotificationDetails& details) { | 617 const NotificationDetails& details) { |
| 617 if (type == NotificationType::PREF_CHANGED) { | 618 if (type == chrome::NOTIFICATION_PREF_CHANGED) { |
| 618 std::string* pref = Details<std::string>(details).ptr(); | 619 std::string* pref = Details<std::string>(details).ptr(); |
| 619 if (*pref == prefs::kDefaultBrowserSettingEnabled) { | 620 if (*pref == prefs::kDefaultBrowserSettingEnabled) { |
| 620 if (local_state_->GetBoolean(prefs::kDefaultBrowserSettingEnabled)) | 621 if (local_state_->GetBoolean(prefs::kDefaultBrowserSettingEnabled)) |
| 621 ShellIntegration::SetAsDefaultBrowser(); | 622 ShellIntegration::SetAsDefaultBrowser(); |
| 622 } else if (*pref == prefs::kDisabledSchemes) { | 623 } else if (*pref == prefs::kDisabledSchemes) { |
| 623 ApplyDisabledSchemesPolicy(); | 624 ApplyDisabledSchemesPolicy(); |
| 624 } else if (*pref == prefs::kAllowCrossOriginAuthPrompt) { | 625 } else if (*pref == prefs::kAllowCrossOriginAuthPrompt) { |
| 625 ApplyAllowCrossOriginAuthPromptPolicy(); | 626 ApplyAllowCrossOriginAuthPromptPolicy(); |
| 626 } | 627 } |
| 627 } else { | 628 } else { |
| (...skipping 440 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1068 } | 1069 } |
| 1069 | 1070 |
| 1070 void BrowserProcessImpl::OnAutoupdateTimer() { | 1071 void BrowserProcessImpl::OnAutoupdateTimer() { |
| 1071 if (CanAutorestartForUpdate()) { | 1072 if (CanAutorestartForUpdate()) { |
| 1072 DLOG(WARNING) << "Detected update. Restarting browser."; | 1073 DLOG(WARNING) << "Detected update. Restarting browser."; |
| 1073 RestartPersistentInstance(); | 1074 RestartPersistentInstance(); |
| 1074 } | 1075 } |
| 1075 } | 1076 } |
| 1076 | 1077 |
| 1077 #endif // (defined(OS_WIN) || defined(OS_LINUX)) && !defined(OS_CHROMEOS) | 1078 #endif // (defined(OS_WIN) || defined(OS_LINUX)) && !defined(OS_CHROMEOS) |
| OLD | NEW |