| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/extensions/extensions_service.h" | 5 #include "chrome/browser/extensions/extensions_service.h" |
| 6 | 6 |
| 7 #include "base/basictypes.h" | 7 #include "base/basictypes.h" |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/file_util.h" | 9 #include "base/file_util.h" |
| 10 #include "base/histogram.h" | 10 #include "base/histogram.h" |
| (...skipping 1122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1133 // either fully working or not loaded at all, but never half-crashed. | 1133 // either fully working or not loaded at all, but never half-crashed. |
| 1134 UnloadExtension(Details<ExtensionHost>(details).ptr()->extension()->id()); | 1134 UnloadExtension(Details<ExtensionHost>(details).ptr()->extension()->id()); |
| 1135 break; | 1135 break; |
| 1136 } | 1136 } |
| 1137 | 1137 |
| 1138 default: | 1138 default: |
| 1139 NOTREACHED() << "Unexpected notification type."; | 1139 NOTREACHED() << "Unexpected notification type."; |
| 1140 } | 1140 } |
| 1141 } | 1141 } |
| 1142 | 1142 |
| 1143 bool ExtensionsService::HasApps() { |
| 1144 if (!extensions_enabled_) |
| 1145 return false; |
| 1146 |
| 1147 for (ExtensionList::const_iterator it = extensions_.begin(); |
| 1148 it != extensions_.end(); ++it) { |
| 1149 if ((*it)->is_app()) |
| 1150 return true; |
| 1151 } |
| 1152 |
| 1153 return false; |
| 1154 } |
| 1143 | 1155 |
| 1144 // ExtensionsServicesBackend | 1156 // ExtensionsServicesBackend |
| 1145 | 1157 |
| 1146 ExtensionsServiceBackend::ExtensionsServiceBackend( | 1158 ExtensionsServiceBackend::ExtensionsServiceBackend( |
| 1147 const FilePath& install_directory) | 1159 const FilePath& install_directory) |
| 1148 : frontend_(NULL), | 1160 : frontend_(NULL), |
| 1149 install_directory_(install_directory), | 1161 install_directory_(install_directory), |
| 1150 alert_on_error_(false) { | 1162 alert_on_error_(false) { |
| 1151 // TODO(aa): This ends up doing blocking IO on the UI thread because it reads | 1163 // TODO(aa): This ends up doing blocking IO on the UI thread because it reads |
| 1152 // pref data in the ctor and that is called on the UI thread. Would be better | 1164 // pref data in the ctor and that is called on the UI thread. Would be better |
| (...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1320 // Finish installing on UI thread. | 1332 // Finish installing on UI thread. |
| 1321 ChromeThread::PostTask( | 1333 ChromeThread::PostTask( |
| 1322 ChromeThread::UI, FROM_HERE, | 1334 ChromeThread::UI, FROM_HERE, |
| 1323 NewRunnableMethod( | 1335 NewRunnableMethod( |
| 1324 frontend_, | 1336 frontend_, |
| 1325 &ExtensionsService::ContinueLoadAllExtensions, | 1337 &ExtensionsService::ContinueLoadAllExtensions, |
| 1326 extensions_to_reload, | 1338 extensions_to_reload, |
| 1327 start_time, | 1339 start_time, |
| 1328 true)); | 1340 true)); |
| 1329 } | 1341 } |
| OLD | NEW |