| 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 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 224 virtual void OnStartDownload(WebContents* source, DownloadItem* download) {} | 224 virtual void OnStartDownload(WebContents* source, DownloadItem* download) {} |
| 225 | 225 |
| 226 // Return much extra vertical space should be allotted to the | 226 // Return much extra vertical space should be allotted to the |
| 227 // render view widget during various animations (e.g. infobar closing). | 227 // render view widget during various animations (e.g. infobar closing). |
| 228 // This is used to make painting look smoother. | 228 // This is used to make painting look smoother. |
| 229 virtual int GetExtraRenderViewHeight() const; | 229 virtual int GetExtraRenderViewHeight() const; |
| 230 | 230 |
| 231 // Returns true if the context menu operation was handled by the delegate. | 231 // Returns true if the context menu operation was handled by the delegate. |
| 232 virtual bool HandleContextMenu(const content::ContextMenuParams& params); | 232 virtual bool HandleContextMenu(const content::ContextMenuParams& params); |
| 233 | 233 |
| 234 // Returns true if the context menu command was handled | |
| 235 virtual bool ExecuteContextMenuCommand(int command); | |
| 236 | |
| 237 // Opens source view for given WebContents that is navigated to the given | 234 // Opens source view for given WebContents that is navigated to the given |
| 238 // page url. | 235 // page url. |
| 239 virtual void ViewSourceForTab(WebContents* source, const GURL& page_url); | 236 virtual void ViewSourceForTab(WebContents* source, const GURL& page_url); |
| 240 | 237 |
| 241 // Opens source view for the given subframe. | 238 // Opens source view for the given subframe. |
| 242 virtual void ViewSourceForFrame(WebContents* source, | 239 virtual void ViewSourceForFrame(WebContents* source, |
| 243 const GURL& url, | 240 const GURL& url, |
| 244 const std::string& content_state); | 241 const std::string& content_state); |
| 245 | 242 |
| 246 // Allows delegates to handle keyboard events before sending to the renderer. | 243 // Allows delegates to handle keyboard events before sending to the renderer. |
| (...skipping 22 matching lines...) Expand all Loading... |
| 269 // Render view drag n drop ended. | 266 // Render view drag n drop ended. |
| 270 virtual void DragEnded() {} | 267 virtual void DragEnded() {} |
| 271 | 268 |
| 272 // Shows the repost form confirmation dialog box. | 269 // Shows the repost form confirmation dialog box. |
| 273 virtual void ShowRepostFormWarningDialog(WebContents* source) {} | 270 virtual void ShowRepostFormWarningDialog(WebContents* source) {} |
| 274 | 271 |
| 275 // Allows delegate to override navigation to the history entries. | 272 // Allows delegate to override navigation to the history entries. |
| 276 // Returns true to allow WebContents to continue with the default processing. | 273 // Returns true to allow WebContents to continue with the default processing. |
| 277 virtual bool OnGoToEntryOffset(int offset); | 274 virtual bool OnGoToEntryOffset(int offset); |
| 278 | 275 |
| 279 // Returns the native window framing the view containing the WebContents. | |
| 280 virtual gfx::NativeWindow GetFrameNativeWindow(); | |
| 281 | |
| 282 // Allows delegate to control whether a WebContents will be created. Returns | 276 // Allows delegate to control whether a WebContents will be created. Returns |
| 283 // true to allow the creation. Default is to allow it. In cases where the | 277 // true to allow the creation. Default is to allow it. In cases where the |
| 284 // delegate handles the creation/navigation itself, it will use |target_url|. | 278 // delegate handles the creation/navigation itself, it will use |target_url|. |
| 285 virtual bool ShouldCreateWebContents( | 279 virtual bool ShouldCreateWebContents( |
| 286 WebContents* web_contents, | 280 WebContents* web_contents, |
| 287 int route_id, | 281 int route_id, |
| 288 WindowContainerType window_container_type, | 282 WindowContainerType window_container_type, |
| 289 const string16& frame_name, | 283 const string16& frame_name, |
| 290 const GURL& target_url); | 284 const GURL& target_url); |
| 291 | 285 |
| (...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 452 // Called when |this| is no longer the WebContentsDelegate for |source|. | 446 // Called when |this| is no longer the WebContentsDelegate for |source|. |
| 453 void Detach(WebContents* source); | 447 void Detach(WebContents* source); |
| 454 | 448 |
| 455 // The WebContents that this is currently a delegate for. | 449 // The WebContents that this is currently a delegate for. |
| 456 std::set<WebContents*> attached_contents_; | 450 std::set<WebContents*> attached_contents_; |
| 457 }; | 451 }; |
| 458 | 452 |
| 459 } // namespace content | 453 } // namespace content |
| 460 | 454 |
| 461 #endif // CONTENT_PUBLIC_BROWSER_WEB_CONTENTS_DELEGATE_H_ | 455 #endif // CONTENT_PUBLIC_BROWSER_WEB_CONTENTS_DELEGATE_H_ |
| OLD | NEW |