| 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_WEB_CONTENTS_WEB_CONTENTS_IMPL_H_ | 5 #ifndef CONTENT_BROWSER_WEB_CONTENTS_WEB_CONTENTS_IMPL_H_ |
| 6 #define CONTENT_BROWSER_WEB_CONTENTS_WEB_CONTENTS_IMPL_H_ | 6 #define CONTENT_BROWSER_WEB_CONTENTS_WEB_CONTENTS_IMPL_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <set> | 9 #include <set> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 295 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 306 virtual const GURL& GetMainFrameLastCommittedURL() const OVERRIDE; | 306 virtual const GURL& GetMainFrameLastCommittedURL() const OVERRIDE; |
| 307 virtual void RenderFrameCreated(RenderFrameHost* render_frame_host) OVERRIDE; | 307 virtual void RenderFrameCreated(RenderFrameHost* render_frame_host) OVERRIDE; |
| 308 virtual void RenderFrameDeleted(RenderFrameHost* render_frame_host) OVERRIDE; | 308 virtual void RenderFrameDeleted(RenderFrameHost* render_frame_host) OVERRIDE; |
| 309 virtual void DidStartLoading(RenderFrameHost* render_frame_host, | 309 virtual void DidStartLoading(RenderFrameHost* render_frame_host, |
| 310 bool to_different_document) OVERRIDE; | 310 bool to_different_document) OVERRIDE; |
| 311 virtual void DidStopLoading(RenderFrameHost* render_frame_host) OVERRIDE; | 311 virtual void DidStopLoading(RenderFrameHost* render_frame_host) OVERRIDE; |
| 312 virtual void SwappedOut(RenderFrameHost* render_frame_host) OVERRIDE; | 312 virtual void SwappedOut(RenderFrameHost* render_frame_host) OVERRIDE; |
| 313 virtual void WorkerCrashed(RenderFrameHost* render_frame_host) OVERRIDE; | 313 virtual void WorkerCrashed(RenderFrameHost* render_frame_host) OVERRIDE; |
| 314 virtual void ShowContextMenu(RenderFrameHost* render_frame_host, | 314 virtual void ShowContextMenu(RenderFrameHost* render_frame_host, |
| 315 const ContextMenuParams& params) OVERRIDE; | 315 const ContextMenuParams& params) OVERRIDE; |
| 316 virtual void RunJavaScriptMessage(RenderFrameHost* rfh, |
| 317 const base::string16& message, |
| 318 const base::string16& default_prompt, |
| 319 const GURL& frame_url, |
| 320 JavaScriptMessageType type, |
| 321 IPC::Message* reply_msg) OVERRIDE; |
| 322 virtual void RunBeforeUnloadConfirm(RenderFrameHost* rfh, |
| 323 const base::string16& message, |
| 324 bool is_reload, |
| 325 IPC::Message* reply_msg) OVERRIDE; |
| 316 virtual WebContents* GetAsWebContents() OVERRIDE; | 326 virtual WebContents* GetAsWebContents() OVERRIDE; |
| 317 | 327 |
| 318 // RenderViewHostDelegate ---------------------------------------------------- | 328 // RenderViewHostDelegate ---------------------------------------------------- |
| 319 virtual RenderViewHostDelegateView* GetDelegateView() OVERRIDE; | 329 virtual RenderViewHostDelegateView* GetDelegateView() OVERRIDE; |
| 320 virtual bool OnMessageReceived(RenderViewHost* render_view_host, | 330 virtual bool OnMessageReceived(RenderViewHost* render_view_host, |
| 321 const IPC::Message& message) OVERRIDE; | 331 const IPC::Message& message) OVERRIDE; |
| 322 // RenderFrameHostDelegate has the same method, so list it there because this | 332 // RenderFrameHostDelegate has the same method, so list it there because this |
| 323 // interface is going away. | 333 // interface is going away. |
| 324 // virtual WebContents* GetAsWebContents() OVERRIDE; | 334 // virtual WebContents* GetAsWebContents() OVERRIDE; |
| 325 virtual gfx::Rect GetRootWindowResizerRect() const OVERRIDE; | 335 virtual gfx::Rect GetRootWindowResizerRect() const OVERRIDE; |
| (...skipping 21 matching lines...) Expand all Loading... |
| 347 virtual void DidAccessInitialDocument() OVERRIDE; | 357 virtual void DidAccessInitialDocument() OVERRIDE; |
| 348 virtual void DocumentAvailableInMainFrame( | 358 virtual void DocumentAvailableInMainFrame( |
| 349 RenderViewHost* render_view_host) OVERRIDE; | 359 RenderViewHost* render_view_host) OVERRIDE; |
| 350 virtual void DocumentOnLoadCompletedInMainFrame( | 360 virtual void DocumentOnLoadCompletedInMainFrame( |
| 351 RenderViewHost* render_view_host, | 361 RenderViewHost* render_view_host, |
| 352 int32 page_id) OVERRIDE; | 362 int32 page_id) OVERRIDE; |
| 353 virtual void RouteCloseEvent(RenderViewHost* rvh) OVERRIDE; | 363 virtual void RouteCloseEvent(RenderViewHost* rvh) OVERRIDE; |
| 354 virtual void RouteMessageEvent( | 364 virtual void RouteMessageEvent( |
| 355 RenderViewHost* rvh, | 365 RenderViewHost* rvh, |
| 356 const ViewMsg_PostMessage_Params& params) OVERRIDE; | 366 const ViewMsg_PostMessage_Params& params) OVERRIDE; |
| 357 virtual void RunJavaScriptMessage(RenderViewHost* rvh, | |
| 358 const base::string16& message, | |
| 359 const base::string16& default_prompt, | |
| 360 const GURL& frame_url, | |
| 361 JavaScriptMessageType type, | |
| 362 IPC::Message* reply_msg, | |
| 363 bool* did_suppress_message) OVERRIDE; | |
| 364 virtual void RunBeforeUnloadConfirm(RenderViewHost* rvh, | |
| 365 const base::string16& message, | |
| 366 bool is_reload, | |
| 367 IPC::Message* reply_msg) OVERRIDE; | |
| 368 virtual bool AddMessageToConsole(int32 level, | 367 virtual bool AddMessageToConsole(int32 level, |
| 369 const base::string16& message, | 368 const base::string16& message, |
| 370 int32 line_no, | 369 int32 line_no, |
| 371 const base::string16& source_id) OVERRIDE; | 370 const base::string16& source_id) OVERRIDE; |
| 372 virtual RendererPreferences GetRendererPrefs( | 371 virtual RendererPreferences GetRendererPrefs( |
| 373 BrowserContext* browser_context) const OVERRIDE; | 372 BrowserContext* browser_context) const OVERRIDE; |
| 374 virtual WebPreferences GetWebkitPrefs() OVERRIDE; | 373 virtual WebPreferences GetWebkitPrefs() OVERRIDE; |
| 375 virtual void OnUserGesture() OVERRIDE; | 374 virtual void OnUserGesture() OVERRIDE; |
| 376 virtual void OnIgnoredUIEvent() OVERRIDE; | 375 virtual void OnIgnoredUIEvent() OVERRIDE; |
| 377 virtual void RendererUnresponsive(RenderViewHost* render_view_host, | 376 virtual void RendererUnresponsive(RenderViewHost* render_view_host, |
| (...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 638 void OnWebContentsDestroyed(WebContentsImpl* web_contents); | 637 void OnWebContentsDestroyed(WebContentsImpl* web_contents); |
| 639 | 638 |
| 640 // Creates and adds to the map a destruction observer watching |web_contents|. | 639 // Creates and adds to the map a destruction observer watching |web_contents|. |
| 641 // No-op if such an observer already exists. | 640 // No-op if such an observer already exists. |
| 642 void AddDestructionObserver(WebContentsImpl* web_contents); | 641 void AddDestructionObserver(WebContentsImpl* web_contents); |
| 643 | 642 |
| 644 // Deletes and removes from the map a destruction observer | 643 // Deletes and removes from the map a destruction observer |
| 645 // watching |web_contents|. No-op if there is no such observer. | 644 // watching |web_contents|. No-op if there is no such observer. |
| 646 void RemoveDestructionObserver(WebContentsImpl* web_contents); | 645 void RemoveDestructionObserver(WebContentsImpl* web_contents); |
| 647 | 646 |
| 648 // Callback function when showing JS dialogs. | 647 // Callback function when showing JavaScript dialogs. |
| 649 void OnDialogClosed(RenderViewHost* rvh, | 648 void OnDialogClosed(RenderFrameHost* rfh, |
| 650 IPC::Message* reply_msg, | 649 IPC::Message* reply_msg, |
| 650 bool dialog_was_suppressed, |
| 651 bool success, | 651 bool success, |
| 652 const base::string16& user_input); | 652 const base::string16& user_input); |
| 653 | 653 |
| 654 // Callback function when requesting permission to access the PPAPI broker. | 654 // Callback function when requesting permission to access the PPAPI broker. |
| 655 // |result| is true if permission was granted. | 655 // |result| is true if permission was granted. |
| 656 void OnPpapiBrokerPermissionResult(int routing_id, bool result); | 656 void OnPpapiBrokerPermissionResult(int routing_id, bool result); |
| 657 | 657 |
| 658 bool OnMessageReceived(RenderViewHost* render_view_host, | 658 bool OnMessageReceived(RenderViewHost* render_view_host, |
| 659 RenderFrameHost* render_frame_host, | 659 RenderFrameHost* render_frame_host, |
| 660 const IPC::Message& message); | 660 const IPC::Message& message); |
| (...skipping 383 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1044 int fullscreen_widget_routing_id_; | 1044 int fullscreen_widget_routing_id_; |
| 1045 | 1045 |
| 1046 // Maps the ids of pending image downloads to their callbacks | 1046 // Maps the ids of pending image downloads to their callbacks |
| 1047 typedef std::map<int, ImageDownloadCallback> ImageDownloadMap; | 1047 typedef std::map<int, ImageDownloadCallback> ImageDownloadMap; |
| 1048 ImageDownloadMap image_download_map_; | 1048 ImageDownloadMap image_download_map_; |
| 1049 | 1049 |
| 1050 // Whether this WebContents is responsible for displaying a subframe in a | 1050 // Whether this WebContents is responsible for displaying a subframe in a |
| 1051 // different process from its parent page. | 1051 // different process from its parent page. |
| 1052 bool is_subframe_; | 1052 bool is_subframe_; |
| 1053 | 1053 |
| 1054 // Whether the last JavaScript dialog shown was suppressed. Used for testing. |
| 1055 bool last_dialog_suppressed_; |
| 1056 |
| 1054 DISALLOW_COPY_AND_ASSIGN(WebContentsImpl); | 1057 DISALLOW_COPY_AND_ASSIGN(WebContentsImpl); |
| 1055 }; | 1058 }; |
| 1056 | 1059 |
| 1057 } // namespace content | 1060 } // namespace content |
| 1058 | 1061 |
| 1059 #endif // CONTENT_BROWSER_WEB_CONTENTS_WEB_CONTENTS_IMPL_H_ | 1062 #endif // CONTENT_BROWSER_WEB_CONTENTS_WEB_CONTENTS_IMPL_H_ |
| OLD | NEW |