| 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 561 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 572 return false; | 572 return false; |
| 573 } | 573 } |
| 574 | 574 |
| 575 return true; | 575 return true; |
| 576 } | 576 } |
| 577 | 577 |
| 578 ExtensionService::ExtensionService(Profile* profile, | 578 ExtensionService::ExtensionService(Profile* profile, |
| 579 const CommandLine* command_line, | 579 const CommandLine* command_line, |
| 580 const FilePath& install_directory, | 580 const FilePath& install_directory, |
| 581 ExtensionPrefs* extension_prefs, | 581 ExtensionPrefs* extension_prefs, |
| 582 ExtensionSettings* extension_settings, | |
| 583 bool autoupdate_enabled, | 582 bool autoupdate_enabled, |
| 584 bool extensions_enabled) | 583 bool extensions_enabled) |
| 585 : weak_ptr_factory_(ALLOW_THIS_IN_INITIALIZER_LIST(this)), | 584 : weak_ptr_factory_(ALLOW_THIS_IN_INITIALIZER_LIST(this)), |
| 586 method_factory_(ALLOW_THIS_IN_INITIALIZER_LIST(this)), | 585 method_factory_(ALLOW_THIS_IN_INITIALIZER_LIST(this)), |
| 587 profile_(profile), | 586 profile_(profile), |
| 588 extension_prefs_(extension_prefs), | 587 extension_prefs_(extension_prefs), |
| 589 extension_settings_(extension_settings), | |
| 590 pending_extension_manager_(*ALLOW_THIS_IN_INITIALIZER_LIST(this)), | 588 pending_extension_manager_(*ALLOW_THIS_IN_INITIALIZER_LIST(this)), |
| 591 install_directory_(install_directory), | 589 install_directory_(install_directory), |
| 592 extensions_enabled_(extensions_enabled), | 590 extensions_enabled_(extensions_enabled), |
| 593 show_extensions_prompts_(true), | 591 show_extensions_prompts_(true), |
| 594 ready_(false), | 592 ready_(false), |
| 595 toolbar_model_(ALLOW_THIS_IN_INITIALIZER_LIST(this)), | 593 toolbar_model_(ALLOW_THIS_IN_INITIALIZER_LIST(this)), |
| 596 permissions_manager_(ALLOW_THIS_IN_INITIALIZER_LIST(this)), | 594 permissions_manager_(ALLOW_THIS_IN_INITIALIZER_LIST(this)), |
| 597 apps_promo_(profile->GetPrefs()), | 595 apps_promo_(profile->GetPrefs()), |
| 598 event_routers_initialized_(false) { | 596 event_routers_initialized_(false) { |
| 599 CHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 597 CHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| (...skipping 27 matching lines...) Expand all Loading... |
| 627 extension_prefs, | 625 extension_prefs, |
| 628 profile->GetPrefs(), | 626 profile->GetPrefs(), |
| 629 profile, | 627 profile, |
| 630 update_frequency)); | 628 update_frequency)); |
| 631 } | 629 } |
| 632 | 630 |
| 633 backend_ = | 631 backend_ = |
| 634 new ExtensionServiceBackend(weak_ptr_factory_.GetWeakPtr(), | 632 new ExtensionServiceBackend(weak_ptr_factory_.GetWeakPtr(), |
| 635 install_directory_); | 633 install_directory_); |
| 636 | 634 |
| 635 extension_settings_.reset( |
| 636 new ExtensionSettingsUIWrapper( |
| 637 profile_->GetPath().AppendASCII(kSettingsDirectoryName))); |
| 638 |
| 637 if (extensions_enabled_) { | 639 if (extensions_enabled_) { |
| 638 ExternalExtensionProviderImpl::CreateExternalProviders( | 640 ExternalExtensionProviderImpl::CreateExternalProviders( |
| 639 this, profile_, &external_extension_providers_); | 641 this, profile_, &external_extension_providers_); |
| 640 } | 642 } |
| 641 | 643 |
| 642 // Use monochrome icons for Omnibox icons. | 644 // Use monochrome icons for Omnibox icons. |
| 643 omnibox_popup_icon_manager_.set_monochrome(true); | 645 omnibox_popup_icon_manager_.set_monochrome(true); |
| 644 omnibox_icon_manager_.set_monochrome(true); | 646 omnibox_icon_manager_.set_monochrome(true); |
| 645 omnibox_icon_manager_.set_padding(gfx::Insets(0, kOmniboxIconPaddingLeft, | 647 omnibox_icon_manager_.set_padding(gfx::Insets(0, kOmniboxIconPaddingLeft, |
| 646 0, kOmniboxIconPaddingRight)); | 648 0, kOmniboxIconPaddingRight)); |
| (...skipping 999 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1646 } | 1648 } |
| 1647 | 1649 |
| 1648 Profile* ExtensionService::profile() { | 1650 Profile* ExtensionService::profile() { |
| 1649 return profile_; | 1651 return profile_; |
| 1650 } | 1652 } |
| 1651 | 1653 |
| 1652 ExtensionPrefs* ExtensionService::extension_prefs() { | 1654 ExtensionPrefs* ExtensionService::extension_prefs() { |
| 1653 return extension_prefs_; | 1655 return extension_prefs_; |
| 1654 } | 1656 } |
| 1655 | 1657 |
| 1656 ExtensionSettings* ExtensionService::extension_settings() { | 1658 ExtensionSettingsUIWrapper* ExtensionService::extension_settings() { |
| 1657 return extension_settings_; | 1659 return extension_settings_.get(); |
| 1658 } | 1660 } |
| 1659 | 1661 |
| 1660 ExtensionContentSettingsStore* | 1662 ExtensionContentSettingsStore* |
| 1661 ExtensionService::GetExtensionContentSettingsStore() { | 1663 ExtensionService::GetExtensionContentSettingsStore() { |
| 1662 return extension_prefs()->content_settings_store(); | 1664 return extension_prefs()->content_settings_store(); |
| 1663 } | 1665 } |
| 1664 | 1666 |
| 1665 ExtensionUpdater* ExtensionService::updater() { | 1667 ExtensionUpdater* ExtensionService::updater() { |
| 1666 return updater_.get(); | 1668 return updater_.get(); |
| 1667 } | 1669 } |
| (...skipping 1203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2871 | 2873 |
| 2872 ExtensionService::NaClModuleInfoList::iterator | 2874 ExtensionService::NaClModuleInfoList::iterator |
| 2873 ExtensionService::FindNaClModule(const GURL& url) { | 2875 ExtensionService::FindNaClModule(const GURL& url) { |
| 2874 for (NaClModuleInfoList::iterator iter = nacl_module_list_.begin(); | 2876 for (NaClModuleInfoList::iterator iter = nacl_module_list_.begin(); |
| 2875 iter != nacl_module_list_.end(); ++iter) { | 2877 iter != nacl_module_list_.end(); ++iter) { |
| 2876 if (iter->url == url) | 2878 if (iter->url == url) |
| 2877 return iter; | 2879 return iter; |
| 2878 } | 2880 } |
| 2879 return nacl_module_list_.end(); | 2881 return nacl_module_list_.end(); |
| 2880 } | 2882 } |
| OLD | NEW |