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" |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
42 class RenderProcessHost; | 42 class RenderProcessHost; |
43 class RenderViewHost; | 43 class RenderViewHost; |
44 class RenderWidgetHostView; | 44 class RenderWidgetHostView; |
45 class SiteInstance; | 45 class SiteInstance; |
46 struct FileChooserFileInfo; | 46 struct FileChooserFileInfo; |
47 | 47 |
48 // The interface provides a communication conduit with a frame in the renderer. | 48 // The interface provides a communication conduit with a frame in the renderer. |
49 class CONTENT_EXPORT RenderFrameHost : public IPC::Listener, | 49 class CONTENT_EXPORT RenderFrameHost : public IPC::Listener, |
50 public IPC::Sender { | 50 public IPC::Sender { |
51 public: | 51 public: |
| 52 // Constant used to denote that a lookup of a FrameTreeNode ID has failed. |
| 53 static const int kNoFrameTreeNodeId = -1; |
| 54 |
52 // Returns the RenderFrameHost given its ID and the ID of its render process. | 55 // Returns the RenderFrameHost given its ID and the ID of its render process. |
53 // Returns nullptr if the IDs do not correspond to a live RenderFrameHost. | 56 // Returns nullptr if the IDs do not correspond to a live RenderFrameHost. |
54 static RenderFrameHost* FromID(int render_process_id, int render_frame_id); | 57 static RenderFrameHost* FromID(int render_process_id, int render_frame_id); |
55 | 58 |
56 #if defined(OS_ANDROID) | 59 #if defined(OS_ANDROID) |
57 // Globally allows for injecting JavaScript into the main world. This feature | 60 // Globally allows for injecting JavaScript into the main world. This feature |
58 // is present only to support Android WebView and must not be used in other | 61 // is present only to support Android WebView and must not be used in other |
59 // configurations. | 62 // configurations. |
60 static void AllowInjectingJavaScriptForAndroidWebView(); | 63 static void AllowInjectingJavaScriptForAndroidWebView(); |
61 #endif | 64 #endif |
62 | 65 |
63 // Returns a RenderFrameHost given its accessibility tree ID. | 66 // Returns a RenderFrameHost given its accessibility tree ID. |
64 static RenderFrameHost* FromAXTreeID(int ax_tree_id); | 67 static RenderFrameHost* FromAXTreeID(int ax_tree_id); |
65 | 68 |
| 69 // Returns the FrameTreeNode ID corresponding to the specified |process_id| |
| 70 // and |routing_id|. This routing ID pair may represent a placeholder for |
| 71 // frame that is currently rendered in a different process than |process_id|. |
| 72 static int GetFrameTreeNodeIdForRoutingId(int process_id, int routing_id); |
| 73 |
66 ~RenderFrameHost() override {} | 74 ~RenderFrameHost() override {} |
67 | 75 |
68 // Returns the route id for this frame. | 76 // Returns the route id for this frame. |
69 virtual int GetRoutingID() = 0; | 77 virtual int GetRoutingID() = 0; |
70 | 78 |
71 // Returns the accessibility tree ID for this RenderFrameHost. | 79 // Returns the accessibility tree ID for this RenderFrameHost. |
72 virtual int GetAXTreeID() = 0; | 80 virtual int GetAXTreeID() = 0; |
73 | 81 |
74 // Returns the SiteInstance grouping all RenderFrameHosts that have script | 82 // Returns the SiteInstance grouping all RenderFrameHosts that have script |
75 // access to this RenderFrameHost, and must therefore live in the same | 83 // access to this RenderFrameHost, and must therefore live in the same |
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
255 | 263 |
256 private: | 264 private: |
257 // This interface should only be implemented inside content. | 265 // This interface should only be implemented inside content. |
258 friend class RenderFrameHostImpl; | 266 friend class RenderFrameHostImpl; |
259 RenderFrameHost() {} | 267 RenderFrameHost() {} |
260 }; | 268 }; |
261 | 269 |
262 } // namespace content | 270 } // namespace content |
263 | 271 |
264 #endif // CONTENT_PUBLIC_BROWSER_RENDER_FRAME_HOST_H_ | 272 #endif // CONTENT_PUBLIC_BROWSER_RENDER_FRAME_HOST_H_ |
OLD | NEW |