| 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 <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 58 #include "chrome/browser/prerender/prerender_tracker.h" | 58 #include "chrome/browser/prerender/prerender_tracker.h" |
| 59 #include "chrome/browser/printing/background_printing_manager.h" | 59 #include "chrome/browser/printing/background_printing_manager.h" |
| 60 #include "chrome/browser/printing/print_job_manager.h" | 60 #include "chrome/browser/printing/print_job_manager.h" |
| 61 #include "chrome/browser/printing/print_preview_dialog_controller.h" | 61 #include "chrome/browser/printing/print_preview_dialog_controller.h" |
| 62 #include "chrome/browser/profiles/profile_manager.h" | 62 #include "chrome/browser/profiles/profile_manager.h" |
| 63 #include "chrome/browser/renderer_host/chrome_resource_dispatcher_host_delegate.
h" | 63 #include "chrome/browser/renderer_host/chrome_resource_dispatcher_host_delegate.
h" |
| 64 #include "chrome/browser/safe_browsing/safe_browsing_service.h" | 64 #include "chrome/browser/safe_browsing/safe_browsing_service.h" |
| 65 #include "chrome/browser/shell_integration.h" | 65 #include "chrome/browser/shell_integration.h" |
| 66 #include "chrome/browser/status_icons/status_tray.h" | 66 #include "chrome/browser/status_icons/status_tray.h" |
| 67 #include "chrome/browser/storage_monitor/storage_monitor.h" | 67 #include "chrome/browser/storage_monitor/storage_monitor.h" |
| 68 #include "chrome/browser/thumbnails/render_widget_snapshot_taker.h" | |
| 69 #include "chrome/browser/ui/bookmarks/bookmark_prompt_controller.h" | 68 #include "chrome/browser/ui/bookmarks/bookmark_prompt_controller.h" |
| 70 #include "chrome/browser/ui/browser_dialogs.h" | 69 #include "chrome/browser/ui/browser_dialogs.h" |
| 71 #include "chrome/browser/ui/browser_finder.h" | 70 #include "chrome/browser/ui/browser_finder.h" |
| 72 #include "chrome/browser/web_resource/promo_resource_service.h" | 71 #include "chrome/browser/web_resource/promo_resource_service.h" |
| 73 #include "chrome/common/chrome_constants.h" | 72 #include "chrome/common/chrome_constants.h" |
| 74 #include "chrome/common/chrome_paths.h" | 73 #include "chrome/common/chrome_paths.h" |
| 75 #include "chrome/common/chrome_switches.h" | 74 #include "chrome/common/chrome_switches.h" |
| 76 #include "chrome/common/extensions/chrome_extensions_client.h" | 75 #include "chrome/common/extensions/chrome_extensions_client.h" |
| 77 #include "chrome/common/extensions/extension_l10n_util.h" | 76 #include "chrome/common/extensions/extension_l10n_util.h" |
| 78 #include "chrome/common/pref_names.h" | 77 #include "chrome/common/pref_names.h" |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 155 : created_metrics_service_(false), | 154 : created_metrics_service_(false), |
| 156 created_watchdog_thread_(false), | 155 created_watchdog_thread_(false), |
| 157 created_browser_policy_connector_(false), | 156 created_browser_policy_connector_(false), |
| 158 created_profile_manager_(false), | 157 created_profile_manager_(false), |
| 159 created_local_state_(false), | 158 created_local_state_(false), |
| 160 created_icon_manager_(false), | 159 created_icon_manager_(false), |
| 161 created_notification_ui_manager_(false), | 160 created_notification_ui_manager_(false), |
| 162 created_safe_browsing_service_(false), | 161 created_safe_browsing_service_(false), |
| 163 module_ref_count_(0), | 162 module_ref_count_(0), |
| 164 did_start_(false), | 163 did_start_(false), |
| 165 render_widget_snapshot_taker_(new RenderWidgetSnapshotTaker), | |
| 166 download_status_updater_(new DownloadStatusUpdater), | 164 download_status_updater_(new DownloadStatusUpdater), |
| 167 local_state_task_runner_(local_state_task_runner) { | 165 local_state_task_runner_(local_state_task_runner) { |
| 168 g_browser_process = this; | 166 g_browser_process = this; |
| 169 platform_part_.reset(new BrowserProcessPlatformPart()); | 167 platform_part_.reset(new BrowserProcessPlatformPart()); |
| 170 | 168 |
| 171 #if defined(ENABLE_PRINTING) | 169 #if defined(ENABLE_PRINTING) |
| 172 // Must be created after the NotificationService. | 170 // Must be created after the NotificationService. |
| 173 print_job_manager_.reset(new printing::PrintJobManager); | 171 print_job_manager_.reset(new printing::PrintJobManager); |
| 174 #endif | 172 #endif |
| 175 | 173 |
| (...skipping 368 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 544 return gl_string_manager_.get(); | 542 return gl_string_manager_.get(); |
| 545 } | 543 } |
| 546 | 544 |
| 547 GpuModeManager* BrowserProcessImpl::gpu_mode_manager() { | 545 GpuModeManager* BrowserProcessImpl::gpu_mode_manager() { |
| 548 DCHECK(CalledOnValidThread()); | 546 DCHECK(CalledOnValidThread()); |
| 549 if (!gpu_mode_manager_.get()) | 547 if (!gpu_mode_manager_.get()) |
| 550 gpu_mode_manager_.reset(new GpuModeManager()); | 548 gpu_mode_manager_.reset(new GpuModeManager()); |
| 551 return gpu_mode_manager_.get(); | 549 return gpu_mode_manager_.get(); |
| 552 } | 550 } |
| 553 | 551 |
| 554 RenderWidgetSnapshotTaker* BrowserProcessImpl::GetRenderWidgetSnapshotTaker() { | |
| 555 return render_widget_snapshot_taker_.get(); | |
| 556 } | |
| 557 | |
| 558 AutomationProviderList* BrowserProcessImpl::GetAutomationProviderList() { | 552 AutomationProviderList* BrowserProcessImpl::GetAutomationProviderList() { |
| 559 DCHECK(CalledOnValidThread()); | 553 DCHECK(CalledOnValidThread()); |
| 560 #if defined(ENABLE_AUTOMATION) | 554 #if defined(ENABLE_AUTOMATION) |
| 561 if (automation_provider_list_.get() == NULL) | 555 if (automation_provider_list_.get() == NULL) |
| 562 automation_provider_list_.reset(new AutomationProviderList()); | 556 automation_provider_list_.reset(new AutomationProviderList()); |
| 563 return automation_provider_list_.get(); | 557 return automation_provider_list_.get(); |
| 564 #else | 558 #else |
| 565 return NULL; | 559 return NULL; |
| 566 #endif | 560 #endif |
| 567 } | 561 } |
| (...skipping 550 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1118 } | 1112 } |
| 1119 | 1113 |
| 1120 void BrowserProcessImpl::OnAutoupdateTimer() { | 1114 void BrowserProcessImpl::OnAutoupdateTimer() { |
| 1121 if (CanAutorestartForUpdate()) { | 1115 if (CanAutorestartForUpdate()) { |
| 1122 DLOG(WARNING) << "Detected update. Restarting browser."; | 1116 DLOG(WARNING) << "Detected update. Restarting browser."; |
| 1123 RestartBackgroundInstance(); | 1117 RestartBackgroundInstance(); |
| 1124 } | 1118 } |
| 1125 } | 1119 } |
| 1126 | 1120 |
| 1127 #endif // (defined(OS_WIN) || defined(OS_LINUX)) && !defined(OS_CHROMEOS) | 1121 #endif // (defined(OS_WIN) || defined(OS_LINUX)) && !defined(OS_CHROMEOS) |
| OLD | NEW |