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 2113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2124 const Extension* extension = *iter; | 2124 const Extension* extension = *iter; |
2125 if (!extension->is_theme() && extension->location() != Extension::COMPONENT) | 2125 if (!extension->is_theme() && extension->location() != Extension::COMPONENT) |
2126 extension_ids.insert(extension->id()); | 2126 extension_ids.insert(extension->id()); |
2127 } | 2127 } |
2128 | 2128 |
2129 child_process_logging::SetActiveExtensions(extension_ids); | 2129 child_process_logging::SetActiveExtensions(extension_ids); |
2130 } | 2130 } |
2131 | 2131 |
2132 void ExtensionService::OnExtensionInstalled( | 2132 void ExtensionService::OnExtensionInstalled( |
2133 const Extension* extension, | 2133 const Extension* extension, |
2134 bool from_webstore, | |
2135 const syncer::StringOrdinal& page_ordinal, | 2134 const syncer::StringOrdinal& page_ordinal, |
2136 bool has_requirement_errors) { | 2135 bool has_requirement_errors) { |
2137 CHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 2136 CHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
2138 | 2137 |
2139 // Ensure extension is deleted unless we transfer ownership. | 2138 // Ensure extension is deleted unless we transfer ownership. |
2140 scoped_refptr<const Extension> scoped_extension(extension); | 2139 scoped_refptr<const Extension> scoped_extension(extension); |
2141 const std::string& id = extension->id(); | 2140 const std::string& id = extension->id(); |
2142 // Extensions installed by policy can't be disabled. So even if a previous | 2141 // Extensions installed by policy can't be disabled. So even if a previous |
2143 // installation disabled the extension, make sure it is now enabled. | 2142 // installation disabled the extension, make sure it is now enabled. |
2144 bool initial_enable = | 2143 bool initial_enable = |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2204 } | 2203 } |
2205 | 2204 |
2206 // Certain extension locations are specific enough that we can | 2205 // Certain extension locations are specific enough that we can |
2207 // auto-acknowledge any extension that came from one of them. | 2206 // auto-acknowledge any extension that came from one of them. |
2208 if (extension->location() == Extension::EXTERNAL_POLICY_DOWNLOAD) | 2207 if (extension->location() == Extension::EXTERNAL_POLICY_DOWNLOAD) |
2209 AcknowledgeExternalExtension(extension->id()); | 2208 AcknowledgeExternalExtension(extension->id()); |
2210 | 2209 |
2211 extension_prefs_->OnExtensionInstalled( | 2210 extension_prefs_->OnExtensionInstalled( |
2212 extension, | 2211 extension, |
2213 initial_enable ? Extension::ENABLED : Extension::DISABLED, | 2212 initial_enable ? Extension::ENABLED : Extension::DISABLED, |
2214 from_webstore, | |
2215 page_ordinal); | 2213 page_ordinal); |
2216 | 2214 |
2217 // Unpacked extensions default to allowing file access, but if that has been | 2215 // Unpacked extensions default to allowing file access, but if that has been |
2218 // overridden, don't reset the value. | 2216 // overridden, don't reset the value. |
2219 if (Extension::ShouldAlwaysAllowFileAccess(extension->location()) && | 2217 if (Extension::ShouldAlwaysAllowFileAccess(extension->location()) && |
2220 !extension_prefs_->HasAllowFileAccessSetting(id)) { | 2218 !extension_prefs_->HasAllowFileAccessSetting(id)) { |
2221 extension_prefs_->SetAllowFileAccess(id, true); | 2219 extension_prefs_->SetAllowFileAccess(id, true); |
2222 } | 2220 } |
2223 | 2221 |
2224 content::NotificationService::current()->Notify( | 2222 content::NotificationService::current()->Notify( |
(...skipping 440 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2665 extension_host->extension(), | 2663 extension_host->extension(), |
2666 NULL, FilePath()); | 2664 NULL, FilePath()); |
2667 #endif | 2665 #endif |
2668 } | 2666 } |
2669 | 2667 |
2670 void ExtensionService::InspectExtensionHost( | 2668 void ExtensionService::InspectExtensionHost( |
2671 extensions::ExtensionHost* host) { | 2669 extensions::ExtensionHost* host) { |
2672 if (host) | 2670 if (host) |
2673 DevToolsWindow::OpenDevToolsWindow(host->render_view_host()); | 2671 DevToolsWindow::OpenDevToolsWindow(host->render_view_host()); |
2674 } | 2672 } |
OLD | NEW |