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 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
112 #endif | 112 #endif |
113 | 113 |
114 #if defined(OS_CHROMEOS) | 114 #if defined(OS_CHROMEOS) |
115 #include "chrome/browser/chromeos/memory/oom_priority_manager.h" | 115 #include "chrome/browser/chromeos/memory/oom_priority_manager.h" |
116 #endif // defined(OS_CHROMEOS) | 116 #endif // defined(OS_CHROMEOS) |
117 | 117 |
118 #if defined(ENABLE_PLUGIN_INSTALLATION) | 118 #if defined(ENABLE_PLUGIN_INSTALLATION) |
119 #include "chrome/browser/plugins/plugins_resource_service.h" | 119 #include "chrome/browser/plugins/plugins_resource_service.h" |
120 #endif | 120 #endif |
121 | 121 |
| 122 #if defined(OS_MACOSX) |
| 123 #include "chrome/browser/web_applications/app_shim_host_controller.h" |
| 124 #endif |
| 125 |
122 #if (defined(OS_WIN) || defined(OS_LINUX)) && !defined(OS_CHROMEOS) | 126 #if (defined(OS_WIN) || defined(OS_LINUX)) && !defined(OS_CHROMEOS) |
123 // How often to check if the persistent instance of Chrome needs to restart | 127 // How often to check if the persistent instance of Chrome needs to restart |
124 // to install an update. | 128 // to install an update. |
125 static const int kUpdateCheckIntervalHours = 6; | 129 static const int kUpdateCheckIntervalHours = 6; |
126 #endif | 130 #endif |
127 | 131 |
128 #if defined(OS_WIN) | 132 #if defined(OS_WIN) |
129 // Attest to the fact that the call to the file thread to save preferences has | 133 // Attest to the fact that the call to the file thread to save preferences has |
130 // run, and it is safe to terminate. This avoids the potential of some other | 134 // run, and it is safe to terminate. This avoids the potential of some other |
131 // task prematurely terminating our waiting message loop by posting a | 135 // task prematurely terminating our waiting message loop by posting a |
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
258 #endif | 262 #endif |
259 | 263 |
260 // Stop the watchdog thread before stopping other threads. | 264 // Stop the watchdog thread before stopping other threads. |
261 watchdog_thread_.reset(); | 265 watchdog_thread_.reset(); |
262 | 266 |
263 #if defined(USE_AURA) | 267 #if defined(USE_AURA) |
264 // Delete aura after the metrics service has been deleted as it accesses | 268 // Delete aura after the metrics service has been deleted as it accesses |
265 // monitor information. | 269 // monitor information. |
266 aura::Env::DeleteInstance(); | 270 aura::Env::DeleteInstance(); |
267 #endif | 271 #endif |
| 272 |
| 273 #if defined(OS_MACOSX) |
| 274 app_shim_host_controller_.reset(); |
| 275 #endif |
268 } | 276 } |
269 | 277 |
270 void BrowserProcessImpl::PostDestroyThreads() { | 278 void BrowserProcessImpl::PostDestroyThreads() { |
271 // With the file_thread_ flushed, we can release any icon resources. | 279 // With the file_thread_ flushed, we can release any icon resources. |
272 icon_manager_.reset(); | 280 icon_manager_.reset(); |
273 | 281 |
274 // Reset associated state right after actual thread is stopped, | 282 // Reset associated state right after actual thread is stopped, |
275 // as io_thread_.global_ cleanup happens in CleanUp on the IO | 283 // as io_thread_.global_ cleanup happens in CleanUp on the IO |
276 // thread, i.e. as the thread exits its message loop. | 284 // thread, i.e. as the thread exits its message loop. |
277 // | 285 // |
(...skipping 603 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
881 promo_resource_service_ = new PromoResourceService; | 889 promo_resource_service_ = new PromoResourceService; |
882 promo_resource_service_->StartAfterDelay(); | 890 promo_resource_service_->StartAfterDelay(); |
883 } | 891 } |
884 | 892 |
885 #if !defined(OS_ANDROID) | 893 #if !defined(OS_ANDROID) |
886 if (browser_defaults::bookmarks_enabled && | 894 if (browser_defaults::bookmarks_enabled && |
887 BookmarkPromptController::IsEnabled()) { | 895 BookmarkPromptController::IsEnabled()) { |
888 bookmark_prompt_controller_.reset(new BookmarkPromptController()); | 896 bookmark_prompt_controller_.reset(new BookmarkPromptController()); |
889 } | 897 } |
890 #endif | 898 #endif |
| 899 |
| 900 #if defined(OS_MACOSX) |
| 901 app_shim_host_controller_.reset(new AppShimHostController); |
| 902 #endif |
891 } | 903 } |
892 | 904 |
893 void BrowserProcessImpl::CreateIconManager() { | 905 void BrowserProcessImpl::CreateIconManager() { |
894 DCHECK(!created_icon_manager_ && icon_manager_.get() == NULL); | 906 DCHECK(!created_icon_manager_ && icon_manager_.get() == NULL); |
895 created_icon_manager_ = true; | 907 created_icon_manager_ = true; |
896 icon_manager_.reset(new IconManager); | 908 icon_manager_.reset(new IconManager); |
897 } | 909 } |
898 | 910 |
899 void BrowserProcessImpl::CreateIntranetRedirectDetector() { | 911 void BrowserProcessImpl::CreateIntranetRedirectDetector() { |
900 DCHECK(intranet_redirect_detector_.get() == NULL); | 912 DCHECK(intranet_redirect_detector_.get() == NULL); |
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1029 } | 1041 } |
1030 | 1042 |
1031 void BrowserProcessImpl::OnAutoupdateTimer() { | 1043 void BrowserProcessImpl::OnAutoupdateTimer() { |
1032 if (CanAutorestartForUpdate()) { | 1044 if (CanAutorestartForUpdate()) { |
1033 DLOG(WARNING) << "Detected update. Restarting browser."; | 1045 DLOG(WARNING) << "Detected update. Restarting browser."; |
1034 RestartBackgroundInstance(); | 1046 RestartBackgroundInstance(); |
1035 } | 1047 } |
1036 } | 1048 } |
1037 | 1049 |
1038 #endif // (defined(OS_WIN) || defined(OS_LINUX)) && !defined(OS_CHROMEOS) | 1050 #endif // (defined(OS_WIN) || defined(OS_LINUX)) && !defined(OS_CHROMEOS) |
OLD | NEW |