Chromium Code Reviews| 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 217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 228 source_map->RegisterSource("webstore", IDR_WEBSTORE_CUSTOM_BINDINGS_JS); | 228 source_map->RegisterSource("webstore", IDR_WEBSTORE_CUSTOM_BINDINGS_JS); |
| 229 source_map->RegisterSource("windowControls", IDR_WINDOW_CONTROLS_JS); | 229 source_map->RegisterSource("windowControls", IDR_WINDOW_CONTROLS_JS); |
| 230 | 230 |
| 231 // Custom types sources. | 231 // Custom types sources. |
| 232 source_map->RegisterSource("ChromeSetting", IDR_CHROME_SETTING_JS); | 232 source_map->RegisterSource("ChromeSetting", IDR_CHROME_SETTING_JS); |
| 233 source_map->RegisterSource("ContentSetting", IDR_CONTENT_SETTING_JS); | 233 source_map->RegisterSource("ContentSetting", IDR_CONTENT_SETTING_JS); |
| 234 source_map->RegisterSource("ChromeDirectSetting", | 234 source_map->RegisterSource("ChromeDirectSetting", |
| 235 IDR_CHROME_DIRECT_SETTING_JS); | 235 IDR_CHROME_DIRECT_SETTING_JS); |
| 236 | 236 |
| 237 // Platform app sources that are not API-specific.. | 237 // Platform app sources that are not API-specific.. |
| 238 source_map->RegisterSource("appView", IDR_APP_VIEW_JS); | |
| 238 source_map->RegisterSource("tagWatcher", IDR_TAG_WATCHER_JS); | 239 source_map->RegisterSource("tagWatcher", IDR_TAG_WATCHER_JS); |
| 239 source_map->RegisterSource("webViewInternal", | 240 source_map->RegisterSource("webViewInternal", |
| 240 IDR_WEB_VIEW_INTERNAL_CUSTOM_BINDINGS_JS); | 241 IDR_WEB_VIEW_INTERNAL_CUSTOM_BINDINGS_JS); |
| 241 // Note: webView not webview so that this doesn't interfere with the | 242 // Note: webView not webview so that this doesn't interfere with the |
| 242 // chrome.webview API bindings. | 243 // chrome.webview API bindings. |
| 243 source_map->RegisterSource("webView", IDR_WEB_VIEW_JS); | 244 source_map->RegisterSource("webView", IDR_WEB_VIEW_JS); |
| 244 source_map->RegisterSource("webViewEvents", IDR_WEB_VIEW_EVENTS_JS); | 245 source_map->RegisterSource("webViewEvents", IDR_WEB_VIEW_EVENTS_JS); |
| 245 source_map->RegisterSource("webViewExperimental", | 246 source_map->RegisterSource("webViewExperimental", |
| 246 IDR_WEB_VIEW_EXPERIMENTAL_JS); | 247 IDR_WEB_VIEW_EXPERIMENTAL_JS); |
| 247 source_map->RegisterSource("webViewRequest", | 248 source_map->RegisterSource("webViewRequest", |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 287 hexencoded_id_hash == "E703483CEF33DEC18B4B6DD84B5C776FB9182BDB" || | 288 hexencoded_id_hash == "E703483CEF33DEC18B4B6DD84B5C776FB9182BDB" || |
| 288 hexencoded_id_hash == "1A26E32DE447A17CBE5E9750CDBA78F58539B39C" || | 289 hexencoded_id_hash == "1A26E32DE447A17CBE5E9750CDBA78F58539B39C" || |
| 289 hexencoded_id_hash == "59048028102D7B4C681DBC7BC6CD980C3DC66DA3") { | 290 hexencoded_id_hash == "59048028102D7B4C681DBC7BC6CD980C3DC66DA3") { |
| 290 module_system->Require("webViewExperimental"); | 291 module_system->Require("webViewExperimental"); |
| 291 } | 292 } |
| 292 } | 293 } |
| 293 } else { | 294 } else { |
| 294 module_system->Require("denyWebView"); | 295 module_system->Require("denyWebView"); |
| 295 } | 296 } |
| 296 } | 297 } |
| 298 | |
| 299 if (context_type == extensions::Feature::BLESSED_EXTENSION_CONTEXT) { | |
| 300 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kEnableAppView) && | |
| 301 extension->permissions_data()->HasAPIPermission( | |
| 302 extensions::APIPermission::kAppView)) { | |
| 303 module_system->Require("appView"); | |
| 304 } | |
|
not at google - send to devlin
2014/06/27 17:32:19
questions:
- why is this different logic to webvie
Fady Samuel
2014/06/27 18:14:31
1. <webview> will work in unblessed contexts in th
not at google - send to devlin
2014/06/27 18:16:17
So the "unblessed" isn't needed yet? can we take t
| |
| 305 } | |
| 297 } | 306 } |
| 298 | 307 |
| 299 void ChromeExtensionsDispatcherDelegate::OnActiveExtensionsUpdated( | 308 void ChromeExtensionsDispatcherDelegate::OnActiveExtensionsUpdated( |
| 300 const std::set<std::string>& extension_ids) { | 309 const std::set<std::string>& extension_ids) { |
| 301 // In single-process mode, the browser process reports the active extensions. | 310 // In single-process mode, the browser process reports the active extensions. |
| 302 if (CommandLine::ForCurrentProcess()->HasSwitch(::switches::kSingleProcess)) | 311 if (CommandLine::ForCurrentProcess()->HasSwitch(::switches::kSingleProcess)) |
| 303 return; | 312 return; |
| 304 crash_keys::SetActiveExtensions(extension_ids); | 313 crash_keys::SetActiveExtensions(extension_ids); |
| 305 } | 314 } |
| 306 | 315 |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 348 new extensions::PermissionSet(extensions::APIPermissionSet(), | 357 new extensions::PermissionSet(extensions::APIPermissionSet(), |
| 349 extensions::ManifestPermissionSet(), | 358 extensions::ManifestPermissionSet(), |
| 350 origin_set, | 359 origin_set, |
| 351 extensions::URLPatternSet())); | 360 extensions::URLPatternSet())); |
| 352 } | 361 } |
| 353 | 362 |
| 354 void ChromeExtensionsDispatcherDelegate::HandleWebRequestAPIUsage( | 363 void ChromeExtensionsDispatcherDelegate::HandleWebRequestAPIUsage( |
| 355 bool webrequest_used) { | 364 bool webrequest_used) { |
| 356 webrequest_used_ = webrequest_used; | 365 webrequest_used_ = webrequest_used; |
| 357 } | 366 } |
| OLD | NEW |