OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #ifndef CHROME_RENDERER_EXTENSIONS_DISPATCHER_H_ | 5 #ifndef CHROME_RENDERER_EXTENSIONS_DISPATCHER_H_ |
6 #define CHROME_RENDERER_EXTENSIONS_DISPATCHER_H_ | 6 #define CHROME_RENDERER_EXTENSIONS_DISPATCHER_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <set> | 9 #include <set> |
10 #include <string> | 10 #include <string> |
11 #include <vector> | 11 #include <vector> |
12 | 12 |
13 #include "base/memory/shared_memory.h" | 13 #include "base/memory/shared_memory.h" |
14 #include "base/timer/timer.h" | 14 #include "base/timer/timer.h" |
15 #include "chrome/common/extensions/extension_set.h" | 15 #include "chrome/common/extensions/extension_set.h" |
16 #include "chrome/renderer/extensions/chrome_v8_context.h" | 16 #include "chrome/renderer/extensions/chrome_v8_context.h" |
17 #include "chrome/renderer/extensions/chrome_v8_context_set.h" | 17 #include "chrome/renderer/extensions/chrome_v8_context_set.h" |
18 #include "chrome/renderer/extensions/v8_schema_registry.h" | 18 #include "chrome/renderer/extensions/v8_schema_registry.h" |
19 #include "chrome/renderer/resource_bundle_source_map.h" | 19 #include "chrome/renderer/resource_bundle_source_map.h" |
20 #include "content/public/renderer/render_process_observer.h" | 20 #include "content/public/renderer/render_process_observer.h" |
21 #include "extensions/common/event_filter.h" | 21 #include "extensions/common/event_filter.h" |
22 #include "extensions/common/features/feature.h" | 22 #include "extensions/common/features/feature.h" |
| 23 #include "third_party/WebKit/public/web/WebNavigationPolicy.h" |
| 24 #include "third_party/WebKit/public/web/WebNavigationType.h" |
23 #include "v8/include/v8.h" | 25 #include "v8/include/v8.h" |
24 | 26 |
25 class ChromeRenderViewTest; | 27 class ChromeRenderViewTest; |
26 class GURL; | 28 class GURL; |
27 class ModuleSystem; | 29 class ModuleSystem; |
28 class URLPattern; | 30 class URLPattern; |
29 struct ExtensionMsg_ExternalConnectionInfo; | 31 struct ExtensionMsg_ExternalConnectionInfo; |
30 struct ExtensionMsg_Loaded_Params; | 32 struct ExtensionMsg_Loaded_Params; |
31 | 33 |
32 namespace WebKit { | 34 namespace WebKit { |
33 class WebFrame; | 35 class WebFrame; |
34 class WebSecurityOrigin; | 36 class WebSecurityOrigin; |
| 37 class WebURLRequest; |
35 } | 38 } |
36 | 39 |
37 namespace base { | 40 namespace base { |
38 class DictionaryValue; | 41 class DictionaryValue; |
39 class ListValue; | 42 class ListValue; |
40 } | 43 } |
41 | 44 |
42 namespace content { | 45 namespace content { |
43 class RenderThread; | 46 class RenderThread; |
44 } | 47 } |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
125 | 128 |
126 // Shared implementation of the various MessageInvoke IPCs. | 129 // Shared implementation of the various MessageInvoke IPCs. |
127 void InvokeModuleSystemMethod( | 130 void InvokeModuleSystemMethod( |
128 content::RenderView* render_view, | 131 content::RenderView* render_view, |
129 const std::string& extension_id, | 132 const std::string& extension_id, |
130 const std::string& module_name, | 133 const std::string& module_name, |
131 const std::string& function_name, | 134 const std::string& function_name, |
132 const base::ListValue& args, | 135 const base::ListValue& args, |
133 bool user_gesture); | 136 bool user_gesture); |
134 | 137 |
| 138 // For top-level navigations, tries to find a platform app that has registered |
| 139 // url_handlers matching the URL. If found, delegates further URL processing |
| 140 // to the browser (the browser is supposed to launch the app), and returns |
| 141 // true. Otherwise, returns false. |
| 142 bool MaybeRedirectUrlToApp(WebKit::WebFrame* frame, |
| 143 const WebKit::WebURLRequest& request, |
| 144 WebKit::WebNavigationType type, |
| 145 WebKit::WebNavigationPolicy default_policy); |
| 146 |
135 private: | 147 private: |
136 friend class ::ChromeRenderViewTest; | 148 friend class ::ChromeRenderViewTest; |
137 FRIEND_TEST_ALL_PREFIXES(RendererPermissionsPolicyDelegateTest, | 149 FRIEND_TEST_ALL_PREFIXES(RendererPermissionsPolicyDelegateTest, |
138 CannotScriptWebstore); | 150 CannotScriptWebstore); |
139 typedef void (*BindingInstaller)(ModuleSystem* module_system, | 151 typedef void (*BindingInstaller)(ModuleSystem* module_system, |
140 v8::Handle<v8::Object> chrome); | 152 v8::Handle<v8::Object> chrome); |
141 | 153 |
142 // RenderProcessObserver implementation: | 154 // RenderProcessObserver implementation: |
143 virtual bool OnControlMessageReceived(const IPC::Message& message) OVERRIDE; | 155 virtual bool OnControlMessageReceived(const IPC::Message& message) OVERRIDE; |
144 virtual void WebKitInitialized() OVERRIDE; | 156 virtual void WebKitInitialized() OVERRIDE; |
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
299 // The platforms system font family and size; | 311 // The platforms system font family and size; |
300 std::string system_font_family_; | 312 std::string system_font_family_; |
301 std::string system_font_size_; | 313 std::string system_font_size_; |
302 | 314 |
303 DISALLOW_COPY_AND_ASSIGN(Dispatcher); | 315 DISALLOW_COPY_AND_ASSIGN(Dispatcher); |
304 }; | 316 }; |
305 | 317 |
306 } // namespace extensions | 318 } // namespace extensions |
307 | 319 |
308 #endif // CHROME_RENDERER_EXTENSIONS_DISPATCHER_H_ | 320 #endif // CHROME_RENDERER_EXTENSIONS_DISPATCHER_H_ |
OLD | NEW |