OLD | NEW |
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 // Shim extension to provide permission request API (and possibly other future | 5 // Shim extension to provide permission request API (and possibly other future |
6 // experimental APIs) for <webview> tag. | 6 // experimental APIs) for <webview> tag. |
7 // See web_view.js for details. | 7 // See web_view.js for details. |
8 // | 8 // |
9 // We want to control the permission API feature in <webview> separately from | 9 // We want to control the permission API feature in <webview> separately from |
10 // the <webview> feature itself. <webview> is available in stable channel, but | 10 // the <webview> feature itself. <webview> is available in stable channel, but |
11 // permission API would only be available for channels CHANNEL_DEV and | 11 // permission API would only be available for channels CHANNEL_DEV and |
12 // CHANNEL_CANARY. | 12 // CHANNEL_CANARY. |
13 | 13 |
14 var CreateEvent = require('webView').CreateEvent; | 14 var CreateEvent = require('webView').CreateEvent; |
15 var MessagingNatives = requireNative('messaging_natives'); | 15 var MessagingNatives = requireNative('messaging_natives'); |
16 var WebRequestEvent = require('webRequestInternal').WebRequestEvent; | |
17 var WebRequestSchema = | |
18 requireNative('schema_registry').GetSchema('webRequest'); | |
19 var WebViewInternal = require('webView').WebViewInternal; | 16 var WebViewInternal = require('webView').WebViewInternal; |
20 var WebView = require('webView').WebView; | 17 var WebView = require('webView').WebView; |
21 | 18 |
22 var WEB_VIEW_EXPERIMENTAL_EVENTS = { | 19 var WEB_VIEW_EXPERIMENTAL_EVENTS = { |
23 'dialog': { | 20 'dialog': { |
24 cancelable: true, | 21 cancelable: true, |
25 customHandler: function(webViewInternal, event, webViewEvent) { | 22 customHandler: function(webViewInternal, event, webViewEvent) { |
26 webViewInternal.handleDialogEvent_(event, webViewEvent); | 23 webViewInternal.handleDialogEvent_(event, webViewEvent); |
27 }, | 24 }, |
28 evt: CreateEvent('webview.onDialog'), | 25 evt: CreateEvent('webview.onDialog'), |
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
174 }; | 171 }; |
175 | 172 |
176 proto.isUserAgentOverridden = function() { | 173 proto.isUserAgentOverridden = function() { |
177 return this.internal_(secret).isUserAgentOverridden_(); | 174 return this.internal_(secret).isUserAgentOverridden_(); |
178 }; | 175 }; |
179 | 176 |
180 proto.setUserAgentOverride = function(userAgentOverride) { | 177 proto.setUserAgentOverride = function(userAgentOverride) { |
181 this.internal_(secret).setUserAgentOverride_(userAgentOverride); | 178 this.internal_(secret).setUserAgentOverride_(userAgentOverride); |
182 }; | 179 }; |
183 }; | 180 }; |
OLD | NEW |