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 <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <algorithm> | 9 #include <algorithm> |
10 #include <map> | 10 #include <map> |
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
122 | 122 |
123 #if defined(OS_WIN) | 123 #if defined(OS_WIN) |
124 #include "base/win/windows_version.h" | 124 #include "base/win/windows_version.h" |
125 #include "ui/views/focus/view_storage.h" | 125 #include "ui/views/focus/view_storage.h" |
126 #elif defined(OS_MACOSX) | 126 #elif defined(OS_MACOSX) |
127 #include "chrome/browser/chrome_browser_main_mac.h" | 127 #include "chrome/browser/chrome_browser_main_mac.h" |
128 #endif | 128 #endif |
129 | 129 |
130 #if !defined(OS_ANDROID) | 130 #if !defined(OS_ANDROID) |
131 #include "chrome/browser/lifetime/keep_alive_registry.h" | 131 #include "chrome/browser/lifetime/keep_alive_registry.h" |
| 132 #include "chrome/browser/services/gcm/gcm_product_util.h" |
132 #include "chrome/browser/ui/user_manager.h" | 133 #include "chrome/browser/ui/user_manager.h" |
133 #include "components/gcm_driver/gcm_client_factory.h" | 134 #include "components/gcm_driver/gcm_client_factory.h" |
134 #include "components/gcm_driver/gcm_desktop_utils.h" | 135 #include "components/gcm_driver/gcm_desktop_utils.h" |
135 #endif | 136 #endif |
136 | 137 |
137 #if BUILDFLAG(ENABLE_BACKGROUND) | 138 #if BUILDFLAG(ENABLE_BACKGROUND) |
138 #include "chrome/browser/background/background_mode_manager.h" | 139 #include "chrome/browser/background/background_mode_manager.h" |
139 #endif | 140 #endif |
140 | 141 |
141 #if defined(ENABLE_EXTENSIONS) | 142 #if defined(ENABLE_EXTENSIONS) |
(...skipping 1038 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1180 base::SequencedWorkerPool* worker_pool = | 1181 base::SequencedWorkerPool* worker_pool = |
1181 content::BrowserThread::GetBlockingPool(); | 1182 content::BrowserThread::GetBlockingPool(); |
1182 scoped_refptr<base::SequencedTaskRunner> blocking_task_runner( | 1183 scoped_refptr<base::SequencedTaskRunner> blocking_task_runner( |
1183 worker_pool->GetSequencedTaskRunnerWithShutdownBehavior( | 1184 worker_pool->GetSequencedTaskRunnerWithShutdownBehavior( |
1184 worker_pool->GetSequenceToken(), | 1185 worker_pool->GetSequenceToken(), |
1185 base::SequencedWorkerPool::SKIP_ON_SHUTDOWN)); | 1186 base::SequencedWorkerPool::SKIP_ON_SHUTDOWN)); |
1186 | 1187 |
1187 gcm_driver_ = gcm::CreateGCMDriverDesktop( | 1188 gcm_driver_ = gcm::CreateGCMDriverDesktop( |
1188 base::WrapUnique(new gcm::GCMClientFactory), local_state(), store_path, | 1189 base::WrapUnique(new gcm::GCMClientFactory), local_state(), store_path, |
1189 system_request_context(), chrome::GetChannel(), | 1190 system_request_context(), chrome::GetChannel(), |
| 1191 gcm::GetProductCategoryForSubtypes(local_state()), |
1190 content::BrowserThread::GetTaskRunnerForThread( | 1192 content::BrowserThread::GetTaskRunnerForThread( |
1191 content::BrowserThread::UI), | 1193 content::BrowserThread::UI), |
1192 content::BrowserThread::GetTaskRunnerForThread( | 1194 content::BrowserThread::GetTaskRunnerForThread( |
1193 content::BrowserThread::IO), | 1195 content::BrowserThread::IO), |
1194 blocking_task_runner); | 1196 blocking_task_runner); |
1195 #endif // defined(OS_ANDROID) | 1197 #endif // defined(OS_ANDROID) |
1196 } | 1198 } |
1197 | 1199 |
1198 void BrowserProcessImpl::ApplyDefaultBrowserPolicy() { | 1200 void BrowserProcessImpl::ApplyDefaultBrowserPolicy() { |
1199 if (local_state()->GetBoolean(prefs::kDefaultBrowserSettingEnabled)) { | 1201 if (local_state()->GetBoolean(prefs::kDefaultBrowserSettingEnabled)) { |
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1337 } | 1339 } |
1338 | 1340 |
1339 void BrowserProcessImpl::OnAutoupdateTimer() { | 1341 void BrowserProcessImpl::OnAutoupdateTimer() { |
1340 if (CanAutorestartForUpdate()) { | 1342 if (CanAutorestartForUpdate()) { |
1341 DLOG(WARNING) << "Detected update. Restarting browser."; | 1343 DLOG(WARNING) << "Detected update. Restarting browser."; |
1342 RestartBackgroundInstance(); | 1344 RestartBackgroundInstance(); |
1343 } | 1345 } |
1344 } | 1346 } |
1345 | 1347 |
1346 #endif // (defined(OS_WIN) || defined(OS_LINUX)) && !defined(OS_CHROMEOS) | 1348 #endif // (defined(OS_WIN) || defined(OS_LINUX)) && !defined(OS_CHROMEOS) |
OLD | NEW |