| 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 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 209 ExtensionService::NaClModuleInfo::NaClModuleInfo() { | 209 ExtensionService::NaClModuleInfo::NaClModuleInfo() { |
| 210 } | 210 } |
| 211 | 211 |
| 212 ExtensionService::NaClModuleInfo::~NaClModuleInfo() { | 212 ExtensionService::NaClModuleInfo::~NaClModuleInfo() { |
| 213 } | 213 } |
| 214 | 214 |
| 215 // ExtensionService. | 215 // ExtensionService. |
| 216 | 216 |
| 217 const char* ExtensionService::kInstallDirectoryName = "Extensions"; | 217 const char* ExtensionService::kInstallDirectoryName = "Extensions"; |
| 218 const char* ExtensionService::kCurrentVersionFileName = "Current Version"; | 218 const char* ExtensionService::kCurrentVersionFileName = "Current Version"; |
| 219 const char* ExtensionService::kSettingsDirectoryName = "Extension Settings"; |
| 219 | 220 |
| 220 // Implements IO for the ExtensionService. | 221 // Implements IO for the ExtensionService. |
| 221 | 222 |
| 222 class ExtensionServiceBackend | 223 class ExtensionServiceBackend |
| 223 : public base::RefCountedThreadSafe<ExtensionServiceBackend> { | 224 : public base::RefCountedThreadSafe<ExtensionServiceBackend> { |
| 224 public: | 225 public: |
| 225 // |install_directory| is a path where to look for extensions to load. | 226 // |install_directory| is a path where to look for extensions to load. |
| 226 ExtensionServiceBackend( | 227 ExtensionServiceBackend( |
| 227 base::WeakPtr<ExtensionService> frontend, | 228 base::WeakPtr<ExtensionService> frontend, |
| 228 const FilePath& install_directory); | 229 const FilePath& install_directory); |
| (...skipping 303 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 532 return false; | 533 return false; |
| 533 } | 534 } |
| 534 | 535 |
| 535 return true; | 536 return true; |
| 536 } | 537 } |
| 537 | 538 |
| 538 ExtensionService::ExtensionService(Profile* profile, | 539 ExtensionService::ExtensionService(Profile* profile, |
| 539 const CommandLine* command_line, | 540 const CommandLine* command_line, |
| 540 const FilePath& install_directory, | 541 const FilePath& install_directory, |
| 541 ExtensionPrefs* extension_prefs, | 542 ExtensionPrefs* extension_prefs, |
| 543 ExtensionSettings* extension_settings, |
| 542 bool autoupdate_enabled, | 544 bool autoupdate_enabled, |
| 543 bool extensions_enabled) | 545 bool extensions_enabled) |
| 544 : weak_ptr_factory_(ALLOW_THIS_IN_INITIALIZER_LIST(this)), | 546 : weak_ptr_factory_(ALLOW_THIS_IN_INITIALIZER_LIST(this)), |
| 545 method_factory_(ALLOW_THIS_IN_INITIALIZER_LIST(this)), | 547 method_factory_(ALLOW_THIS_IN_INITIALIZER_LIST(this)), |
| 546 profile_(profile), | 548 profile_(profile), |
| 547 extension_prefs_(extension_prefs), | 549 extension_prefs_(extension_prefs), |
| 550 extension_settings_(extension_settings), |
| 548 pending_extension_manager_(*ALLOW_THIS_IN_INITIALIZER_LIST(this)), | 551 pending_extension_manager_(*ALLOW_THIS_IN_INITIALIZER_LIST(this)), |
| 549 install_directory_(install_directory), | 552 install_directory_(install_directory), |
| 550 extensions_enabled_(extensions_enabled), | 553 extensions_enabled_(extensions_enabled), |
| 551 show_extensions_prompts_(true), | 554 show_extensions_prompts_(true), |
| 552 ready_(false), | 555 ready_(false), |
| 553 toolbar_model_(ALLOW_THIS_IN_INITIALIZER_LIST(this)), | 556 toolbar_model_(ALLOW_THIS_IN_INITIALIZER_LIST(this)), |
| 554 apps_promo_(profile->GetPrefs()), | 557 apps_promo_(profile->GetPrefs()), |
| 555 event_routers_initialized_(false) { | 558 event_routers_initialized_(false) { |
| 556 CHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 559 CHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 557 | 560 |
| (...skipping 901 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1459 } | 1462 } |
| 1460 | 1463 |
| 1461 Profile* ExtensionService::profile() { | 1464 Profile* ExtensionService::profile() { |
| 1462 return profile_; | 1465 return profile_; |
| 1463 } | 1466 } |
| 1464 | 1467 |
| 1465 ExtensionPrefs* ExtensionService::extension_prefs() { | 1468 ExtensionPrefs* ExtensionService::extension_prefs() { |
| 1466 return extension_prefs_; | 1469 return extension_prefs_; |
| 1467 } | 1470 } |
| 1468 | 1471 |
| 1472 ExtensionSettings* ExtensionService::extension_settings() { |
| 1473 return extension_settings_; |
| 1474 } |
| 1475 |
| 1469 ExtensionContentSettingsStore* | 1476 ExtensionContentSettingsStore* |
| 1470 ExtensionService::GetExtensionContentSettingsStore() { | 1477 ExtensionService::GetExtensionContentSettingsStore() { |
| 1471 return extension_prefs()->content_settings_store(); | 1478 return extension_prefs()->content_settings_store(); |
| 1472 } | 1479 } |
| 1473 | 1480 |
| 1474 ExtensionUpdater* ExtensionService::updater() { | 1481 ExtensionUpdater* ExtensionService::updater() { |
| 1475 return updater_.get(); | 1482 return updater_.get(); |
| 1476 } | 1483 } |
| 1477 | 1484 |
| 1478 void ExtensionService::CheckAdminBlacklist() { | 1485 void ExtensionService::CheckAdminBlacklist() { |
| (...skipping 951 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2430 | 2437 |
| 2431 ExtensionService::NaClModuleInfoList::iterator | 2438 ExtensionService::NaClModuleInfoList::iterator |
| 2432 ExtensionService::FindNaClModule(const GURL& url) { | 2439 ExtensionService::FindNaClModule(const GURL& url) { |
| 2433 for (NaClModuleInfoList::iterator iter = nacl_module_list_.begin(); | 2440 for (NaClModuleInfoList::iterator iter = nacl_module_list_.begin(); |
| 2434 iter != nacl_module_list_.end(); ++iter) { | 2441 iter != nacl_module_list_.end(); ++iter) { |
| 2435 if (iter->url == url) | 2442 if (iter->url == url) |
| 2436 return iter; | 2443 return iter; |
| 2437 } | 2444 } |
| 2438 return nacl_module_list_.end(); | 2445 return nacl_module_list_.end(); |
| 2439 } | 2446 } |
| OLD | NEW |