| 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_DELEGATE_H_ | 5 #ifndef CONTENT_PUBLIC_BROWSER_WEB_CONTENTS_DELEGATE_H_ |
| 6 #define CONTENT_PUBLIC_BROWSER_WEB_CONTENTS_DELEGATE_H_ | 6 #define CONTENT_PUBLIC_BROWSER_WEB_CONTENTS_DELEGATE_H_ |
| 7 | 7 |
| 8 #include <set> | 8 #include <set> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 42 struct NativeWebKeyboardEvent; | 42 struct NativeWebKeyboardEvent; |
| 43 struct SSLStatus; | 43 struct SSLStatus; |
| 44 } | 44 } |
| 45 | 45 |
| 46 namespace gfx { | 46 namespace gfx { |
| 47 class Point; | 47 class Point; |
| 48 class Rect; | 48 class Rect; |
| 49 class Size; | 49 class Size; |
| 50 } | 50 } |
| 51 | 51 |
| 52 namespace history { | |
| 53 struct HistoryAddPageArgs; | |
| 54 } | |
| 55 | |
| 56 namespace webkit_glue { | 52 namespace webkit_glue { |
| 57 struct WebIntentData; | 53 struct WebIntentData; |
| 58 struct WebIntentServiceData; | 54 struct WebIntentServiceData; |
| 59 } | 55 } |
| 60 | 56 |
| 61 namespace WebKit { | 57 namespace WebKit { |
| 62 class WebLayer; | 58 class WebLayer; |
| 63 } | 59 } |
| 64 | 60 |
| 65 namespace content { | 61 namespace content { |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 153 // Notification that there was a mouse event, along with the absolute | 149 // Notification that there was a mouse event, along with the absolute |
| 154 // coordinates of the mouse pointer and whether it was a normal motion event | 150 // coordinates of the mouse pointer and whether it was a normal motion event |
| 155 // (otherwise, the pointer left the contents area). | 151 // (otherwise, the pointer left the contents area). |
| 156 virtual void ContentsMouseEvent(WebContents* source, | 152 virtual void ContentsMouseEvent(WebContents* source, |
| 157 const gfx::Point& location, | 153 const gfx::Point& location, |
| 158 bool motion) {} | 154 bool motion) {} |
| 159 | 155 |
| 160 // Request the delegate to change the zoom level of the current tab. | 156 // Request the delegate to change the zoom level of the current tab. |
| 161 virtual void ContentsZoomChange(bool zoom_in) {} | 157 virtual void ContentsZoomChange(bool zoom_in) {} |
| 162 | 158 |
| 163 // Check whether this contents is inside a window dedicated to running a web | |
| 164 // application. | |
| 165 virtual bool IsApplication() const; | |
| 166 | |
| 167 // Check whether this contents is permitted to load data URLs in WebUI mode. | 159 // Check whether this contents is permitted to load data URLs in WebUI mode. |
| 168 // This is normally disallowed for security. | 160 // This is normally disallowed for security. |
| 169 virtual bool CanLoadDataURLsInWebUI() const; | 161 virtual bool CanLoadDataURLsInWebUI() const; |
| 170 | 162 |
| 171 // Return the rect where to display the resize corner, if any, otherwise | 163 // Return the rect where to display the resize corner, if any, otherwise |
| 172 // an empty rect. | 164 // an empty rect. |
| 173 virtual gfx::Rect GetRootWindowResizerRect() const; | 165 virtual gfx::Rect GetRootWindowResizerRect() const; |
| 174 | 166 |
| 175 // Invoked prior to showing before unload handler confirmation dialog. | 167 // Invoked prior to showing before unload handler confirmation dialog. |
| 176 virtual void WillRunBeforeUnloadConfirm() {} | 168 virtual void WillRunBeforeUnloadConfirm() {} |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 277 // Render view drag n drop ended. | 269 // Render view drag n drop ended. |
| 278 virtual void DragEnded() {} | 270 virtual void DragEnded() {} |
| 279 | 271 |
| 280 // Shows the repost form confirmation dialog box. | 272 // Shows the repost form confirmation dialog box. |
| 281 virtual void ShowRepostFormWarningDialog(WebContents* source) {} | 273 virtual void ShowRepostFormWarningDialog(WebContents* source) {} |
| 282 | 274 |
| 283 // Allows delegate to override navigation to the history entries. | 275 // Allows delegate to override navigation to the history entries. |
| 284 // Returns true to allow WebContents to continue with the default processing. | 276 // Returns true to allow WebContents to continue with the default processing. |
| 285 virtual bool OnGoToEntryOffset(int offset); | 277 virtual bool OnGoToEntryOffset(int offset); |
| 286 | 278 |
| 287 // Returns whether this WebContents should add the specified navigation to | |
| 288 // history. | |
| 289 virtual bool ShouldAddNavigationToHistory( | |
| 290 const history::HistoryAddPageArgs& add_page_args, | |
| 291 NavigationType navigation_type); | |
| 292 | |
| 293 // Returns the native window framing the view containing the WebContents. | 279 // Returns the native window framing the view containing the WebContents. |
| 294 virtual gfx::NativeWindow GetFrameNativeWindow(); | 280 virtual gfx::NativeWindow GetFrameNativeWindow(); |
| 295 | 281 |
| 296 // Allows delegate to control whether a WebContents will be created. Returns | 282 // Allows delegate to control whether a WebContents will be created. Returns |
| 297 // true to allow the creation. Default is to allow it. In cases where the | 283 // true to allow the creation. Default is to allow it. In cases where the |
| 298 // delegate handles the creation/navigation itself, it will use |target_url|. | 284 // delegate handles the creation/navigation itself, it will use |target_url|. |
| 299 virtual bool ShouldCreateWebContents( | 285 virtual bool ShouldCreateWebContents( |
| 300 WebContents* web_contents, | 286 WebContents* web_contents, |
| 301 int route_id, | 287 int route_id, |
| 302 WindowContainerType window_container_type, | 288 WindowContainerType window_container_type, |
| (...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 466 // Called when |this| is no longer the WebContentsDelegate for |source|. | 452 // Called when |this| is no longer the WebContentsDelegate for |source|. |
| 467 void Detach(WebContents* source); | 453 void Detach(WebContents* source); |
| 468 | 454 |
| 469 // The WebContents that this is currently a delegate for. | 455 // The WebContents that this is currently a delegate for. |
| 470 std::set<WebContents*> attached_contents_; | 456 std::set<WebContents*> attached_contents_; |
| 471 }; | 457 }; |
| 472 | 458 |
| 473 } // namespace content | 459 } // namespace content |
| 474 | 460 |
| 475 #endif // CONTENT_PUBLIC_BROWSER_WEB_CONTENTS_DELEGATE_H_ | 461 #endif // CONTENT_PUBLIC_BROWSER_WEB_CONTENTS_DELEGATE_H_ |
| OLD | NEW |