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_BROWSER_RENDERER_HOST_RENDER_VIEW_HOST_DELEGATE_H_ | 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_RENDER_VIEW_HOST_DELEGATE_H_ |
6 #define CONTENT_BROWSER_RENDERER_HOST_RENDER_VIEW_HOST_DELEGATE_H_ | 6 #define CONTENT_BROWSER_RENDERER_HOST_RENDER_VIEW_HOST_DELEGATE_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
65 // RenderViewHostDelegate | 65 // RenderViewHostDelegate |
66 // | 66 // |
67 // An interface implemented by an object interested in knowing about the state | 67 // An interface implemented by an object interested in knowing about the state |
68 // of the RenderViewHost. | 68 // of the RenderViewHost. |
69 // | 69 // |
70 // This interface currently encompasses every type of message that was | 70 // This interface currently encompasses every type of message that was |
71 // previously being sent by WebContents itself. Some of these notifications | 71 // previously being sent by WebContents itself. Some of these notifications |
72 // may not be relevant to all users of RenderViewHost and we should consider | 72 // may not be relevant to all users of RenderViewHost and we should consider |
73 // exposing a more generic Send function on RenderViewHost and a response | 73 // exposing a more generic Send function on RenderViewHost and a response |
74 // listener here to serve that need. | 74 // listener here to serve that need. |
75 class CONTENT_EXPORT RenderViewHostDelegate : public IPC::Channel::Listener { | 75 class CONTENT_EXPORT RenderViewHostDelegate : public IPC::Listener { |
76 public: | 76 public: |
77 // RendererManagerment ------------------------------------------------------- | 77 // RendererManagerment ------------------------------------------------------- |
78 // Functions for managing switching of Renderers. For WebContents, this is | 78 // Functions for managing switching of Renderers. For WebContents, this is |
79 // implemented by the RenderViewHostManager. | 79 // implemented by the RenderViewHostManager. |
80 | 80 |
81 class CONTENT_EXPORT RendererManagement { | 81 class CONTENT_EXPORT RendererManagement { |
82 public: | 82 public: |
83 // Notification whether we should close the page, after an explicit call to | 83 // Notification whether we should close the page, after an explicit call to |
84 // AttemptToClosePage. This is called before a cross-site request or before | 84 // AttemptToClosePage. This is called before a cross-site request or before |
85 // a tab/window is closed (as indicated by the first parameter) to allow the | 85 // a tab/window is closed (as indicated by the first parameter) to allow the |
(...skipping 15 matching lines...) Expand all Loading... |
101 virtual ~RendererManagement() {} | 101 virtual ~RendererManagement() {} |
102 }; | 102 }; |
103 | 103 |
104 // --------------------------------------------------------------------------- | 104 // --------------------------------------------------------------------------- |
105 | 105 |
106 // Returns the current delegate associated with a feature. May return NULL if | 106 // Returns the current delegate associated with a feature. May return NULL if |
107 // there is no corresponding delegate. | 107 // there is no corresponding delegate. |
108 virtual RenderViewHostDelegateView* GetDelegateView(); | 108 virtual RenderViewHostDelegateView* GetDelegateView(); |
109 virtual RendererManagement* GetRendererManagementDelegate(); | 109 virtual RendererManagement* GetRendererManagementDelegate(); |
110 | 110 |
111 // IPC::Channel::Listener implementation. | 111 // IPC::Listener implementation. |
112 // This is used to give the delegate a chance to filter IPC messages. | 112 // This is used to give the delegate a chance to filter IPC messages. |
113 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; | 113 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; |
114 | 114 |
115 // Gets the URL that is currently being displayed, if there is one. | 115 // Gets the URL that is currently being displayed, if there is one. |
116 virtual const GURL& GetURL() const; | 116 virtual const GURL& GetURL() const; |
117 | 117 |
118 // Return this object cast to a WebContents, if it is one. If the object is | 118 // Return this object cast to a WebContents, if it is one. If the object is |
119 // not a WebContents, returns NULL. DEPRECATED: Be sure to include brettw or | 119 // not a WebContents, returns NULL. DEPRECATED: Be sure to include brettw or |
120 // jam as reviewers before you use this method. http://crbug.com/82582 | 120 // jam as reviewers before you use this method. http://crbug.com/82582 |
121 virtual WebContents* GetAsWebContents(); | 121 virtual WebContents* GetAsWebContents(); |
(...skipping 279 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
401 const MediaStreamRequest* request, | 401 const MediaStreamRequest* request, |
402 const MediaResponseCallback& callback) {} | 402 const MediaResponseCallback& callback) {} |
403 | 403 |
404 protected: | 404 protected: |
405 virtual ~RenderViewHostDelegate() {} | 405 virtual ~RenderViewHostDelegate() {} |
406 }; | 406 }; |
407 | 407 |
408 } // namespace content | 408 } // namespace content |
409 | 409 |
410 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_VIEW_HOST_DELEGATE_H_ | 410 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_VIEW_HOST_DELEGATE_H_ |
OLD | NEW |