Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(199)

Side by Side Diff: chrome/renderer/resources/extensions/web_view_experimental.js

Issue 307543005: Fix the Declarative WebRequest API for <webview> (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@move_webcontentsdelegate_impl_to_chrome
Patch Set: Addressed remainder of comments Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 // This module implements experimental API for <webview>. 5 // This module implements experimental API for <webview>.
6 // See web_view.js for details. 6 // See web_view.js for details.
7 // 7 //
8 // <webview> Experimental API is only available on canary and dev channels of 8 // <webview> Experimental API is only available on canary and dev channels of
9 // Chrome. 9 // Chrome.
10 10
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
115 115
116 WebViewContextMenusImpl.prototype.update = function() { 116 WebViewContextMenusImpl.prototype.update = function() {
117 var args = $Array.concat([this.viewInstanceId_], $Array.slice(arguments)); 117 var args = $Array.concat([this.viewInstanceId_], $Array.slice(arguments));
118 return $Function.apply(WebView.contextMenusUpdate, null, args); 118 return $Function.apply(WebView.contextMenusUpdate, null, args);
119 }; 119 };
120 120
121 var WebViewContextMenus = utils.expose( 121 var WebViewContextMenus = utils.expose(
122 'WebViewContextMenus', WebViewContextMenusImpl, 122 'WebViewContextMenus', WebViewContextMenusImpl,
123 { functions: ['create', 'remove', 'removeAll', 'update'] }); 123 { functions: ['create', 'remove', 'removeAll', 'update'] });
124 124
125 /**
126 * @private
127 */
128 WebViewInternal.prototype.maybeAttachWebRequestEventToObject =
129 function(obj, eventName, webRequestEvent) {
130 Object.defineProperty(
131 obj,
132 eventName,
133 {
134 get: webRequestEvent,
135 enumerable: true
136 }
137 );
138 };
139
140 /** @private */ 125 /** @private */
141 WebViewInternal.prototype.maybeHandleContextMenu = function(e, webViewEvent) { 126 WebViewInternal.prototype.maybeHandleContextMenu = function(e, webViewEvent) {
142 var requestId = e.requestId; 127 var requestId = e.requestId;
143 var self = this; 128 var self = this;
144 // Construct the event.menu object. 129 // Construct the event.menu object.
145 var actionTaken = false; 130 var actionTaken = false;
146 var validateCall = function() { 131 var validateCall = function() {
147 var ERROR_MSG_CONTEXT_MENU_ACTION_ALREADY_TAKEN = '<webview>: ' + 132 var ERROR_MSG_CONTEXT_MENU_ACTION_ALREADY_TAKEN = '<webview>: ' +
148 'An action has already been taken for this "contextmenu" event.'; 133 'An action has already been taken for this "contextmenu" event.';
149 134
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after
297 282
298 // Expose <webview>.contextMenus object. 283 // Expose <webview>.contextMenus object.
299 Object.defineProperty( 284 Object.defineProperty(
300 this.webviewNode, 285 this.webviewNode,
301 'contextMenus', 286 'contextMenus',
302 { 287 {
303 get: createContextMenus(), 288 get: createContextMenus(),
304 enumerable: true 289 enumerable: true
305 }); 290 });
306 }; 291 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698