| 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 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 216 ExtensionService::NaClModuleInfo::NaClModuleInfo() { | 216 ExtensionService::NaClModuleInfo::NaClModuleInfo() { |
| 217 } | 217 } |
| 218 | 218 |
| 219 ExtensionService::NaClModuleInfo::~NaClModuleInfo() { | 219 ExtensionService::NaClModuleInfo::~NaClModuleInfo() { |
| 220 } | 220 } |
| 221 | 221 |
| 222 // ExtensionService. | 222 // ExtensionService. |
| 223 | 223 |
| 224 const char* ExtensionService::kInstallDirectoryName = "Extensions"; | 224 const char* ExtensionService::kInstallDirectoryName = "Extensions"; |
| 225 const char* ExtensionService::kCurrentVersionFileName = "Current Version"; | 225 const char* ExtensionService::kCurrentVersionFileName = "Current Version"; |
| 226 const char* ExtensionService::kSettingsDirectoryName = "Extension Settings"; |
| 226 | 227 |
| 227 // Implements IO for the ExtensionService. | 228 // Implements IO for the ExtensionService. |
| 228 | 229 |
| 229 class ExtensionServiceBackend | 230 class ExtensionServiceBackend |
| 230 : public base::RefCountedThreadSafe<ExtensionServiceBackend> { | 231 : public base::RefCountedThreadSafe<ExtensionServiceBackend> { |
| 231 public: | 232 public: |
| 232 // |install_directory| is a path where to look for extensions to load. | 233 // |install_directory| is a path where to look for extensions to load. |
| 233 ExtensionServiceBackend( | 234 ExtensionServiceBackend( |
| 234 base::WeakPtr<ExtensionService> frontend, | 235 base::WeakPtr<ExtensionService> frontend, |
| 235 const FilePath& install_directory); | 236 const FilePath& install_directory); |
| (...skipping 300 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 536 return false; | 537 return false; |
| 537 } | 538 } |
| 538 | 539 |
| 539 return true; | 540 return true; |
| 540 } | 541 } |
| 541 | 542 |
| 542 ExtensionService::ExtensionService(Profile* profile, | 543 ExtensionService::ExtensionService(Profile* profile, |
| 543 const CommandLine* command_line, | 544 const CommandLine* command_line, |
| 544 const FilePath& install_directory, | 545 const FilePath& install_directory, |
| 545 ExtensionPrefs* extension_prefs, | 546 ExtensionPrefs* extension_prefs, |
| 547 ExtensionSettings* extension_settings, |
| 546 bool autoupdate_enabled, | 548 bool autoupdate_enabled, |
| 547 bool extensions_enabled) | 549 bool extensions_enabled) |
| 548 : weak_ptr_factory_(ALLOW_THIS_IN_INITIALIZER_LIST(this)), | 550 : weak_ptr_factory_(ALLOW_THIS_IN_INITIALIZER_LIST(this)), |
| 549 method_factory_(ALLOW_THIS_IN_INITIALIZER_LIST(this)), | 551 method_factory_(ALLOW_THIS_IN_INITIALIZER_LIST(this)), |
| 550 profile_(profile), | 552 profile_(profile), |
| 551 extension_prefs_(extension_prefs), | 553 extension_prefs_(extension_prefs), |
| 554 extension_settings_(extension_settings), |
| 552 pending_extension_manager_(*ALLOW_THIS_IN_INITIALIZER_LIST(this)), | 555 pending_extension_manager_(*ALLOW_THIS_IN_INITIALIZER_LIST(this)), |
| 553 install_directory_(install_directory), | 556 install_directory_(install_directory), |
| 554 extensions_enabled_(extensions_enabled), | 557 extensions_enabled_(extensions_enabled), |
| 555 show_extensions_prompts_(true), | 558 show_extensions_prompts_(true), |
| 556 ready_(false), | 559 ready_(false), |
| 557 toolbar_model_(ALLOW_THIS_IN_INITIALIZER_LIST(this)), | 560 toolbar_model_(ALLOW_THIS_IN_INITIALIZER_LIST(this)), |
| 558 permissions_manager_(ALLOW_THIS_IN_INITIALIZER_LIST(this)), | 561 permissions_manager_(ALLOW_THIS_IN_INITIALIZER_LIST(this)), |
| 559 apps_promo_(profile->GetPrefs()), | 562 apps_promo_(profile->GetPrefs()), |
| 560 event_routers_initialized_(false) { | 563 event_routers_initialized_(false) { |
| 561 CHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 564 CHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| (...skipping 1004 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1566 } | 1569 } |
| 1567 | 1570 |
| 1568 Profile* ExtensionService::profile() { | 1571 Profile* ExtensionService::profile() { |
| 1569 return profile_; | 1572 return profile_; |
| 1570 } | 1573 } |
| 1571 | 1574 |
| 1572 ExtensionPrefs* ExtensionService::extension_prefs() { | 1575 ExtensionPrefs* ExtensionService::extension_prefs() { |
| 1573 return extension_prefs_; | 1576 return extension_prefs_; |
| 1574 } | 1577 } |
| 1575 | 1578 |
| 1579 ExtensionSettings* ExtensionService::extension_settings() { |
| 1580 return extension_settings_; |
| 1581 } |
| 1582 |
| 1576 ExtensionContentSettingsStore* | 1583 ExtensionContentSettingsStore* |
| 1577 ExtensionService::GetExtensionContentSettingsStore() { | 1584 ExtensionService::GetExtensionContentSettingsStore() { |
| 1578 return extension_prefs()->content_settings_store(); | 1585 return extension_prefs()->content_settings_store(); |
| 1579 } | 1586 } |
| 1580 | 1587 |
| 1581 ExtensionUpdater* ExtensionService::updater() { | 1588 ExtensionUpdater* ExtensionService::updater() { |
| 1582 return updater_.get(); | 1589 return updater_.get(); |
| 1583 } | 1590 } |
| 1584 | 1591 |
| 1585 void ExtensionService::CheckAdminBlacklist() { | 1592 void ExtensionService::CheckAdminBlacklist() { |
| (...skipping 995 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2581 | 2588 |
| 2582 ExtensionService::NaClModuleInfoList::iterator | 2589 ExtensionService::NaClModuleInfoList::iterator |
| 2583 ExtensionService::FindNaClModule(const GURL& url) { | 2590 ExtensionService::FindNaClModule(const GURL& url) { |
| 2584 for (NaClModuleInfoList::iterator iter = nacl_module_list_.begin(); | 2591 for (NaClModuleInfoList::iterator iter = nacl_module_list_.begin(); |
| 2585 iter != nacl_module_list_.end(); ++iter) { | 2592 iter != nacl_module_list_.end(); ++iter) { |
| 2586 if (iter->url == url) | 2593 if (iter->url == url) |
| 2587 return iter; | 2594 return iter; |
| 2588 } | 2595 } |
| 2589 return nacl_module_list_.end(); | 2596 return nacl_module_list_.end(); |
| 2590 } | 2597 } |
| OLD | NEW |