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 1117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1128 void BrowserProcessImpl::CreateGCMDriver() { | 1128 void BrowserProcessImpl::CreateGCMDriver() { |
1129 DCHECK(!gcm_driver_); | 1129 DCHECK(!gcm_driver_); |
1130 | 1130 |
1131 #if defined(OS_ANDROID) | 1131 #if defined(OS_ANDROID) |
1132 gcm_driver_.reset(new gcm::GCMDriverAndroid); | 1132 gcm_driver_.reset(new gcm::GCMDriverAndroid); |
1133 #else | 1133 #else |
1134 base::FilePath store_path; | 1134 base::FilePath store_path; |
1135 CHECK(PathService::Get(chrome::DIR_GLOBAL_GCM_STORE, &store_path)); | 1135 CHECK(PathService::Get(chrome::DIR_GLOBAL_GCM_STORE, &store_path)); |
1136 gcm_driver_ = gcm::CreateGCMDriverDesktop( | 1136 gcm_driver_ = gcm::CreateGCMDriverDesktop( |
1137 make_scoped_ptr(new gcm::GCMClientFactory), | 1137 make_scoped_ptr(new gcm::GCMClientFactory), |
| 1138 local_state(), |
1138 store_path, | 1139 store_path, |
1139 system_request_context()); | 1140 system_request_context()); |
1140 // Sign-in is not required for device-level GCM usage. So we just call | 1141 // Sign-in is not required for device-level GCM usage. So we just call |
1141 // OnSignedIn to assume always signed-in. Note that GCM will not be started | 1142 // OnSignedIn to assume always signed-in. Note that GCM will not be started |
1142 // at this point since no one has asked for it yet. | 1143 // at this point since no one has asked for it yet. |
1143 // TODO(jianli): To be removed when sign-in enforcement is dropped. | 1144 // TODO(jianli): To be removed when sign-in enforcement is dropped. |
1144 gcm_driver_->OnSignedIn(); | 1145 gcm_driver_->OnSignedIn(); |
1145 #endif // defined(OS_ANDROID) | 1146 #endif // defined(OS_ANDROID) |
1146 } | 1147 } |
1147 | 1148 |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1218 } | 1219 } |
1219 | 1220 |
1220 void BrowserProcessImpl::OnAutoupdateTimer() { | 1221 void BrowserProcessImpl::OnAutoupdateTimer() { |
1221 if (CanAutorestartForUpdate()) { | 1222 if (CanAutorestartForUpdate()) { |
1222 DLOG(WARNING) << "Detected update. Restarting browser."; | 1223 DLOG(WARNING) << "Detected update. Restarting browser."; |
1223 RestartBackgroundInstance(); | 1224 RestartBackgroundInstance(); |
1224 } | 1225 } |
1225 } | 1226 } |
1226 | 1227 |
1227 #endif // (defined(OS_WIN) || defined(OS_LINUX)) && !defined(OS_CHROMEOS) | 1228 #endif // (defined(OS_WIN) || defined(OS_LINUX)) && !defined(OS_CHROMEOS) |
OLD | NEW |