| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/extension_service.h" | 5 #include "chrome/browser/extensions/extension_service.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <set> | 8 #include <set> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| (...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 202 ExtensionService::NaClModuleInfo::NaClModuleInfo() { | 202 ExtensionService::NaClModuleInfo::NaClModuleInfo() { |
| 203 } | 203 } |
| 204 | 204 |
| 205 ExtensionService::NaClModuleInfo::~NaClModuleInfo() { | 205 ExtensionService::NaClModuleInfo::~NaClModuleInfo() { |
| 206 } | 206 } |
| 207 | 207 |
| 208 // ExtensionService. | 208 // ExtensionService. |
| 209 | 209 |
| 210 const char* ExtensionService::kInstallDirectoryName = "Extensions"; | 210 const char* ExtensionService::kInstallDirectoryName = "Extensions"; |
| 211 const char* ExtensionService::kCurrentVersionFileName = "Current Version"; | 211 const char* ExtensionService::kCurrentVersionFileName = "Current Version"; |
| 212 const char* ExtensionService::kSettingsDirectoryName = "Extension Settings"; |
| 212 | 213 |
| 213 // Implements IO for the ExtensionService. | 214 // Implements IO for the ExtensionService. |
| 214 | 215 |
| 215 class ExtensionServiceBackend | 216 class ExtensionServiceBackend |
| 216 : public base::RefCountedThreadSafe<ExtensionServiceBackend> { | 217 : public base::RefCountedThreadSafe<ExtensionServiceBackend> { |
| 217 public: | 218 public: |
| 218 // |install_directory| is a path where to look for extensions to load. | 219 // |install_directory| is a path where to look for extensions to load. |
| 219 ExtensionServiceBackend( | 220 ExtensionServiceBackend( |
| 220 base::WeakPtr<ExtensionService> frontend, | 221 base::WeakPtr<ExtensionService> frontend, |
| 221 const FilePath& install_directory); | 222 const FilePath& install_directory); |
| (...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 484 return false; | 485 return false; |
| 485 } | 486 } |
| 486 | 487 |
| 487 return true; | 488 return true; |
| 488 } | 489 } |
| 489 | 490 |
| 490 ExtensionService::ExtensionService(Profile* profile, | 491 ExtensionService::ExtensionService(Profile* profile, |
| 491 const CommandLine* command_line, | 492 const CommandLine* command_line, |
| 492 const FilePath& install_directory, | 493 const FilePath& install_directory, |
| 493 ExtensionPrefs* extension_prefs, | 494 ExtensionPrefs* extension_prefs, |
| 495 ExtensionSettings* extension_settings, |
| 494 bool autoupdate_enabled, | 496 bool autoupdate_enabled, |
| 495 bool extensions_enabled) | 497 bool extensions_enabled) |
| 496 : weak_ptr_factory_(ALLOW_THIS_IN_INITIALIZER_LIST(this)), | 498 : weak_ptr_factory_(ALLOW_THIS_IN_INITIALIZER_LIST(this)), |
| 497 method_factory_(ALLOW_THIS_IN_INITIALIZER_LIST(this)), | 499 method_factory_(ALLOW_THIS_IN_INITIALIZER_LIST(this)), |
| 498 profile_(profile), | 500 profile_(profile), |
| 499 extension_prefs_(extension_prefs), | 501 extension_prefs_(extension_prefs), |
| 502 extension_settings_(extension_settings), |
| 500 pending_extension_manager_(*ALLOW_THIS_IN_INITIALIZER_LIST(this)), | 503 pending_extension_manager_(*ALLOW_THIS_IN_INITIALIZER_LIST(this)), |
| 501 install_directory_(install_directory), | 504 install_directory_(install_directory), |
| 502 extensions_enabled_(extensions_enabled), | 505 extensions_enabled_(extensions_enabled), |
| 503 show_extensions_prompts_(true), | 506 show_extensions_prompts_(true), |
| 504 ready_(false), | 507 ready_(false), |
| 505 toolbar_model_(ALLOW_THIS_IN_INITIALIZER_LIST(this)), | 508 toolbar_model_(ALLOW_THIS_IN_INITIALIZER_LIST(this)), |
| 506 apps_promo_(profile->GetPrefs()), | 509 apps_promo_(profile->GetPrefs()), |
| 507 event_routers_initialized_(false) { | 510 event_routers_initialized_(false) { |
| 508 CHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 511 CHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 509 | 512 |
| (...skipping 850 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1360 } | 1363 } |
| 1361 | 1364 |
| 1362 Profile* ExtensionService::profile() { | 1365 Profile* ExtensionService::profile() { |
| 1363 return profile_; | 1366 return profile_; |
| 1364 } | 1367 } |
| 1365 | 1368 |
| 1366 ExtensionPrefs* ExtensionService::extension_prefs() { | 1369 ExtensionPrefs* ExtensionService::extension_prefs() { |
| 1367 return extension_prefs_; | 1370 return extension_prefs_; |
| 1368 } | 1371 } |
| 1369 | 1372 |
| 1373 ExtensionSettings* ExtensionService::extension_settings() { |
| 1374 return extension_settings_; |
| 1375 } |
| 1376 |
| 1370 ExtensionContentSettingsStore* | 1377 ExtensionContentSettingsStore* |
| 1371 ExtensionService::GetExtensionContentSettingsStore() { | 1378 ExtensionService::GetExtensionContentSettingsStore() { |
| 1372 return extension_prefs()->content_settings_store(); | 1379 return extension_prefs()->content_settings_store(); |
| 1373 } | 1380 } |
| 1374 | 1381 |
| 1375 ExtensionUpdater* ExtensionService::updater() { | 1382 ExtensionUpdater* ExtensionService::updater() { |
| 1376 return updater_.get(); | 1383 return updater_.get(); |
| 1377 } | 1384 } |
| 1378 | 1385 |
| 1379 void ExtensionService::CheckAdminBlacklist() { | 1386 void ExtensionService::CheckAdminBlacklist() { |
| (...skipping 951 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2331 | 2338 |
| 2332 ExtensionService::NaClModuleInfoList::iterator | 2339 ExtensionService::NaClModuleInfoList::iterator |
| 2333 ExtensionService::FindNaClModule(const GURL& url) { | 2340 ExtensionService::FindNaClModule(const GURL& url) { |
| 2334 for (NaClModuleInfoList::iterator iter = nacl_module_list_.begin(); | 2341 for (NaClModuleInfoList::iterator iter = nacl_module_list_.begin(); |
| 2335 iter != nacl_module_list_.end(); ++iter) { | 2342 iter != nacl_module_list_.end(); ++iter) { |
| 2336 if (iter->url == url) | 2343 if (iter->url == url) |
| 2337 return iter; | 2344 return iter; |
| 2338 } | 2345 } |
| 2339 return nacl_module_list_.end(); | 2346 return nacl_module_list_.end(); |
| 2340 } | 2347 } |
| OLD | NEW |