| 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_RENDERER_RENDER_VIEW_IMPL_H_ | 5 #ifndef CONTENT_RENDERER_RENDER_VIEW_IMPL_H_ |
| 6 #define CONTENT_RENDERER_RENDER_VIEW_IMPL_H_ | 6 #define CONTENT_RENDERER_RENDER_VIEW_IMPL_H_ |
| 7 | 7 |
| 8 #include <deque> | 8 #include <deque> |
| 9 #include <map> | 9 #include <map> |
| 10 #include <set> | 10 #include <set> |
| (...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 232 const WebKit::WebScreenInfo& screen_info, | 232 const WebKit::WebScreenInfo& screen_info, |
| 233 content::old::GuestToEmbedderChannel* guest_to_embedder_channel, | 233 content::old::GuestToEmbedderChannel* guest_to_embedder_channel, |
| 234 AccessibilityMode accessibility_mode); | 234 AccessibilityMode accessibility_mode); |
| 235 | 235 |
| 236 // Returns the RenderViewImpl containing the given WebView. | 236 // Returns the RenderViewImpl containing the given WebView. |
| 237 CONTENT_EXPORT static RenderViewImpl* FromWebView(WebKit::WebView* webview); | 237 CONTENT_EXPORT static RenderViewImpl* FromWebView(WebKit::WebView* webview); |
| 238 | 238 |
| 239 // May return NULL when the view is closing. | 239 // May return NULL when the view is closing. |
| 240 CONTENT_EXPORT WebKit::WebView* webview() const; | 240 CONTENT_EXPORT WebKit::WebView* webview() const; |
| 241 | 241 |
| 242 // If this is a swapped out RenderView, which maintains a copy of the frame |
| 243 // tree of an active RenderView, we keep a map from frame ids in this view to |
| 244 // the frame ids of the active view for each corresponding frame. |
| 245 // This method uses the map to find the frame in this RenderView that |
| 246 // corresponds to the frame in the active RenderView specified by |frame_id|. |
| 247 WebKit::WebFrame* GetFrameByMappedID(int remote_frame_id); |
| 248 |
| 242 // WebGraphicsContext3DSwapBuffersClient implementation. | 249 // WebGraphicsContext3DSwapBuffersClient implementation. |
| 243 | 250 |
| 244 // Called by a GraphicsContext associated with this view when swapbuffers | 251 // Called by a GraphicsContext associated with this view when swapbuffers |
| 245 // is posted, completes or is aborted. | 252 // is posted, completes or is aborted. |
| 246 virtual void OnViewContextSwapBuffersPosted() OVERRIDE; | 253 virtual void OnViewContextSwapBuffersPosted() OVERRIDE; |
| 247 virtual void OnViewContextSwapBuffersComplete() OVERRIDE; | 254 virtual void OnViewContextSwapBuffersComplete() OVERRIDE; |
| 248 virtual void OnViewContextSwapBuffersAborted() OVERRIDE; | 255 virtual void OnViewContextSwapBuffersAborted() OVERRIDE; |
| 249 | 256 |
| 250 int history_list_offset() const { return history_list_offset_; } | 257 int history_list_offset() const { return history_list_offset_; } |
| 251 | 258 |
| (...skipping 614 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 866 | 873 |
| 867 // Do not delete directly. This class is reference counted. | 874 // Do not delete directly. This class is reference counted. |
| 868 virtual ~RenderViewImpl(); | 875 virtual ~RenderViewImpl(); |
| 869 | 876 |
| 870 void UpdateURL(WebKit::WebFrame* frame); | 877 void UpdateURL(WebKit::WebFrame* frame); |
| 871 void UpdateTitle(WebKit::WebFrame* frame, const string16& title, | 878 void UpdateTitle(WebKit::WebFrame* frame, const string16& title, |
| 872 WebKit::WebTextDirection title_direction); | 879 WebKit::WebTextDirection title_direction); |
| 873 void UpdateSessionHistory(WebKit::WebFrame* frame); | 880 void UpdateSessionHistory(WebKit::WebFrame* frame); |
| 874 void SendUpdateState(const WebKit::WebHistoryItem& item); | 881 void SendUpdateState(const WebKit::WebHistoryItem& item); |
| 875 | 882 |
| 883 // Update the frame tree. |
| 884 void UpdateFrameTree(int process_id, |
| 885 int route_id, |
| 886 const std::string& frame_tree); |
| 887 |
| 876 // Update current main frame's encoding and send it to browser window. | 888 // Update current main frame's encoding and send it to browser window. |
| 877 // Since we want to let users see the right encoding info from menu | 889 // Since we want to let users see the right encoding info from menu |
| 878 // before finishing loading, we call the UpdateEncoding in | 890 // before finishing loading, we call the UpdateEncoding in |
| 879 // a) function:DidCommitLoadForFrame. When this function is called, | 891 // a) function:DidCommitLoadForFrame. When this function is called, |
| 880 // that means we have got first data. In here we try to get encoding | 892 // that means we have got first data. In here we try to get encoding |
| 881 // of page if it has been specified in http header. | 893 // of page if it has been specified in http header. |
| 882 // b) function:DidReceiveTitle. When this function is called, | 894 // b) function:DidReceiveTitle. When this function is called, |
| 883 // that means we have got specified title. Because in most of webpages, | 895 // that means we have got specified title. Because in most of webpages, |
| 884 // title tags will follow meta tags. In here we try to get encoding of | 896 // title tags will follow meta tags. In here we try to get encoding of |
| 885 // page if it has been specified in meta tag. | 897 // page if it has been specified in meta tag. |
| (...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1083 // serialized form. | 1095 // serialized form. |
| 1084 // This is used when a frame is going to be removed from the tree. | 1096 // This is used when a frame is going to be removed from the tree. |
| 1085 void SendUpdatedFrameTree(WebKit::WebFrame* exclude_frame_subtree); | 1097 void SendUpdatedFrameTree(WebKit::WebFrame* exclude_frame_subtree); |
| 1086 | 1098 |
| 1087 // Recursively creates a DOM frame tree starting with |frame|, based on | 1099 // Recursively creates a DOM frame tree starting with |frame|, based on |
| 1088 // |frame_tree|. For each node, the frame is navigated to the swapped out URL, | 1100 // |frame_tree|. For each node, the frame is navigated to the swapped out URL, |
| 1089 // the name (if present) is set on it, and all the subframes are created | 1101 // the name (if present) is set on it, and all the subframes are created |
| 1090 // and added to the DOM. | 1102 // and added to the DOM. |
| 1091 void CreateFrameTree(WebKit::WebFrame* frame, DictionaryValue* frame_tree); | 1103 void CreateFrameTree(WebKit::WebFrame* frame, DictionaryValue* frame_tree); |
| 1092 | 1104 |
| 1093 // If this is a swapped out RenderView, which maintains a copy of the frame | |
| 1094 // tree of an active RenderView, we keep a map from frame ids in this view to | |
| 1095 // the frame ids of the active view for each corresponding frame. | |
| 1096 // This method uses the map to find the frame in this RenderView that | |
| 1097 // corresponds to the frame in the active RenderView specified by |frame_id|. | |
| 1098 WebKit::WebFrame* GetFrameByMappedID(int frame_id); | |
| 1099 | |
| 1100 void EnsureMediaStreamImpl(); | 1105 void EnsureMediaStreamImpl(); |
| 1101 | 1106 |
| 1102 // This callback is triggered when DownloadFavicon completes, either | 1107 // This callback is triggered when DownloadFavicon completes, either |
| 1103 // succesfully or with a failure. See DownloadFavicon for more | 1108 // succesfully or with a failure. See DownloadFavicon for more |
| 1104 // details. | 1109 // details. |
| 1105 void DidDownloadFavicon(webkit_glue::ImageResourceFetcher* fetcher, | 1110 void DidDownloadFavicon(webkit_glue::ImageResourceFetcher* fetcher, |
| 1106 const SkBitmap& image); | 1111 const SkBitmap& image); |
| 1107 | 1112 |
| 1108 // Requests to download a favicon image. When done, the RenderView is notified | 1113 // Requests to download a favicon image. When done, the RenderView is notified |
| 1109 // by way of DidDownloadFavicon. Returns true if the request was successfully | 1114 // by way of DidDownloadFavicon. Returns true if the request was successfully |
| (...skipping 464 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1574 // bunch of stuff, you should probably create a helper class and put your | 1579 // bunch of stuff, you should probably create a helper class and put your |
| 1575 // data and methods on that to avoid bloating RenderView more. You can | 1580 // data and methods on that to avoid bloating RenderView more. You can |
| 1576 // use the Observer interface to filter IPC messages and receive frame change | 1581 // use the Observer interface to filter IPC messages and receive frame change |
| 1577 // notifications. | 1582 // notifications. |
| 1578 // --------------------------------------------------------------------------- | 1583 // --------------------------------------------------------------------------- |
| 1579 | 1584 |
| 1580 DISALLOW_COPY_AND_ASSIGN(RenderViewImpl); | 1585 DISALLOW_COPY_AND_ASSIGN(RenderViewImpl); |
| 1581 }; | 1586 }; |
| 1582 | 1587 |
| 1583 #endif // CONTENT_RENDERER_RENDER_VIEW_IMPL_H_ | 1588 #endif // CONTENT_RENDERER_RENDER_VIEW_IMPL_H_ |
| OLD | NEW |