| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 CHROME_RENDERER_RENDER_VIEW_H_ | 5 #ifndef CHROME_RENDERER_RENDER_VIEW_H_ |
| 6 #define CHROME_RENDERER_RENDER_VIEW_H_ | 6 #define CHROME_RENDERER_RENDER_VIEW_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 84 // Creates a new RenderView. The parent_hwnd specifies a HWND to use as the | 84 // Creates a new RenderView. The parent_hwnd specifies a HWND to use as the |
| 85 // parent of the WebView HWND that will be created. The modal_dialog_event | 85 // parent of the WebView HWND that will be created. The modal_dialog_event |
| 86 // is set by the RenderView whenever a modal dialog alert is shown, so that | 86 // is set by the RenderView whenever a modal dialog alert is shown, so that |
| 87 // the renderer and plugin processes know to pump window messages. If this | 87 // the renderer and plugin processes know to pump window messages. If this |
| 88 // is a constrained popup or as a new tab, opener_id is the routing ID of the | 88 // is a constrained popup or as a new tab, opener_id is the routing ID of the |
| 89 // RenderView responsible for creating this RenderView (corresponding to the | 89 // RenderView responsible for creating this RenderView (corresponding to the |
| 90 // parent_hwnd). |counter| is either a currently initialized counter, or NULL | 90 // parent_hwnd). |counter| is either a currently initialized counter, or NULL |
| 91 // (in which case we treat this RenderView as a top level window). | 91 // (in which case we treat this RenderView as a top level window). |
| 92 static RenderView* Create( | 92 static RenderView* Create( |
| 93 RenderThreadBase* render_thread, | 93 RenderThreadBase* render_thread, |
| 94 HWND parent_hwnd, | 94 gfx::NativeViewId parent_hwnd, |
| 95 base::WaitableEvent* modal_dialog_event, // takes ownership | 95 base::WaitableEvent* modal_dialog_event, // takes ownership |
| 96 int32 opener_id, | 96 int32 opener_id, |
| 97 const WebPreferences& webkit_prefs, | 97 const WebPreferences& webkit_prefs, |
| 98 SharedRenderViewCounter* counter, | 98 SharedRenderViewCounter* counter, |
| 99 int32 routing_id); | 99 int32 routing_id); |
| 100 | 100 |
| 101 // Sets the "next page id" counter. | 101 // Sets the "next page id" counter. |
| 102 static void SetNextPageID(int32 next_page_id); | 102 static void SetNextPageID(int32 next_page_id); |
| 103 | 103 |
| 104 // The resource dispatcher used to fetch resources for this view. | 104 // The resource dispatcher used to fetch resources for this view. |
| 105 ResourceDispatcher* resource_dispatcher() { | 105 ResourceDispatcher* resource_dispatcher() { |
| 106 return resource_dispatcher_; | 106 return resource_dispatcher_; |
| 107 } | 107 } |
| 108 | 108 |
| 109 // May return NULL when the view is closing. | 109 // May return NULL when the view is closing. |
| 110 WebView* webview() const { | 110 WebView* webview() const { |
| 111 return static_cast<WebView*>(webwidget()); | 111 return static_cast<WebView*>(webwidget()); |
| 112 } | 112 } |
| 113 | 113 |
| 114 HWND host_window() const { | 114 gfx::NativeViewId host_window() const { |
| 115 return host_window_; | 115 return host_window_; |
| 116 } | 116 } |
| 117 | 117 |
| 118 base::WaitableEvent* modal_dialog_event() { | 118 base::WaitableEvent* modal_dialog_event() { |
| 119 return modal_dialog_event_.get(); | 119 return modal_dialog_event_.get(); |
| 120 } | 120 } |
| 121 | 121 |
| 122 // IPC::Channel::Listener | 122 // IPC::Channel::Listener |
| 123 virtual void OnMessageReceived(const IPC::Message& msg); | 123 virtual void OnMessageReceived(const IPC::Message& msg); |
| 124 | 124 |
| (...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 327 | 327 |
| 328 private: | 328 private: |
| 329 FRIEND_TEST(RenderViewTest, OnLoadAlternateHTMLText); | 329 FRIEND_TEST(RenderViewTest, OnLoadAlternateHTMLText); |
| 330 FRIEND_TEST(RenderViewTest, OnNavStateChanged); | 330 FRIEND_TEST(RenderViewTest, OnNavStateChanged); |
| 331 | 331 |
| 332 explicit RenderView(RenderThreadBase* render_thread); | 332 explicit RenderView(RenderThreadBase* render_thread); |
| 333 | 333 |
| 334 // Initializes this view with the given parent and ID. The |routing_id| can be | 334 // Initializes this view with the given parent and ID. The |routing_id| can be |
| 335 // set to 'MSG_ROUTING_NONE' if the true ID is not yet known. In this case, | 335 // set to 'MSG_ROUTING_NONE' if the true ID is not yet known. In this case, |
| 336 // CompleteInit must be called later with the true ID. | 336 // CompleteInit must be called later with the true ID. |
| 337 void Init(HWND parent, | 337 void Init(gfx::NativeViewId parent, |
| 338 base::WaitableEvent* modal_dialog_event, // takes ownership | 338 base::WaitableEvent* modal_dialog_event, // takes ownership |
| 339 int32 opener_id, | 339 int32 opener_id, |
| 340 const WebPreferences& webkit_prefs, | 340 const WebPreferences& webkit_prefs, |
| 341 SharedRenderViewCounter* counter, | 341 SharedRenderViewCounter* counter, |
| 342 int32 routing_id); | 342 int32 routing_id); |
| 343 | 343 |
| 344 void UpdateURL(WebFrame* frame); | 344 void UpdateURL(WebFrame* frame); |
| 345 void UpdateTitle(WebFrame* frame, const std::wstring& title); | 345 void UpdateTitle(WebFrame* frame, const std::wstring& title); |
| 346 void UpdateSessionHistory(WebFrame* frame); | 346 void UpdateSessionHistory(WebFrame* frame); |
| 347 | 347 |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 389 | 389 |
| 390 // Adds search provider from the given OpenSearch description URL as a | 390 // Adds search provider from the given OpenSearch description URL as a |
| 391 // keyword search. | 391 // keyword search. |
| 392 void AddGURLSearchProvider(const GURL& osd_url, bool autodetected); | 392 void AddGURLSearchProvider(const GURL& osd_url, bool autodetected); |
| 393 | 393 |
| 394 // Tells the browser process to navigate to a back/forward entry at the given | 394 // Tells the browser process to navigate to a back/forward entry at the given |
| 395 // offset from current. | 395 // offset from current. |
| 396 void GoToEntryAtOffset(int offset); | 396 void GoToEntryAtOffset(int offset); |
| 397 | 397 |
| 398 // RenderView IPC message handlers | 398 // RenderView IPC message handlers |
| 399 #if defined(OS_WIN) | 399 void OnCreatingNewAck(gfx::NativeViewId parent); |
| 400 void OnCreatingNewAck(HWND parent); | |
| 401 #else | |
| 402 void OnCreatingNewAck(); | |
| 403 #endif | |
| 404 void SendThumbnail(); | 400 void SendThumbnail(); |
| 405 void OnPrintPage(const ViewMsg_PrintPage_Params& params); | 401 void OnPrintPage(const ViewMsg_PrintPage_Params& params); |
| 406 void OnGetPrintedPagesCount(const ViewMsg_Print_Params& params); | 402 void OnGetPrintedPagesCount(const ViewMsg_Print_Params& params); |
| 407 void OnPrintPages(const ViewMsg_PrintPages_Params& params); | 403 void OnPrintPages(const ViewMsg_PrintPages_Params& params); |
| 408 void OnNavigate(const ViewMsg_Navigate_Params& params); | 404 void OnNavigate(const ViewMsg_Navigate_Params& params); |
| 409 void OnStop(); | 405 void OnStop(); |
| 410 void OnLoadAlternateHTMLText(const std::string& html_contents, | 406 void OnLoadAlternateHTMLText(const std::string& html_contents, |
| 411 bool new_navigation, | 407 bool new_navigation, |
| 412 const GURL& display_url, | 408 const GURL& display_url, |
| 413 const std::string& security_info); | 409 const std::string& security_info); |
| (...skipping 323 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 737 // Time in seconds of the delay between syncing page state such as form | 733 // Time in seconds of the delay between syncing page state such as form |
| 738 // elements and scroll position. This timeout allows us to avoid spamming the | 734 // elements and scroll position. This timeout allows us to avoid spamming the |
| 739 // browser process with every little thing that changes. This normally doesn't | 735 // browser process with every little thing that changes. This normally doesn't |
| 740 // change but is overridden by tests. | 736 // change but is overridden by tests. |
| 741 int delay_seconds_for_form_state_sync_; | 737 int delay_seconds_for_form_state_sync_; |
| 742 | 738 |
| 743 DISALLOW_COPY_AND_ASSIGN(RenderView); | 739 DISALLOW_COPY_AND_ASSIGN(RenderView); |
| 744 }; | 740 }; |
| 745 | 741 |
| 746 #endif // CHROME_RENDERER_RENDER_VIEW_H_ | 742 #endif // CHROME_RENDERER_RENDER_VIEW_H_ |
| OLD | NEW |