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 <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <set> | 10 #include <set> |
(...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
252 const base::Callback<void(RenderFrameHost*)>& on_frame) = 0; | 252 const base::Callback<void(RenderFrameHost*)>& on_frame) = 0; |
253 | 253 |
254 // Returns a vector of all RenderFrameHosts in the currently active view in | 254 // Returns a vector of all RenderFrameHosts in the currently active view in |
255 // breadth-first traversal order. | 255 // breadth-first traversal order. |
256 virtual std::vector<RenderFrameHost*> GetAllFrames() = 0; | 256 virtual std::vector<RenderFrameHost*> GetAllFrames() = 0; |
257 | 257 |
258 // Sends the given IPC to all live frames in this WebContents and returns the | 258 // Sends the given IPC to all live frames in this WebContents and returns the |
259 // number of sent messages (i.e. the number of processed frames). | 259 // number of sent messages (i.e. the number of processed frames). |
260 virtual int SendToAllFrames(IPC::Message* message) = 0; | 260 virtual int SendToAllFrames(IPC::Message* message) = 0; |
261 | 261 |
| 262 // Sends the given IPC to all live WebViews (can be more than one due to |
| 263 // out-of-process iframes) and returns the number of sent messages. |
| 264 virtual int SendToAllViews(IPC::Message* message) = 0; |
| 265 |
262 // Gets the current RenderViewHost for this tab. | 266 // Gets the current RenderViewHost for this tab. |
263 virtual RenderViewHost* GetRenderViewHost() const = 0; | 267 virtual RenderViewHost* GetRenderViewHost() const = 0; |
264 | 268 |
265 // Gets the current RenderViewHost's routing id. Returns | 269 // Gets the current RenderViewHost's routing id. Returns |
266 // MSG_ROUTING_NONE when there is no RenderViewHost. | 270 // MSG_ROUTING_NONE when there is no RenderViewHost. |
267 virtual int GetRoutingID() const = 0; | 271 virtual int GetRoutingID() const = 0; |
268 | 272 |
269 // Returns the currently active RenderWidgetHostView. This may change over | 273 // Returns the currently active RenderWidgetHostView. This may change over |
270 // time and can be nullptr (during setup and teardown). | 274 // time and can be nullptr (during setup and teardown). |
271 virtual RenderWidgetHostView* GetRenderWidgetHostView() const = 0; | 275 virtual RenderWidgetHostView* GetRenderWidgetHostView() const = 0; |
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
400 virtual base::TerminationStatus GetCrashedStatus() const = 0; | 404 virtual base::TerminationStatus GetCrashedStatus() const = 0; |
401 virtual int GetCrashedErrorCode() const = 0; | 405 virtual int GetCrashedErrorCode() const = 0; |
402 | 406 |
403 // Whether the tab is in the process of being destroyed. | 407 // Whether the tab is in the process of being destroyed. |
404 virtual bool IsBeingDestroyed() const = 0; | 408 virtual bool IsBeingDestroyed() const = 0; |
405 | 409 |
406 // Convenience method for notifying the delegate of a navigation state | 410 // Convenience method for notifying the delegate of a navigation state |
407 // change. | 411 // change. |
408 virtual void NotifyNavigationStateChanged(InvalidateTypes changed_flags) = 0; | 412 virtual void NotifyNavigationStateChanged(InvalidateTypes changed_flags) = 0; |
409 | 413 |
| 414 // Method for notifying WebContents that audio started or stopped being |
| 415 // audible. |
| 416 virtual void OnAudioStateChanged(bool is_audio_playing) = 0; |
| 417 |
410 // Get/Set the last time that the WebContents was made active (either when it | 418 // Get/Set the last time that the WebContents was made active (either when it |
411 // was created or shown with WasShown()). | 419 // was created or shown with WasShown()). |
412 virtual base::TimeTicks GetLastActiveTime() const = 0; | 420 virtual base::TimeTicks GetLastActiveTime() const = 0; |
413 virtual void SetLastActiveTime(base::TimeTicks last_active_time) = 0; | 421 virtual void SetLastActiveTime(base::TimeTicks last_active_time) = 0; |
414 | 422 |
415 // Invoked when the WebContents becomes shown/hidden. | 423 // Invoked when the WebContents becomes shown/hidden. |
416 virtual void WasShown() = 0; | 424 virtual void WasShown() = 0; |
417 virtual void WasHidden() = 0; | 425 virtual void WasHidden() = 0; |
418 | 426 |
419 // Returns true if the before unload and unload listeners need to be | 427 // Returns true if the before unload and unload listeners need to be |
(...skipping 331 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
751 | 759 |
752 private: | 760 private: |
753 // This interface should only be implemented inside content. | 761 // This interface should only be implemented inside content. |
754 friend class WebContentsImpl; | 762 friend class WebContentsImpl; |
755 WebContents() {} | 763 WebContents() {} |
756 }; | 764 }; |
757 | 765 |
758 } // namespace content | 766 } // namespace content |
759 | 767 |
760 #endif // CONTENT_PUBLIC_BROWSER_WEB_CONTENTS_H_ | 768 #endif // CONTENT_PUBLIC_BROWSER_WEB_CONTENTS_H_ |
OLD | NEW |