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 CONTENT_PUBLIC_BROWSER_WEB_CONTENTS_H_ | 5 #ifndef CONTENT_PUBLIC_BROWSER_WEB_CONTENTS_H_ |
6 #define CONTENT_PUBLIC_BROWSER_WEB_CONTENTS_H_ | 6 #define CONTENT_PUBLIC_BROWSER_WEB_CONTENTS_H_ |
7 | 7 |
8 #include <set> | 8 #include <set> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
185 // these may change over time. | 185 // these may change over time. |
186 virtual RenderProcessHost* GetRenderProcessHost() const = 0; | 186 virtual RenderProcessHost* GetRenderProcessHost() const = 0; |
187 | 187 |
188 // Returns the main frame for the currently active view. | 188 // Returns the main frame for the currently active view. |
189 virtual RenderFrameHost* GetMainFrame() = 0; | 189 virtual RenderFrameHost* GetMainFrame() = 0; |
190 | 190 |
191 // Returns the focused frame for the currently active view. | 191 // Returns the focused frame for the currently active view. |
192 virtual RenderFrameHost* GetFocusedFrame() = 0; | 192 virtual RenderFrameHost* GetFocusedFrame() = 0; |
193 | 193 |
194 // Calls |on_frame| for each frame in the currently active view. | 194 // Calls |on_frame| for each frame in the currently active view. |
| 195 // Note: The RenderFrameHost parameter is not guaranteed to have a live |
| 196 // RenderFrame counterpart in the renderer process. Callbacks should check |
| 197 // IsRenderFrameLive, as sending IPC messages to it in this case will fail |
| 198 // silently. |
195 virtual void ForEachFrame( | 199 virtual void ForEachFrame( |
196 const base::Callback<void(RenderFrameHost*)>& on_frame) = 0; | 200 const base::Callback<void(RenderFrameHost*)>& on_frame) = 0; |
197 | 201 |
198 // Sends the given IPC to all frames in the currently active view. This is a | 202 // Sends the given IPC to all frames in the currently active view. This is a |
199 // convenience method instead of calling ForEach. | 203 // convenience method instead of calling ForEach. |
200 virtual void SendToAllFrames(IPC::Message* message) = 0; | 204 virtual void SendToAllFrames(IPC::Message* message) = 0; |
201 | 205 |
202 // Gets the current RenderViewHost for this tab. | 206 // Gets the current RenderViewHost for this tab. |
203 virtual RenderViewHost* GetRenderViewHost() const = 0; | 207 virtual RenderViewHost* GetRenderViewHost() const = 0; |
204 | 208 |
(...skipping 409 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
614 | 618 |
615 private: | 619 private: |
616 // This interface should only be implemented inside content. | 620 // This interface should only be implemented inside content. |
617 friend class WebContentsImpl; | 621 friend class WebContentsImpl; |
618 WebContents() {} | 622 WebContents() {} |
619 }; | 623 }; |
620 | 624 |
621 } // namespace content | 625 } // namespace content |
622 | 626 |
623 #endif // CONTENT_PUBLIC_BROWSER_WEB_CONTENTS_H_ | 627 #endif // CONTENT_PUBLIC_BROWSER_WEB_CONTENTS_H_ |
OLD | NEW |