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 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
44 #include "chrome/browser/prefs/browser_prefs.h" | 44 #include "chrome/browser/prefs/browser_prefs.h" |
45 #include "chrome/browser/prefs/pref_service.h" | 45 #include "chrome/browser/prefs/pref_service.h" |
46 #include "chrome/browser/prerender/prerender_tracker.h" | 46 #include "chrome/browser/prerender/prerender_tracker.h" |
47 #include "chrome/browser/printing/background_printing_manager.h" | 47 #include "chrome/browser/printing/background_printing_manager.h" |
48 #include "chrome/browser/printing/print_job_manager.h" | 48 #include "chrome/browser/printing/print_job_manager.h" |
49 #include "chrome/browser/printing/print_preview_tab_controller.h" | 49 #include "chrome/browser/printing/print_preview_tab_controller.h" |
50 #include "chrome/browser/profiles/profile_manager.h" | 50 #include "chrome/browser/profiles/profile_manager.h" |
51 #include "chrome/browser/renderer_host/chrome_resource_dispatcher_host_delegate.
h" | 51 #include "chrome/browser/renderer_host/chrome_resource_dispatcher_host_delegate.
h" |
52 #include "chrome/browser/safe_browsing/safe_browsing_service.h" | 52 #include "chrome/browser/safe_browsing/safe_browsing_service.h" |
53 #include "chrome/browser/shell_integration.h" | 53 #include "chrome/browser/shell_integration.h" |
54 #include "chrome/browser/sidebar/sidebar_manager.h" | |
55 #include "chrome/browser/status_icons/status_tray.h" | 54 #include "chrome/browser/status_icons/status_tray.h" |
56 #include "chrome/browser/tab_closeable_state_watcher.h" | 55 #include "chrome/browser/tab_closeable_state_watcher.h" |
57 #include "chrome/browser/tab_contents/thumbnail_generator.h" | 56 #include "chrome/browser/tab_contents/thumbnail_generator.h" |
58 #include "chrome/browser/ui/browser_list.h" | 57 #include "chrome/browser/ui/browser_list.h" |
59 #include "chrome/common/chrome_constants.h" | 58 #include "chrome/common/chrome_constants.h" |
60 #include "chrome/common/chrome_notification_types.h" | 59 #include "chrome/common/chrome_notification_types.h" |
61 #include "chrome/common/chrome_paths.h" | 60 #include "chrome/common/chrome_paths.h" |
62 #include "chrome/common/chrome_switches.h" | 61 #include "chrome/common/chrome_switches.h" |
63 #include "chrome/common/extensions/extension_l10n_util.h" | 62 #include "chrome/common/extensions/extension_l10n_util.h" |
64 #include "chrome/common/extensions/extension_resource.h" | 63 #include "chrome/common/extensions/extension_resource.h" |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
122 using content::BrowserThread; | 121 using content::BrowserThread; |
123 using content::PluginService; | 122 using content::PluginService; |
124 | 123 |
125 BrowserProcessImpl::BrowserProcessImpl(const CommandLine& command_line) | 124 BrowserProcessImpl::BrowserProcessImpl(const CommandLine& command_line) |
126 : created_resource_dispatcher_host_(false), | 125 : created_resource_dispatcher_host_(false), |
127 created_metrics_service_(false), | 126 created_metrics_service_(false), |
128 created_watchdog_thread_(false), | 127 created_watchdog_thread_(false), |
129 created_profile_manager_(false), | 128 created_profile_manager_(false), |
130 created_local_state_(false), | 129 created_local_state_(false), |
131 created_icon_manager_(false), | 130 created_icon_manager_(false), |
132 created_sidebar_manager_(false), | |
133 created_browser_policy_connector_(false), | 131 created_browser_policy_connector_(false), |
134 created_notification_ui_manager_(false), | 132 created_notification_ui_manager_(false), |
135 created_safe_browsing_service_(false), | 133 created_safe_browsing_service_(false), |
136 module_ref_count_(0), | 134 module_ref_count_(0), |
137 did_start_(false), | 135 did_start_(false), |
138 checked_for_new_frames_(false), | 136 checked_for_new_frames_(false), |
139 using_new_frames_(false), | 137 using_new_frames_(false), |
140 thumbnail_generator_(new ThumbnailGenerator), | 138 thumbnail_generator_(new ThumbnailGenerator), |
141 download_status_updater_(new DownloadStatusUpdater) { | 139 download_status_updater_(new DownloadStatusUpdater) { |
142 g_browser_process = this; | 140 g_browser_process = this; |
(...skipping 292 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
435 return profile_manager_.get(); | 433 return profile_manager_.get(); |
436 } | 434 } |
437 | 435 |
438 PrefService* BrowserProcessImpl::local_state() { | 436 PrefService* BrowserProcessImpl::local_state() { |
439 DCHECK(CalledOnValidThread()); | 437 DCHECK(CalledOnValidThread()); |
440 if (!created_local_state_) | 438 if (!created_local_state_) |
441 CreateLocalState(); | 439 CreateLocalState(); |
442 return local_state_.get(); | 440 return local_state_.get(); |
443 } | 441 } |
444 | 442 |
445 SidebarManager* BrowserProcessImpl::sidebar_manager() { | |
446 DCHECK(CalledOnValidThread()); | |
447 if (!created_sidebar_manager_) | |
448 CreateSidebarManager(); | |
449 return sidebar_manager_.get(); | |
450 } | |
451 | |
452 ui::Clipboard* BrowserProcessImpl::clipboard() { | 443 ui::Clipboard* BrowserProcessImpl::clipboard() { |
453 DCHECK(CalledOnValidThread()); | 444 DCHECK(CalledOnValidThread()); |
454 return clipboard_.get(); | 445 return clipboard_.get(); |
455 } | 446 } |
456 | 447 |
457 net::URLRequestContextGetter* BrowserProcessImpl::system_request_context() { | 448 net::URLRequestContextGetter* BrowserProcessImpl::system_request_context() { |
458 DCHECK(CalledOnValidThread()); | 449 DCHECK(CalledOnValidThread()); |
459 return io_thread()->system_url_request_context_getter(); | 450 return io_thread()->system_url_request_context_getter(); |
460 } | 451 } |
461 | 452 |
(...skipping 383 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
845 if (local_state_->IsManagedPreference(prefs::kDefaultBrowserSettingEnabled)) | 836 if (local_state_->IsManagedPreference(prefs::kDefaultBrowserSettingEnabled)) |
846 ApplyDefaultBrowserPolicy(); | 837 ApplyDefaultBrowserPolicy(); |
847 } | 838 } |
848 | 839 |
849 void BrowserProcessImpl::CreateIconManager() { | 840 void BrowserProcessImpl::CreateIconManager() { |
850 DCHECK(!created_icon_manager_ && icon_manager_.get() == NULL); | 841 DCHECK(!created_icon_manager_ && icon_manager_.get() == NULL); |
851 created_icon_manager_ = true; | 842 created_icon_manager_ = true; |
852 icon_manager_.reset(new IconManager); | 843 icon_manager_.reset(new IconManager); |
853 } | 844 } |
854 | 845 |
855 void BrowserProcessImpl::CreateSidebarManager() { | |
856 DCHECK(sidebar_manager_.get() == NULL); | |
857 created_sidebar_manager_ = true; | |
858 sidebar_manager_ = new SidebarManager(); | |
859 } | |
860 | |
861 void BrowserProcessImpl::CreateGoogleURLTracker() { | 846 void BrowserProcessImpl::CreateGoogleURLTracker() { |
862 DCHECK(google_url_tracker_.get() == NULL); | 847 DCHECK(google_url_tracker_.get() == NULL); |
863 scoped_ptr<GoogleURLTracker> google_url_tracker(new GoogleURLTracker); | 848 scoped_ptr<GoogleURLTracker> google_url_tracker(new GoogleURLTracker); |
864 google_url_tracker_.swap(google_url_tracker); | 849 google_url_tracker_.swap(google_url_tracker); |
865 } | 850 } |
866 | 851 |
867 void BrowserProcessImpl::CreateIntranetRedirectDetector() { | 852 void BrowserProcessImpl::CreateIntranetRedirectDetector() { |
868 DCHECK(intranet_redirect_detector_.get() == NULL); | 853 DCHECK(intranet_redirect_detector_.get() == NULL); |
869 scoped_ptr<IntranetRedirectDetector> intranet_redirect_detector( | 854 scoped_ptr<IntranetRedirectDetector> intranet_redirect_detector( |
870 new IntranetRedirectDetector); | 855 new IntranetRedirectDetector); |
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
990 } | 975 } |
991 | 976 |
992 void BrowserProcessImpl::OnAutoupdateTimer() { | 977 void BrowserProcessImpl::OnAutoupdateTimer() { |
993 if (CanAutorestartForUpdate()) { | 978 if (CanAutorestartForUpdate()) { |
994 DLOG(WARNING) << "Detected update. Restarting browser."; | 979 DLOG(WARNING) << "Detected update. Restarting browser."; |
995 RestartBackgroundInstance(); | 980 RestartBackgroundInstance(); |
996 } | 981 } |
997 } | 982 } |
998 | 983 |
999 #endif // (defined(OS_WIN) || defined(OS_LINUX)) && !defined(OS_CHROMEOS) | 984 #endif // (defined(OS_WIN) || defined(OS_LINUX)) && !defined(OS_CHROMEOS) |
OLD | NEW |