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