Chromium Code Reviews| 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 #ifndef CONTENT_PUBLIC_BROWSER_RENDER_FRAME_HOST_H_ | 5 #ifndef CONTENT_PUBLIC_BROWSER_RENDER_FRAME_HOST_H_ |
| 6 #define CONTENT_PUBLIC_BROWSER_RENDER_FRAME_HOST_H_ | 6 #define CONTENT_PUBLIC_BROWSER_RENDER_FRAME_HOST_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/callback_forward.h" | 10 #include "base/callback_forward.h" |
| 11 #include "base/unguessable_token.h" | |
| 11 #include "build/build_config.h" | 12 #include "build/build_config.h" |
| 12 #include "content/common/content_export.h" | 13 #include "content/common/content_export.h" |
| 13 #include "content/public/common/console_message_level.h" | 14 #include "content/public/common/console_message_level.h" |
| 14 #include "content/public/common/file_chooser_params.h" | 15 #include "content/public/common/file_chooser_params.h" |
| 15 #include "ipc/ipc_listener.h" | 16 #include "ipc/ipc_listener.h" |
| 16 #include "ipc/ipc_sender.h" | 17 #include "ipc/ipc_sender.h" |
| 17 #include "third_party/WebKit/public/platform/WebPageVisibilityState.h" | 18 #include "third_party/WebKit/public/platform/WebPageVisibilityState.h" |
| 18 #include "ui/gfx/geometry/rect.h" | 19 #include "ui/gfx/geometry/rect.h" |
| 19 #include "ui/gfx/native_widget_types.h" | 20 #include "ui/gfx/native_widget_types.h" |
| 20 #include "url/gurl.h" | 21 #include "url/gurl.h" |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 52 #if defined(OS_ANDROID) | 53 #if defined(OS_ANDROID) |
| 53 // Globally allows for injecting JavaScript into the main world. This feature | 54 // Globally allows for injecting JavaScript into the main world. This feature |
| 54 // is present only to support Android WebView and must not be used in other | 55 // is present only to support Android WebView and must not be used in other |
| 55 // configurations. | 56 // configurations. |
| 56 static void AllowInjectingJavaScriptForAndroidWebView(); | 57 static void AllowInjectingJavaScriptForAndroidWebView(); |
| 57 #endif | 58 #endif |
| 58 | 59 |
| 59 // Returns a RenderFrameHost given its accessibility tree ID. | 60 // Returns a RenderFrameHost given its accessibility tree ID. |
| 60 static RenderFrameHost* FromAXTreeID(int ax_tree_id); | 61 static RenderFrameHost* FromAXTreeID(int ax_tree_id); |
| 61 | 62 |
| 63 #if defined(OS_ANDROID) | |
| 64 // Returns a RenderFrameHost given its AndroidOverlay routing token. | |
| 65 static RenderFrameHost* FromOverlayRoutingToken( | |
| 66 const base::UnguessableToken& token); | |
| 67 #endif | |
| 68 | |
| 62 ~RenderFrameHost() override {} | 69 ~RenderFrameHost() override {} |
| 63 | 70 |
| 64 // Returns the route id for this frame. | 71 // Returns the route id for this frame. |
| 65 virtual int GetRoutingID() = 0; | 72 virtual int GetRoutingID() = 0; |
| 66 | 73 |
| 67 // Returns the accessibility tree ID for this RenderFrameHost. | 74 // Returns the accessibility tree ID for this RenderFrameHost. |
| 68 virtual int GetAXTreeID() = 0; | 75 virtual int GetAXTreeID() = 0; |
| 69 | 76 |
| 77 #if defined(OS_ANDROID) | |
| 78 // Returns an unguessable token for this RFHI. This provides a temporary way | |
| 79 // to identify a RenderFrameHost that's compatible with IPC. Else, one needs | |
| 80 // to send pid + RoutingID, but one cannot send pid. One can get it from the | |
| 81 // channel, but this makes it much harder to get wrong. | |
| 82 // Once media switches to mojo, we should be able to remove this in favor of | |
| 83 // sending a mojo overlay factory. | |
| 84 virtual const base::UnguessableToken& GetOverlayRoutingToken() = 0; | |
|
boliu
2017/03/30 22:42:02
ditto about public
liberato (no reviews please)
2017/04/04 17:49:28
Done.
| |
| 85 #endif | |
| 86 | |
| 70 // Returns the SiteInstance grouping all RenderFrameHosts that have script | 87 // Returns the SiteInstance grouping all RenderFrameHosts that have script |
| 71 // access to this RenderFrameHost, and must therefore live in the same | 88 // access to this RenderFrameHost, and must therefore live in the same |
| 72 // process. | 89 // process. |
| 73 virtual SiteInstance* GetSiteInstance() = 0; | 90 virtual SiteInstance* GetSiteInstance() = 0; |
| 74 | 91 |
| 75 // Returns the process for this frame. | 92 // Returns the process for this frame. |
| 76 virtual RenderProcessHost* GetProcess() = 0; | 93 virtual RenderProcessHost* GetProcess() = 0; |
| 77 | 94 |
| 78 // Returns the RenderWidgetHostView that can be used to control focus and | 95 // Returns the RenderWidgetHostView that can be used to control focus and |
| 79 // visibility for this frame. | 96 // visibility for this frame. |
| (...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 248 | 265 |
| 249 private: | 266 private: |
| 250 // This interface should only be implemented inside content. | 267 // This interface should only be implemented inside content. |
| 251 friend class RenderFrameHostImpl; | 268 friend class RenderFrameHostImpl; |
| 252 RenderFrameHost() {} | 269 RenderFrameHost() {} |
| 253 }; | 270 }; |
| 254 | 271 |
| 255 } // namespace content | 272 } // namespace content |
| 256 | 273 |
| 257 #endif // CONTENT_PUBLIC_BROWSER_RENDER_FRAME_HOST_H_ | 274 #endif // CONTENT_PUBLIC_BROWSER_RENDER_FRAME_HOST_H_ |
| OLD | NEW |