| 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 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 44 #include "third_party/WebKit/public/web/WebDocument.h" | 44 #include "third_party/WebKit/public/web/WebDocument.h" |
| 45 #include "third_party/WebKit/public/web/WebSecurityPolicy.h" | 45 #include "third_party/WebKit/public/web/WebSecurityPolicy.h" |
| 46 #include "third_party/WebKit/public/web/WebView.h" | 46 #include "third_party/WebKit/public/web/WebView.h" |
| 47 | 47 |
| 48 #if defined(ENABLE_WEBRTC) | 48 #if defined(ENABLE_WEBRTC) |
| 49 #include "chrome/renderer/extensions/cast_streaming_native_handler.h" | 49 #include "chrome/renderer/extensions/cast_streaming_native_handler.h" |
| 50 #endif | 50 #endif |
| 51 | 51 |
| 52 using extensions::NativeHandler; | 52 using extensions::NativeHandler; |
| 53 | 53 |
| 54 ChromeExtensionsDispatcherDelegate::ChromeExtensionsDispatcherDelegate() | 54 ChromeExtensionsDispatcherDelegate::ChromeExtensionsDispatcherDelegate() { |
| 55 : webrequest_used_(false) { | |
| 56 } | 55 } |
| 57 | 56 |
| 58 ChromeExtensionsDispatcherDelegate::~ChromeExtensionsDispatcherDelegate() { | 57 ChromeExtensionsDispatcherDelegate::~ChromeExtensionsDispatcherDelegate() { |
| 59 } | 58 } |
| 60 | 59 |
| 61 scoped_ptr<extensions::ScriptContext> | 60 scoped_ptr<extensions::ScriptContext> |
| 62 ChromeExtensionsDispatcherDelegate::CreateScriptContext( | 61 ChromeExtensionsDispatcherDelegate::CreateScriptContext( |
| 63 const v8::Handle<v8::Context>& v8_context, | 62 const v8::Handle<v8::Context>& v8_context, |
| 64 blink::WebFrame* frame, | 63 blink::WebFrame* frame, |
| 65 const extensions::Extension* extension, | 64 const extensions::Extension* extension, |
| (...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 205 source_map->RegisterSource("pageCapture", | 204 source_map->RegisterSource("pageCapture", |
| 206 IDR_PAGE_CAPTURE_CUSTOM_BINDINGS_JS); | 205 IDR_PAGE_CAPTURE_CUSTOM_BINDINGS_JS); |
| 207 source_map->RegisterSource("syncFileSystem", | 206 source_map->RegisterSource("syncFileSystem", |
| 208 IDR_SYNC_FILE_SYSTEM_CUSTOM_BINDINGS_JS); | 207 IDR_SYNC_FILE_SYSTEM_CUSTOM_BINDINGS_JS); |
| 209 source_map->RegisterSource("systemIndicator", | 208 source_map->RegisterSource("systemIndicator", |
| 210 IDR_SYSTEM_INDICATOR_CUSTOM_BINDINGS_JS); | 209 IDR_SYSTEM_INDICATOR_CUSTOM_BINDINGS_JS); |
| 211 source_map->RegisterSource("tabCapture", IDR_TAB_CAPTURE_CUSTOM_BINDINGS_JS); | 210 source_map->RegisterSource("tabCapture", IDR_TAB_CAPTURE_CUSTOM_BINDINGS_JS); |
| 212 source_map->RegisterSource("tabs", IDR_TABS_CUSTOM_BINDINGS_JS); | 211 source_map->RegisterSource("tabs", IDR_TABS_CUSTOM_BINDINGS_JS); |
| 213 source_map->RegisterSource("tts", IDR_TTS_CUSTOM_BINDINGS_JS); | 212 source_map->RegisterSource("tts", IDR_TTS_CUSTOM_BINDINGS_JS); |
| 214 source_map->RegisterSource("ttsEngine", IDR_TTS_ENGINE_CUSTOM_BINDINGS_JS); | 213 source_map->RegisterSource("ttsEngine", IDR_TTS_ENGINE_CUSTOM_BINDINGS_JS); |
| 215 source_map->RegisterSource("webRequest", IDR_WEB_REQUEST_CUSTOM_BINDINGS_JS); | |
| 216 source_map->RegisterSource("webRequestInternal", | |
| 217 IDR_WEB_REQUEST_INTERNAL_CUSTOM_BINDINGS_JS); | |
| 218 #if defined(ENABLE_WEBRTC) | 214 #if defined(ENABLE_WEBRTC) |
| 219 source_map->RegisterSource("cast.streaming.rtpStream", | 215 source_map->RegisterSource("cast.streaming.rtpStream", |
| 220 IDR_CAST_STREAMING_RTP_STREAM_CUSTOM_BINDINGS_JS); | 216 IDR_CAST_STREAMING_RTP_STREAM_CUSTOM_BINDINGS_JS); |
| 221 source_map->RegisterSource("cast.streaming.session", | 217 source_map->RegisterSource("cast.streaming.session", |
| 222 IDR_CAST_STREAMING_SESSION_CUSTOM_BINDINGS_JS); | 218 IDR_CAST_STREAMING_SESSION_CUSTOM_BINDINGS_JS); |
| 223 source_map->RegisterSource( | 219 source_map->RegisterSource( |
| 224 "cast.streaming.udpTransport", | 220 "cast.streaming.udpTransport", |
| 225 IDR_CAST_STREAMING_UDP_TRANSPORT_CUSTOM_BINDINGS_JS); | 221 IDR_CAST_STREAMING_UDP_TRANSPORT_CUSTOM_BINDINGS_JS); |
| 226 #endif | 222 #endif |
| 227 source_map->RegisterSource("webstore", IDR_WEBSTORE_CUSTOM_BINDINGS_JS); | 223 source_map->RegisterSource("webstore", IDR_WEBSTORE_CUSTOM_BINDINGS_JS); |
| (...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 339 if (!extension) | 335 if (!extension) |
| 340 return; | 336 return; |
| 341 | 337 |
| 342 extension->permissions_data()->UpdateTabSpecificPermissions( | 338 extension->permissions_data()->UpdateTabSpecificPermissions( |
| 343 tab_id, | 339 tab_id, |
| 344 new extensions::PermissionSet(extensions::APIPermissionSet(), | 340 new extensions::PermissionSet(extensions::APIPermissionSet(), |
| 345 extensions::ManifestPermissionSet(), | 341 extensions::ManifestPermissionSet(), |
| 346 origin_set, | 342 origin_set, |
| 347 extensions::URLPatternSet())); | 343 extensions::URLPatternSet())); |
| 348 } | 344 } |
| 349 | |
| 350 void ChromeExtensionsDispatcherDelegate::HandleWebRequestAPIUsage( | |
| 351 bool webrequest_used) { | |
| 352 webrequest_used_ = webrequest_used; | |
| 353 } | |
| OLD | NEW |