summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--chrome/app/generated_resources.grd6
-rw-r--r--chrome/browser/about_flags.cc7
-rw-r--r--chrome/browser/chrome_content_browser_client.cc1
-rw-r--r--chrome/browser/extensions/api/guest_view/guest_view_internal_api.cc14
-rw-r--r--chrome/browser/guest_view/app_view/app_view_guest.cc34
-rw-r--r--chrome/browser/guest_view/app_view/app_view_guest.h29
-rw-r--r--chrome/browser/guest_view/guest_view_base.cc11
-rw-r--r--chrome/chrome_browser.gypi2
-rw-r--r--chrome/chrome_renderer.gypi1
-rw-r--r--chrome/common/chrome_switches.cc3
-rw-r--r--chrome/common/chrome_switches.h1
-rw-r--r--chrome/common/extensions/api/_permission_features.json4
-rw-r--r--chrome/common/extensions/permissions/chrome_api_permissions.cc2
-rw-r--r--chrome/common/extensions/permissions/permission_set_unittest.cc1
-rw-r--r--chrome/renderer/chrome_content_renderer_client.cc1
-rw-r--r--chrome/renderer/extensions/chrome_extensions_dispatcher_delegate.cc15
-rw-r--r--chrome/renderer/resources/extensions/app_view.js107
-rw-r--r--chrome/renderer/resources/extensions/app_view_deny.js39
-rw-r--r--chrome/renderer/resources/extensions/web_view.js4
-rw-r--r--chrome/renderer/resources/extensions/web_view_deny.js6
-rw-r--r--chrome/renderer/resources/renderer_resources.grd2
-rw-r--r--extensions/common/permissions/api_permission.h1
-rw-r--r--extensions/renderer/dispatcher.cc4
23 files changed, 282 insertions, 13 deletions
diff --git a/chrome/app/generated_resources.grd b/chrome/app/generated_resources.grd
index 2f6ddb58..f27244d 100644
--- a/chrome/app/generated_resources.grd
+++ b/chrome/app/generated_resources.grd
@@ -6324,6 +6324,12 @@ Keep your key file in a safe place. You will need it to create new versions of y
<message name="IDS_FLAGS_RESET_APP_LIST_INSTALL_STATE_DESCRIPTION" desc="Description of the flag to reset the app launcher install state.">
Reset the App Launcher install state on every restart. While this flag is set, Chrome will forget the launcher has been installed each time it starts. This is used for testing the App Launcher install flow.
</message>
+ <message name="IDS_FLAGS_ENABLE_APP_VIEW_NAME" desc="Name of the flag to enable the &lt;appview&gt; element.">
+ Enable the &lt;appview&gt; element in Chrome Apps.
+ </message>
+ <message name="IDS_FLAGS_ENABLE_APP_VIEW_DESCRIPTION" desc="Description of the flag to enable the &lt;appview&gt; element.">
+ This will allow the use of the experimental &lt;appview&gt; element in Chrome Apps.
+ </message>
<if expr="enable_app_list">
<message name="IDS_FLAGS_ENABLE_APP_LIST_NAME" desc="Name of the flag to enable the app launcher.">
Enable the App Launcher.
diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc
index 1f89260..a87a228 100644
--- a/chrome/browser/about_flags.cc
+++ b/chrome/browser/about_flags.cc
@@ -1500,6 +1500,13 @@ const Experiment kExperiments[] = {
},
#endif
{
+ "enable-app-view",
+ IDS_FLAGS_ENABLE_APP_VIEW_NAME,
+ IDS_FLAGS_ENABLE_APP_VIEW_DESCRIPTION,
+ kOsAll,
+ SINGLE_VALUE_TYPE(switches::kEnableAppView)
+ },
+ {
"disable-app-list-app-info",
IDS_FLAGS_DISABLE_APP_INFO_IN_APP_LIST,
IDS_FLAGS_DISABLE_APP_INFO_IN_APP_LIST_DESCRIPTION,
diff --git a/chrome/browser/chrome_content_browser_client.cc b/chrome/browser/chrome_content_browser_client.cc
index a75d2f8..ff8dd62 100644
--- a/chrome/browser/chrome_content_browser_client.cc
+++ b/chrome/browser/chrome_content_browser_client.cc
@@ -1636,6 +1636,7 @@ void ChromeContentBrowserClient::AppendExtraCommandLineSwitches(
switches::kDisableBundledPpapiFlash,
switches::kDisablePnacl,
switches::kDisableScriptedPrintThrottling,
+ switches::kEnableAppView,
switches::kEnableAppWindowControls,
switches::kEnableBenchmarking,
switches::kEnableNaCl,
diff --git a/chrome/browser/extensions/api/guest_view/guest_view_internal_api.cc b/chrome/browser/extensions/api/guest_view/guest_view_internal_api.cc
index fe098e2..ddf108d 100644
--- a/chrome/browser/extensions/api/guest_view/guest_view_internal_api.cc
+++ b/chrome/browser/extensions/api/guest_view/guest_view_internal_api.cc
@@ -13,8 +13,9 @@
#include "extensions/common/permissions/permissions_data.h"
namespace {
-const char* kWebViewPermissionRequiredError =
- "\"webview\" permission is required for allocating instance ID.";
+const char* kPermissionRequiredError =
+ "\"webview\" or \"appview\" permission is required for allocating "
+ "instance ID.";
} // namespace
namespace extensions {
@@ -30,10 +31,11 @@ bool GuestViewInternalCreateGuestFunction::RunAsync() {
base::DictionaryValue* create_params;
EXTENSION_FUNCTION_VALIDATE(args_->GetDictionary(1, &create_params));
- if (!GetExtension()->permissions_data()->HasAPIPermission(
- APIPermission::kWebView)) {
- LOG(ERROR) << kWebViewPermissionRequiredError;
- error_ = kWebViewPermissionRequiredError;
+ const PermissionsData* permissions_data = GetExtension()->permissions_data();
+ if (!permissions_data->HasAPIPermission(APIPermission::kWebView) &&
+ !permissions_data->HasAPIPermission(APIPermission::kAppView)) {
+ LOG(ERROR) << kPermissionRequiredError;
+ error_ = kPermissionRequiredError;
SendResponse(false);
}
diff --git a/chrome/browser/guest_view/app_view/app_view_guest.cc b/chrome/browser/guest_view/app_view/app_view_guest.cc
new file mode 100644
index 0000000..2eeda84
--- /dev/null
+++ b/chrome/browser/guest_view/app_view/app_view_guest.cc
@@ -0,0 +1,34 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "chrome/browser/guest_view/app_view/app_view_guest.h"
+
+// static
+const char AppViewGuest::Type[] = "appview";
+
+AppViewGuest::AppViewGuest(content::BrowserContext* browser_context,
+ int guest_instance_id)
+ : GuestView<AppViewGuest>(browser_context, guest_instance_id) {
+}
+
+AppViewGuest::~AppViewGuest() {
+}
+
+void AppViewGuest::CreateWebContents(
+ const std::string& embedder_extension_id,
+ int embedder_render_process_id,
+ const base::DictionaryValue& create_params,
+ const WebContentsCreatedCallback& callback) {
+ // TODO(fsamuel): Create a WebContents with the appropriate SiteInstance here.
+ // After the WebContents has been created, call the |callback|.
+ // callback.Run(new_web_contents);
+}
+
+void AppViewGuest::DidAttachToEmbedder() {
+ // This is called after the guest process has been attached to a host
+ // element. This means that the host element knows how to route input
+ // events to the guest, and the guest knows how to get frames to the
+ // embedder.
+ // TODO(fsamuel): Perform the initial navigation here.
+}
diff --git a/chrome/browser/guest_view/app_view/app_view_guest.h b/chrome/browser/guest_view/app_view/app_view_guest.h
new file mode 100644
index 0000000..33e0197
--- /dev/null
+++ b/chrome/browser/guest_view/app_view/app_view_guest.h
@@ -0,0 +1,29 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_BROWSER_GUEST_VIEW_APP_VIEW_APP_VIEW_GUEST_H_
+#define CHROME_BROWSER_GUEST_VIEW_APP_VIEW_APP_VIEW_GUEST_H_
+
+#include "chrome/browser/guest_view/guest_view.h"
+
+class AppViewGuest : public GuestView<AppViewGuest> {
+ public:
+ static const char Type[];
+
+ AppViewGuest(content::BrowserContext* browser_context,
+ int guest_instance_id);
+
+ // GuestViewBase implementation.
+ virtual void CreateWebContents(
+ const std::string& embedder_extension_id,
+ int embedder_render_process_id,
+ const base::DictionaryValue& create_params,
+ const WebContentsCreatedCallback& callback) OVERRIDE;
+ virtual void DidAttachToEmbedder() OVERRIDE;
+
+ private:
+ virtual ~AppViewGuest();
+};
+
+#endif // CHROME_BROWSER_GUEST_VIEW_APP_VIEW_APP_VIEW_GUEST_H_
diff --git a/chrome/browser/guest_view/guest_view_base.cc b/chrome/browser/guest_view/guest_view_base.cc
index b4b2250..2b33501 100644
--- a/chrome/browser/guest_view/guest_view_base.cc
+++ b/chrome/browser/guest_view/guest_view_base.cc
@@ -4,12 +4,15 @@
#include "chrome/browser/guest_view/guest_view_base.h"
+#include "base/command_line.h"
#include "base/lazy_instance.h"
#include "base/strings/utf_string_conversions.h"
+#include "chrome/browser/guest_view/app_view/app_view_guest.h"
#include "chrome/browser/guest_view/guest_view_constants.h"
#include "chrome/browser/guest_view/guest_view_manager.h"
#include "chrome/browser/guest_view/web_view/web_view_guest.h"
#include "chrome/browser/profiles/profile.h"
+#include "chrome/common/chrome_switches.h"
#include "chrome/common/content_settings.h"
#include "content/public/browser/render_frame_host.h"
#include "content/public/browser/render_process_host.h"
@@ -124,8 +127,14 @@ GuestViewBase* GuestViewBase::Create(
content::BrowserContext* browser_context,
int guest_instance_id,
const std::string& view_type) {
- if (view_type == "webview") {
+ if (view_type == WebViewGuest::Type) {
return new WebViewGuest(browser_context, guest_instance_id);
+ } else if (view_type == AppViewGuest::Type) {
+ if (!base::CommandLine::ForCurrentProcess()->HasSwitch(
+ switches::kEnableAppView)) {
+ return NULL;
+ }
+ return new AppViewGuest(browser_context, guest_instance_id);
}
NOTREACHED();
return NULL;
diff --git a/chrome/chrome_browser.gypi b/chrome/chrome_browser.gypi
index 2c3e700..71c102c 100644
--- a/chrome/chrome_browser.gypi
+++ b/chrome/chrome_browser.gypi
@@ -1708,6 +1708,8 @@
'browser/content_settings/content_settings_custom_extension_provider.h',
'browser/content_settings/content_settings_internal_extension_provider.cc',
'browser/content_settings/content_settings_internal_extension_provider.h',
+ 'browser/guest_view/app_view/app_view_guest.cc',
+ 'browser/guest_view/app_view/app_view_guest.h',
'browser/guest_view/guest_view_constants.cc',
'browser/guest_view/guest_view_constants.h',
'browser/guest_view/guest_view_base.cc',
diff --git a/chrome/chrome_renderer.gypi b/chrome/chrome_renderer.gypi
index a846b8c..bc811dd 100644
--- a/chrome/chrome_renderer.gypi
+++ b/chrome/chrome_renderer.gypi
@@ -81,6 +81,7 @@
'renderer/principals_extension_bindings.cc',
'renderer/principals_extension_bindings.h',
'renderer/resources/extensions/app_custom_bindings.js',
+ 'renderer/resources/extensions/app_view.js',
'renderer/resources/extensions/app_window_custom_bindings.js',
'renderer/resources/extensions/automation_custom_bindings.js',
'renderer/resources/extensions/browser_action_custom_bindings.js',
diff --git a/chrome/common/chrome_switches.cc b/chrome/common/chrome_switches.cc
index 232ad11..cbc6f33 100644
--- a/chrome/common/chrome_switches.cc
+++ b/chrome/common/chrome_switches.cc
@@ -425,6 +425,9 @@ const char kEnableAnswersInSuggest[] = "enable-answers-in-suggest";
// If set, the app list will be enabled as if enabled from CWS.
const char kEnableAppList[] = "enable-app-list";
+// Enables the <appview> tag in platform apps.
+const char kEnableAppView[] = "enable-app-view";
+
// Enables the <window-controls> tag in platform apps.
const char kEnableAppWindowControls[] = "enable-app-window-controls";
diff --git a/chrome/common/chrome_switches.h b/chrome/common/chrome_switches.h
index 59f5bdb..0d17a8b 100644
--- a/chrome/common/chrome_switches.h
+++ b/chrome/common/chrome_switches.h
@@ -125,6 +125,7 @@ extern const char kEasyUnlockAppPath[];
extern const char kEnableAccessRequestNotifications[];
extern const char kEnableAnswersInSuggest[];
extern const char kEnableAppList[];
+extern const char kEnableAppView[];
extern const char kEnableAppWindowControls[];
extern const char kEnableAppsFileAssociations[];
extern const char kEnableAppsShowOnFirstPaint[];
diff --git a/chrome/common/extensions/api/_permission_features.json b/chrome/common/extensions/api/_permission_features.json
index 440263f..64efbd3 100644
--- a/chrome/common/extensions/api/_permission_features.json
+++ b/chrome/common/extensions/api/_permission_features.json
@@ -51,6 +51,10 @@
"5107DE9024C329EEA9C9A72D94C16723790C6422" // Apps Developer Tool Dev.
]
},
+ "appview": {
+ "channel": "dev",
+ "extension_types": ["platform_app"]
+ },
"alarms": {
"channel": "stable",
"extension_types": ["extension", "legacy_packaged_app", "platform_app"],
diff --git a/chrome/common/extensions/permissions/chrome_api_permissions.cc b/chrome/common/extensions/permissions/chrome_api_permissions.cc
index 900d461..cd817d4 100644
--- a/chrome/common/extensions/permissions/chrome_api_permissions.cc
+++ b/chrome/common/extensions/permissions/chrome_api_permissions.cc
@@ -33,6 +33,8 @@ std::vector<APIPermissionInfo*> ChromeAPIPermissions::GetAllPermissions()
const {
APIPermissionInfo::InitInfo permissions_to_register[] = {
// Register permissions for all extension types.
+ {APIPermission::kAppView, "appview",
+ APIPermissionInfo::kFlagCannotBeOptional},
{APIPermission::kBackground, "background"},
{APIPermission::kClipboardRead, "clipboardRead",
APIPermissionInfo::kFlagNone, IDS_EXTENSION_PROMPT_WARNING_CLIPBOARD,
diff --git a/chrome/common/extensions/permissions/permission_set_unittest.cc b/chrome/common/extensions/permissions/permission_set_unittest.cc
index 9515ce6d..c9f2381 100644
--- a/chrome/common/extensions/permissions/permission_set_unittest.cc
+++ b/chrome/common/extensions/permissions/permission_set_unittest.cc
@@ -644,6 +644,7 @@ TEST(PermissionsTest, PermissionMessages) {
skip.insert(APIPermission::kActiveTab);
skip.insert(APIPermission::kAlarms);
skip.insert(APIPermission::kAlwaysOnTopWindows);
+ skip.insert(APIPermission::kAppView);
skip.insert(APIPermission::kAudio);
skip.insert(APIPermission::kBrowsingData);
skip.insert(APIPermission::kCastStreaming);
diff --git a/chrome/renderer/chrome_content_renderer_client.cc b/chrome/renderer/chrome_content_renderer_client.cc
index 179829f..23eb94b1 100644
--- a/chrome/renderer/chrome_content_renderer_client.cc
+++ b/chrome/renderer/chrome_content_renderer_client.cc
@@ -503,6 +503,7 @@ bool ChromeContentRendererClient::OverrideCreatePlugin(
GetExtensionByOrigin(document.securityOrigin());
if (extension) {
const extensions::APIPermission::ID perms[] = {
+ extensions::APIPermission::kAppView,
extensions::APIPermission::kWebView,
};
for (size_t i = 0; i < arraysize(perms); ++i) {
diff --git a/chrome/renderer/extensions/chrome_extensions_dispatcher_delegate.cc b/chrome/renderer/extensions/chrome_extensions_dispatcher_delegate.cc
index 08bc023..13276e2 100644
--- a/chrome/renderer/extensions/chrome_extensions_dispatcher_delegate.cc
+++ b/chrome/renderer/extensions/chrome_extensions_dispatcher_delegate.cc
@@ -235,6 +235,7 @@ void ChromeExtensionsDispatcherDelegate::PopulateSourceMap(
IDR_CHROME_DIRECT_SETTING_JS);
// Platform app sources that are not API-specific..
+ source_map->RegisterSource("appView", IDR_APP_VIEW_JS);
source_map->RegisterSource("tagWatcher", IDR_TAG_WATCHER_JS);
source_map->RegisterSource("webViewInternal",
IDR_WEB_VIEW_INTERNAL_CUSTOM_BINDINGS_JS);
@@ -246,6 +247,7 @@ void ChromeExtensionsDispatcherDelegate::PopulateSourceMap(
IDR_WEB_VIEW_EXPERIMENTAL_JS);
source_map->RegisterSource("webViewRequest",
IDR_WEB_VIEW_REQUEST_CUSTOM_BINDINGS_JS);
+ source_map->RegisterSource("denyAppView", IDR_APP_VIEW_DENY_JS);
source_map->RegisterSource("denyWebView", IDR_WEB_VIEW_DENY_JS);
source_map->RegisterSource("injectAppTitlebar", IDR_INJECT_APP_TITLEBAR_JS);
}
@@ -255,6 +257,9 @@ void ChromeExtensionsDispatcherDelegate::RequireAdditionalModules(
const extensions::Extension* extension,
extensions::Feature::Context context_type,
bool is_within_platform_app) {
+ // TODO(kalman, fsamuel): Eagerly calling Require on context startup is
+ // expensive. It would be better if there were a light way of detecting when
+ // a webview or appview is created and only then set up the infrastructure.
if (context_type == extensions::Feature::BLESSED_EXTENSION_CONTEXT &&
is_within_platform_app &&
extensions::GetCurrentChannel() <= chrome::VersionInfo::CHANNEL_DEV &&
@@ -294,6 +299,16 @@ void ChromeExtensionsDispatcherDelegate::RequireAdditionalModules(
module_system->Require("denyWebView");
}
}
+
+ if (context_type == extensions::Feature::BLESSED_EXTENSION_CONTEXT) {
+ if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kEnableAppView) &&
+ extension->permissions_data()->HasAPIPermission(
+ extensions::APIPermission::kAppView)) {
+ module_system->Require("appView");
+ } else {
+ module_system->Require("denyAppView");
+ }
+ }
}
void ChromeExtensionsDispatcherDelegate::OnActiveExtensionsUpdated(
diff --git a/chrome/renderer/resources/extensions/app_view.js b/chrome/renderer/resources/extensions/app_view.js
new file mode 100644
index 0000000..03174c6
--- /dev/null
+++ b/chrome/renderer/resources/extensions/app_view.js
@@ -0,0 +1,107 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+var DocumentNatives = requireNative('document_natives');
+var GuestViewInternal =
+ require('binding').Binding.create('guestViewInternal').generate();
+var IdGenerator = requireNative('id_generator');
+
+function AppViewInternal(appviewNode) {
+ privates(appviewNode).internal = this;
+ this.appviewNode = appviewNode;
+
+ this.browserPluginNode = this.createBrowserPluginNode();
+ var shadowRoot = this.appviewNode.createShadowRoot();
+ shadowRoot.appendChild(this.browserPluginNode);
+ this.viewInstanceId = IdGenerator.GetNextId();
+}
+
+AppViewInternal.prototype.createBrowserPluginNode = function() {
+ // We create BrowserPlugin as a custom element in order to observe changes
+ // to attributes synchronously.
+ var browserPluginNode = new AppViewInternal.BrowserPlugin();
+ privates(browserPluginNode).internal = this;
+ return browserPluginNode;
+};
+
+AppViewInternal.prototype.connect = function(src, callback) {
+ var params = {
+ };
+ var self = this;
+ GuestViewInternal.createGuest(
+ 'appview',
+ params,
+ function(instanceId) {
+ self.attachWindow(instanceId, src);
+ if (callback) {
+ callback();
+ }
+ }
+ );
+};
+
+AppViewInternal.prototype.attachWindow = function(instanceId, src) {
+ this.instanceId = instanceId;
+ var params = {
+ 'instanceId': this.viewInstanceId,
+ 'src': src
+ };
+ return this.browserPluginNode['-internal-attach'](instanceId, params);
+};
+
+function registerBrowserPluginElement() {
+ var proto = Object.create(HTMLObjectElement.prototype);
+
+ proto.createdCallback = function() {
+ this.setAttribute('type', 'application/browser-plugin');
+ this.style.width = '100%';
+ this.style.height = '100%';
+ };
+
+ proto.attachedCallback = function() {
+ // Load the plugin immediately.
+ var unused = this.nonExistentAttribute;
+ };
+
+ AppViewInternal.BrowserPlugin =
+ DocumentNatives.RegisterElement('appplugin', {extends: 'object',
+ prototype: proto});
+
+ delete proto.createdCallback;
+ delete proto.attachedCallback;
+ delete proto.detachedCallback;
+ delete proto.attributeChangedCallback;
+}
+
+function registerAppViewElement() {
+ var proto = Object.create(HTMLElement.prototype);
+
+ proto.createdCallback = function() {
+ new AppViewInternal(this);
+ };
+
+ proto.connect = function() {
+ var internal = privates(this).internal;
+ $Function.apply(internal.connect, internal, arguments);
+ }
+ window.AppView =
+ DocumentNatives.RegisterElement('appview', {prototype: proto});
+
+ // Delete the callbacks so developers cannot call them and produce unexpected
+ // behavior.
+ delete proto.createdCallback;
+ delete proto.attachedCallback;
+ delete proto.detachedCallback;
+ delete proto.attributeChangedCallback;
+}
+
+var useCapture = true;
+window.addEventListener('readystatechange', function listener(event) {
+ if (document.readyState == 'loading')
+ return;
+
+ registerBrowserPluginElement();
+ registerAppViewElement();
+ window.removeEventListener(event.type, listener, useCapture);
+}, useCapture);
diff --git a/chrome/renderer/resources/extensions/app_view_deny.js b/chrome/renderer/resources/extensions/app_view_deny.js
new file mode 100644
index 0000000..c228694
--- /dev/null
+++ b/chrome/renderer/resources/extensions/app_view_deny.js
@@ -0,0 +1,39 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+var DocumentNatives = requireNative('document_natives');
+
+// Output error message to console when using the <webview> tag with no
+// permission.
+var errorMessage = "You do not have permission to use the appview element." +
+ " Be sure to declare the 'appview' permission in your manifest file and use" +
+ " the --enable-app-view command line flag.";
+
+// Registers <webview> custom element.
+function registerAppViewElement() {
+ var proto = Object.create(HTMLElement.prototype);
+
+ proto.createdCallback = function() {
+ window.console.error(errorMessage);
+ };
+
+ window.AppView =
+ DocumentNatives.RegisterElement('appview', {prototype: proto});
+
+ // Delete the callbacks so developers cannot call them and produce unexpected
+ // behavior.
+ delete proto.createdCallback;
+ delete proto.attachedCallback;
+ delete proto.detachedCallback;
+ delete proto.attributeChangedCallback;
+}
+
+var useCapture = true;
+window.addEventListener('readystatechange', function listener(event) {
+ if (document.readyState == 'loading')
+ return;
+
+ registerAppViewElement();
+ window.removeEventListener(event.type, listener, useCapture);
+}, useCapture);
diff --git a/chrome/renderer/resources/extensions/web_view.js b/chrome/renderer/resources/extensions/web_view.js
index 58daafd..a821998 100644
--- a/chrome/renderer/resources/extensions/web_view.js
+++ b/chrome/renderer/resources/extensions/web_view.js
@@ -805,8 +805,8 @@ function registerBrowserPluginElement() {
};
WebViewInternal.BrowserPlugin =
- DocumentNatives.RegisterElement('browser-plugin', {extends: 'object',
- prototype: proto});
+ DocumentNatives.RegisterElement('browserplugin', {extends: 'object',
+ prototype: proto});
delete proto.createdCallback;
delete proto.attachedCallback;
diff --git a/chrome/renderer/resources/extensions/web_view_deny.js b/chrome/renderer/resources/extensions/web_view_deny.js
index 5c86ec9..a3e70f4 100644
--- a/chrome/renderer/resources/extensions/web_view_deny.js
+++ b/chrome/renderer/resources/extensions/web_view_deny.js
@@ -14,7 +14,7 @@ function registerWebViewElement() {
var proto = Object.create(HTMLElement.prototype);
proto.createdCallback = function() {
- console.error(errorMessage);
+ window.console.error(errorMessage);
};
window.WebView =
@@ -23,8 +23,8 @@ function registerWebViewElement() {
// Delete the callbacks so developers cannot call them and produce unexpected
// behavior.
delete proto.createdCallback;
- delete proto.enteredDocumentCallback;
- delete proto.leftDocumentCallback;
+ delete proto.attachedCallback;
+ delete proto.detachedCallback;
delete proto.attributeChangedCallback;
}
diff --git a/chrome/renderer/resources/renderer_resources.grd b/chrome/renderer/resources/renderer_resources.grd
index 2f31503..04292b3 100644
--- a/chrome/renderer/resources/renderer_resources.grd
+++ b/chrome/renderer/resources/renderer_resources.grd
@@ -31,6 +31,8 @@
<if expr="enable_extensions">
<!-- Custom bindings for extension APIs. -->
<include name="IDR_APP_CUSTOM_BINDINGS_JS" file="extensions\app_custom_bindings.js" type="BINDATA" />
+ <include name="IDR_APP_VIEW_DENY_JS" file="extensions\app_view_deny.js" type="BINDATA" />
+ <include name="IDR_APP_VIEW_JS" file="extensions\app_view.js" type="BINDATA" />
<include name="IDR_APP_WINDOW_CUSTOM_BINDINGS_JS" file="extensions\app_window_custom_bindings.js" type="BINDATA" />
<include name="IDR_AUTOMATION_CUSTOM_BINDINGS_JS" file="extensions\automation_custom_bindings.js" type="BINDATA" />
<include name="IDR_AUTOMATION_EVENT_JS" file="extensions\automation\automation_event.js" type="BINDATA" />
diff --git a/extensions/common/permissions/api_permission.h b/extensions/common/permissions/api_permission.h
index 3a04eee..5756112 100644
--- a/extensions/common/permissions/api_permission.h
+++ b/extensions/common/permissions/api_permission.h
@@ -42,6 +42,7 @@ class APIPermission {
kActivityLogPrivate,
kAlarms,
kAlwaysOnTopWindows,
+ kAppView,
kAudio,
kAudioCapture,
kAutomation,
diff --git a/extensions/renderer/dispatcher.cc b/extensions/renderer/dispatcher.cc
index 44b2fd0..647f4f4 100644
--- a/extensions/renderer/dispatcher.cc
+++ b/extensions/renderer/dispatcher.cc
@@ -830,7 +830,9 @@ void Dispatcher::UpdateOriginPermissions(
void Dispatcher::EnableCustomElementWhiteList() {
blink::WebCustomElement::addEmbedderCustomElementName("webview");
- blink::WebCustomElement::addEmbedderCustomElementName("browser-plugin");
+ blink::WebCustomElement::addEmbedderCustomElementName("appview");
+ blink::WebCustomElement::addEmbedderCustomElementName("appplugin");
+ blink::WebCustomElement::addEmbedderCustomElementName("browserplugin");
}
void Dispatcher::UpdateBindings(const std::string& extension_id) {