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 304 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
315 if (context_type == extensions::Feature::BLESSED_EXTENSION_CONTEXT) { | 315 if (context_type == extensions::Feature::BLESSED_EXTENSION_CONTEXT) { |
316 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kEnableAppView) && | 316 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kEnableAppView) && |
317 extension->permissions_data()->HasAPIPermission( | 317 extension->permissions_data()->HasAPIPermission( |
318 extensions::APIPermission::kAppView)) { | 318 extensions::APIPermission::kAppView)) { |
319 module_system->Require("appView"); | 319 module_system->Require("appView"); |
320 } else { | 320 } else { |
321 module_system->Require("denyAppView"); | 321 module_system->Require("denyAppView"); |
322 } | 322 } |
323 } | 323 } |
324 | 324 |
325 if (context_type == extensions::Feature::BLESSED_EXTENSION_CONTEXT && | 325 if (extensions::FeatureSwitch::embedded_extension_options()->IsEnabled() && |
326 extensions::FeatureSwitch::embedded_extension_options()->IsEnabled() && | 326 context->GetAvailability("extensionOptionsInternal").is_available()) { |
Fady Samuel
2014/08/07 23:09:29
Can we refer to a constant here?
ericzeng
2014/08/08 00:23:47
Yes, when this CL lands: https://codereview.chromi
ericzeng
2014/08/08 21:35:51
Actually I can't because the constants are in brow
| |
327 extension->permissions_data()->HasAPIPermission( | |
328 extensions::APIPermission::kEmbeddedExtensionOptions)) { | |
329 module_system->Require("extensionOptions"); | 327 module_system->Require("extensionOptions"); |
330 } | 328 } |
331 } | 329 } |
332 | 330 |
333 void ChromeExtensionsDispatcherDelegate::OnActiveExtensionsUpdated( | 331 void ChromeExtensionsDispatcherDelegate::OnActiveExtensionsUpdated( |
334 const std::set<std::string>& extension_ids) { | 332 const std::set<std::string>& extension_ids) { |
335 // In single-process mode, the browser process reports the active extensions. | 333 // In single-process mode, the browser process reports the active extensions. |
336 if (CommandLine::ForCurrentProcess()->HasSwitch(::switches::kSingleProcess)) | 334 if (CommandLine::ForCurrentProcess()->HasSwitch(::switches::kSingleProcess)) |
337 return; | 335 return; |
338 crash_keys::SetActiveExtensions(extension_ids); | 336 crash_keys::SetActiveExtensions(extension_ids); |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
383 new extensions::PermissionSet(extensions::APIPermissionSet(), | 381 new extensions::PermissionSet(extensions::APIPermissionSet(), |
384 extensions::ManifestPermissionSet(), | 382 extensions::ManifestPermissionSet(), |
385 origin_set, | 383 origin_set, |
386 extensions::URLPatternSet())); | 384 extensions::URLPatternSet())); |
387 } | 385 } |
388 | 386 |
389 void ChromeExtensionsDispatcherDelegate::HandleWebRequestAPIUsage( | 387 void ChromeExtensionsDispatcherDelegate::HandleWebRequestAPIUsage( |
390 bool webrequest_used) { | 388 bool webrequest_used) { |
391 webrequest_used_ = webrequest_used; | 389 webrequest_used_ = webrequest_used; |
392 } | 390 } |
OLD | NEW |