| 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 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 76 class CONTENT_EXPORT RenderViewHostDelegate { | 76 class CONTENT_EXPORT RenderViewHostDelegate { |
| 77 public: | 77 public: |
| 78 // Returns the current delegate associated with a feature. May return NULL if | 78 // Returns the current delegate associated with a feature. May return NULL if |
| 79 // there is no corresponding delegate. | 79 // there is no corresponding delegate. |
| 80 virtual RenderViewHostDelegateView* GetDelegateView(); | 80 virtual RenderViewHostDelegateView* GetDelegateView(); |
| 81 | 81 |
| 82 // This is used to give the delegate a chance to filter IPC messages. | 82 // This is used to give the delegate a chance to filter IPC messages. |
| 83 virtual bool OnMessageReceived(RenderViewHost* render_view_host, | 83 virtual bool OnMessageReceived(RenderViewHost* render_view_host, |
| 84 const IPC::Message& message); | 84 const IPC::Message& message); |
| 85 | 85 |
| 86 // Gets the URL that is currently being displayed, if there is one. | |
| 87 virtual const GURL& GetURL() const; | |
| 88 | |
| 89 // Return this object cast to a WebContents, if it is one. If the object is | 86 // Return this object cast to a WebContents, if it is one. If the object is |
| 90 // not a WebContents, returns NULL. DEPRECATED: Be sure to include brettw or | 87 // not a WebContents, returns NULL. DEPRECATED: Be sure to include brettw or |
| 91 // jam as reviewers before you use this method. http://crbug.com/82582 | 88 // jam as reviewers before you use this method. http://crbug.com/82582 |
| 92 virtual WebContents* GetAsWebContents(); | 89 virtual WebContents* GetAsWebContents(); |
| 93 | 90 |
| 94 // Return the rect where to display the resize corner, if any, otherwise | 91 // Return the rect where to display the resize corner, if any, otherwise |
| 95 // an empty rect. | 92 // an empty rect. |
| 96 virtual gfx::Rect GetRootWindowResizerRect() const = 0; | 93 virtual gfx::Rect GetRootWindowResizerRect() const = 0; |
| 97 | 94 |
| 98 // The RenderView is being constructed (message sent to the renderer process | 95 // The RenderView is being constructed (message sent to the renderer process |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 180 const GURL& frame_url, | 177 const GURL& frame_url, |
| 181 JavaScriptMessageType type, | 178 JavaScriptMessageType type, |
| 182 IPC::Message* reply_msg, | 179 IPC::Message* reply_msg, |
| 183 bool* did_suppress_message) {} | 180 bool* did_suppress_message) {} |
| 184 | 181 |
| 185 virtual void RunBeforeUnloadConfirm(RenderViewHost* rvh, | 182 virtual void RunBeforeUnloadConfirm(RenderViewHost* rvh, |
| 186 const base::string16& message, | 183 const base::string16& message, |
| 187 bool is_reload, | 184 bool is_reload, |
| 188 IPC::Message* reply_msg) {} | 185 IPC::Message* reply_msg) {} |
| 189 | 186 |
| 190 // A message was added to to the console. | |
| 191 virtual bool AddMessageToConsole(int32 level, | |
| 192 const base::string16& message, | |
| 193 int32 line_no, | |
| 194 const base::string16& source_id); | |
| 195 | |
| 196 // Return a dummy RendererPreferences object that will be used by the renderer | 187 // Return a dummy RendererPreferences object that will be used by the renderer |
| 197 // associated with the owning RenderViewHost. | 188 // associated with the owning RenderViewHost. |
| 198 virtual RendererPreferences GetRendererPrefs( | 189 virtual RendererPreferences GetRendererPrefs( |
| 199 BrowserContext* browser_context) const = 0; | 190 BrowserContext* browser_context) const = 0; |
| 200 | 191 |
| 201 // Returns a WebPreferences object that will be used by the renderer | 192 // Returns a WebPreferences object that will be used by the renderer |
| 202 // associated with the owning render view host. | 193 // associated with the owning render view host. |
| 203 virtual WebPreferences GetWebkitPrefs(); | 194 virtual WebPreferences GetWebkitPrefs(); |
| 204 | 195 |
| 205 // Notification the user has made a gesture while focus was on the | 196 // Notification the user has made a gesture while focus was on the |
| (...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 346 virtual void AccessibilityEventReceived( | 337 virtual void AccessibilityEventReceived( |
| 347 const std::vector<AXEventNotificationDetails>& details) {} | 338 const std::vector<AXEventNotificationDetails>& details) {} |
| 348 | 339 |
| 349 protected: | 340 protected: |
| 350 virtual ~RenderViewHostDelegate() {} | 341 virtual ~RenderViewHostDelegate() {} |
| 351 }; | 342 }; |
| 352 | 343 |
| 353 } // namespace content | 344 } // namespace content |
| 354 | 345 |
| 355 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_VIEW_HOST_DELEGATE_H_ | 346 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_VIEW_HOST_DELEGATE_H_ |
| OLD | NEW |