| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 1899 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1910 void ExtensionService::AddExtension(const Extension* extension) { | 1910 void ExtensionService::AddExtension(const Extension* extension) { |
| 1911 // Ensure extension is deleted unless we transfer ownership. | 1911 // Ensure extension is deleted unless we transfer ownership. |
| 1912 scoped_refptr<const Extension> scoped_extension(extension); | 1912 scoped_refptr<const Extension> scoped_extension(extension); |
| 1913 | 1913 |
| 1914 // TODO(jstritar): We may be able to get rid of this branch by overriding the | 1914 // TODO(jstritar): We may be able to get rid of this branch by overriding the |
| 1915 // default extension state to DISABLED when the --disable-extensions flag | 1915 // default extension state to DISABLED when the --disable-extensions flag |
| 1916 // is set (http://crbug.com/29067). | 1916 // is set (http://crbug.com/29067). |
| 1917 if (!extensions_enabled() && | 1917 if (!extensions_enabled() && |
| 1918 !extension->is_theme() && | 1918 !extension->is_theme() && |
| 1919 extension->location() != Extension::COMPONENT && | 1919 extension->location() != Extension::COMPONENT && |
| 1920 !Extension::IsExternalLocation(extension->location())) | 1920 !Extension::IsExternalLocation(extension->location())) { |
| 1921 return; | 1921 return; |
| 1922 } |
| 1922 | 1923 |
| 1923 SetBeingUpgraded(extension, false); | 1924 SetBeingUpgraded(extension, false); |
| 1924 | 1925 |
| 1925 // The extension is now loaded, remove its data from unloaded extension map. | 1926 // The extension is now loaded, remove its data from unloaded extension map. |
| 1926 unloaded_extension_paths_.erase(extension->id()); | 1927 unloaded_extension_paths_.erase(extension->id()); |
| 1927 | 1928 |
| 1928 // If a terminated extension is loaded, remove it from the terminated list. | 1929 // If a terminated extension is loaded, remove it from the terminated list. |
| 1929 UntrackTerminatedExtension(extension->id()); | 1930 UntrackTerminatedExtension(extension->id()); |
| 1930 | 1931 |
| 1931 // If the extension was disabled for a reload, then enable it. | 1932 // If the extension was disabled for a reload, then enable it. |
| (...skipping 620 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2552 | 2553 |
| 2553 ExtensionService::NaClModuleInfoList::iterator | 2554 ExtensionService::NaClModuleInfoList::iterator |
| 2554 ExtensionService::FindNaClModule(const GURL& url) { | 2555 ExtensionService::FindNaClModule(const GURL& url) { |
| 2555 for (NaClModuleInfoList::iterator iter = nacl_module_list_.begin(); | 2556 for (NaClModuleInfoList::iterator iter = nacl_module_list_.begin(); |
| 2556 iter != nacl_module_list_.end(); ++iter) { | 2557 iter != nacl_module_list_.end(); ++iter) { |
| 2557 if (iter->url == url) | 2558 if (iter->url == url) |
| 2558 return iter; | 2559 return iter; |
| 2559 } | 2560 } |
| 2560 return nacl_module_list_.end(); | 2561 return nacl_module_list_.end(); |
| 2561 } | 2562 } |
| OLD | NEW |