| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/renderer/extensions/chrome_extensions_dispatcher_delegate.h" | 5 #include "chrome/renderer/extensions/chrome_extensions_dispatcher_delegate.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/sha1.h" | 8 #include "base/sha1.h" |
| 9 #include "base/strings/string_number_conversions.h" | 9 #include "base/strings/string_number_conversions.h" |
| 10 #include "chrome/common/chrome_switches.h" | 10 #include "chrome/common/chrome_switches.h" |
| (...skipping 267 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 278 } | 278 } |
| 279 } | 279 } |
| 280 | 280 |
| 281 if (extensions::FeatureSwitch::app_view()->IsEnabled() && | 281 if (extensions::FeatureSwitch::app_view()->IsEnabled() && |
| 282 context->GetAvailability("appViewEmbedderInternal").is_available()) { | 282 context->GetAvailability("appViewEmbedderInternal").is_available()) { |
| 283 module_system->Require("appView"); | 283 module_system->Require("appView"); |
| 284 } else if (context_type == extensions::Feature::BLESSED_EXTENSION_CONTEXT) { | 284 } else if (context_type == extensions::Feature::BLESSED_EXTENSION_CONTEXT) { |
| 285 module_system->Require("denyAppView"); | 285 module_system->Require("denyAppView"); |
| 286 } | 286 } |
| 287 | 287 |
| 288 if (context->GetAvailability("extensionOptionsInternal").is_available()) { | 288 if (extensions::FeatureSwitch::embedded_extension_options()->IsEnabled() && |
| 289 context->GetAvailability("extensionOptionsInternal").is_available()) { |
| 289 module_system->Require("extensionOptions"); | 290 module_system->Require("extensionOptions"); |
| 290 } | 291 } |
| 291 } | 292 } |
| 292 | 293 |
| 293 void ChromeExtensionsDispatcherDelegate::OnActiveExtensionsUpdated( | 294 void ChromeExtensionsDispatcherDelegate::OnActiveExtensionsUpdated( |
| 294 const std::set<std::string>& extension_ids) { | 295 const std::set<std::string>& extension_ids) { |
| 295 // In single-process mode, the browser process reports the active extensions. | 296 // In single-process mode, the browser process reports the active extensions. |
| 296 if (CommandLine::ForCurrentProcess()->HasSwitch(::switches::kSingleProcess)) | 297 if (CommandLine::ForCurrentProcess()->HasSwitch(::switches::kSingleProcess)) |
| 297 return; | 298 return; |
| 298 crash_keys::SetActiveExtensions(extension_ids); | 299 crash_keys::SetActiveExtensions(extension_ids); |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 343 new extensions::PermissionSet(extensions::APIPermissionSet(), | 344 new extensions::PermissionSet(extensions::APIPermissionSet(), |
| 344 extensions::ManifestPermissionSet(), | 345 extensions::ManifestPermissionSet(), |
| 345 origin_set, | 346 origin_set, |
| 346 extensions::URLPatternSet())); | 347 extensions::URLPatternSet())); |
| 347 } | 348 } |
| 348 | 349 |
| 349 void ChromeExtensionsDispatcherDelegate::HandleWebRequestAPIUsage( | 350 void ChromeExtensionsDispatcherDelegate::HandleWebRequestAPIUsage( |
| 350 bool webrequest_used) { | 351 bool webrequest_used) { |
| 351 webrequest_used_ = webrequest_used; | 352 webrequest_used_ = webrequest_used; |
| 352 } | 353 } |
| OLD | NEW |