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 1995 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2006 for (size_t i = 0; i < extensions_.size(); ++i) { | 2006 for (size_t i = 0; i < extensions_.size(); ++i) { |
2007 if (!extensions_[i]->is_theme() && | 2007 if (!extensions_[i]->is_theme() && |
2008 extensions_[i]->location() != Extension::COMPONENT) | 2008 extensions_[i]->location() != Extension::COMPONENT) |
2009 extension_ids.insert(extensions_[i]->id()); | 2009 extension_ids.insert(extensions_[i]->id()); |
2010 } | 2010 } |
2011 | 2011 |
2012 child_process_logging::SetActiveExtensions(extension_ids); | 2012 child_process_logging::SetActiveExtensions(extension_ids); |
2013 } | 2013 } |
2014 | 2014 |
2015 void ExtensionService::OnExtensionInstalled( | 2015 void ExtensionService::OnExtensionInstalled( |
2016 const Extension* extension, bool from_webstore, int page_index) { | 2016 const Extension* extension, bool from_webstore, StringOrdinal page_index) { |
2017 CHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 2017 CHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
2018 | 2018 |
2019 // Ensure extension is deleted unless we transfer ownership. | 2019 // Ensure extension is deleted unless we transfer ownership. |
2020 scoped_refptr<const Extension> scoped_extension(extension); | 2020 scoped_refptr<const Extension> scoped_extension(extension); |
2021 const std::string& id = extension->id(); | 2021 const std::string& id = extension->id(); |
2022 // Extensions installed by policy can't be disabled. So even if a previous | 2022 // Extensions installed by policy can't be disabled. So even if a previous |
2023 // installation disabled the extension, make sure it is now enabled. | 2023 // installation disabled the extension, make sure it is now enabled. |
2024 bool initial_enable = | 2024 bool initial_enable = |
2025 !extension_prefs_->IsExtensionDisabled(id) || | 2025 !extension_prefs_->IsExtensionDisabled(id) || |
2026 !Extension::UserMayDisable(extension->location()); | 2026 !Extension::UserMayDisable(extension->location()); |
(...skipping 471 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2498 | 2498 |
2499 ExtensionService::NaClModuleInfoList::iterator | 2499 ExtensionService::NaClModuleInfoList::iterator |
2500 ExtensionService::FindNaClModule(const GURL& url) { | 2500 ExtensionService::FindNaClModule(const GURL& url) { |
2501 for (NaClModuleInfoList::iterator iter = nacl_module_list_.begin(); | 2501 for (NaClModuleInfoList::iterator iter = nacl_module_list_.begin(); |
2502 iter != nacl_module_list_.end(); ++iter) { | 2502 iter != nacl_module_list_.end(); ++iter) { |
2503 if (iter->url == url) | 2503 if (iter->url == url) |
2504 return iter; | 2504 return iter; |
2505 } | 2505 } |
2506 return nacl_module_list_.end(); | 2506 return nacl_module_list_.end(); |
2507 } | 2507 } |
OLD | NEW |