| 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 859 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 870 #endif | 870 #endif |
| 871 } | 871 } |
| 872 | 872 |
| 873 StatusTray* BrowserProcessImpl::status_tray() { | 873 StatusTray* BrowserProcessImpl::status_tray() { |
| 874 DCHECK(CalledOnValidThread()); | 874 DCHECK(CalledOnValidThread()); |
| 875 if (!status_tray_.get()) | 875 if (!status_tray_.get()) |
| 876 CreateStatusTray(); | 876 CreateStatusTray(); |
| 877 return status_tray_.get(); | 877 return status_tray_.get(); |
| 878 } | 878 } |
| 879 | 879 |
| 880 | 880 safe_browsing::SafeBrowsingService* |
| 881 SafeBrowsingService* BrowserProcessImpl::safe_browsing_service() { | 881 BrowserProcessImpl::safe_browsing_service() { |
| 882 DCHECK(CalledOnValidThread()); | 882 DCHECK(CalledOnValidThread()); |
| 883 if (!created_safe_browsing_service_) | 883 if (!created_safe_browsing_service_) |
| 884 CreateSafeBrowsingService(); | 884 CreateSafeBrowsingService(); |
| 885 return safe_browsing_service_.get(); | 885 return safe_browsing_service_.get(); |
| 886 } | 886 } |
| 887 | 887 |
| 888 safe_browsing::ClientSideDetectionService* | 888 safe_browsing::ClientSideDetectionService* |
| 889 BrowserProcessImpl::safe_browsing_detection_service() { | 889 BrowserProcessImpl::safe_browsing_detection_service() { |
| 890 DCHECK(CalledOnValidThread()); | 890 DCHECK(CalledOnValidThread()); |
| 891 if (safe_browsing_service()) | 891 if (safe_browsing_service()) |
| (...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1158 #else | 1158 #else |
| 1159 NOTIMPLEMENTED(); | 1159 NOTIMPLEMENTED(); |
| 1160 #endif | 1160 #endif |
| 1161 } | 1161 } |
| 1162 | 1162 |
| 1163 void BrowserProcessImpl::CreateSafeBrowsingService() { | 1163 void BrowserProcessImpl::CreateSafeBrowsingService() { |
| 1164 DCHECK(safe_browsing_service_.get() == NULL); | 1164 DCHECK(safe_browsing_service_.get() == NULL); |
| 1165 // Set this flag to true so that we don't retry indefinitely to | 1165 // Set this flag to true so that we don't retry indefinitely to |
| 1166 // create the service class if there was an error. | 1166 // create the service class if there was an error. |
| 1167 created_safe_browsing_service_ = true; | 1167 created_safe_browsing_service_ = true; |
| 1168 safe_browsing_service_ = SafeBrowsingService::CreateSafeBrowsingService(); | 1168 safe_browsing_service_ = |
| 1169 safe_browsing::SafeBrowsingService::CreateSafeBrowsingService(); |
| 1169 safe_browsing_service_->Initialize(); | 1170 safe_browsing_service_->Initialize(); |
| 1170 } | 1171 } |
| 1171 | 1172 |
| 1172 void BrowserProcessImpl::CreateGCMDriver() { | 1173 void BrowserProcessImpl::CreateGCMDriver() { |
| 1173 DCHECK(!gcm_driver_); | 1174 DCHECK(!gcm_driver_); |
| 1174 | 1175 |
| 1175 #if defined(OS_ANDROID) | 1176 #if defined(OS_ANDROID) |
| 1176 // Android's GCMDriver currently makes the assumption that it's a singleton. | 1177 // Android's GCMDriver currently makes the assumption that it's a singleton. |
| 1177 // Until this gets fixed, instantiating multiple Java GCMDrivers will throw | 1178 // Until this gets fixed, instantiating multiple Java GCMDrivers will throw |
| 1178 // an exception, but because they're only initialized on demand these crashes | 1179 // an exception, but because they're only initialized on demand these crashes |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1285 } | 1286 } |
| 1286 | 1287 |
| 1287 void BrowserProcessImpl::OnAutoupdateTimer() { | 1288 void BrowserProcessImpl::OnAutoupdateTimer() { |
| 1288 if (CanAutorestartForUpdate()) { | 1289 if (CanAutorestartForUpdate()) { |
| 1289 DLOG(WARNING) << "Detected update. Restarting browser."; | 1290 DLOG(WARNING) << "Detected update. Restarting browser."; |
| 1290 RestartBackgroundInstance(); | 1291 RestartBackgroundInstance(); |
| 1291 } | 1292 } |
| 1292 } | 1293 } |
| 1293 | 1294 |
| 1294 #endif // (defined(OS_WIN) || defined(OS_LINUX)) && !defined(OS_CHROMEOS) | 1295 #endif // (defined(OS_WIN) || defined(OS_LINUX)) && !defined(OS_CHROMEOS) |
| OLD | NEW |