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