| 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 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 68 // RenderViewImpl is a diamond-shaped hierarchy, with WebWidgetClient at the | 68 // RenderViewImpl is a diamond-shaped hierarchy, with WebWidgetClient at the |
| 69 // root. VS warns when we inherit the WebWidgetClient method implementations | 69 // root. VS warns when we inherit the WebWidgetClient method implementations |
| 70 // from RenderWidget. It's safe to ignore that warning. | 70 // from RenderWidget. It's safe to ignore that warning. |
| 71 #pragma warning(disable: 4250) | 71 #pragma warning(disable: 4250) |
| 72 #endif | 72 #endif |
| 73 | 73 |
| 74 class CommandLine; | 74 class CommandLine; |
| 75 class PepperDeviceTest; | 75 class PepperDeviceTest; |
| 76 class SkBitmap; | 76 class SkBitmap; |
| 77 struct PP_NetAddress_Private; | 77 struct PP_NetAddress_Private; |
| 78 struct FrameMsg_Navigate_Params; | 78 struct ViewMsg_Navigate_Params; |
| 79 struct ViewMsg_PostMessage_Params; | 79 struct ViewMsg_PostMessage_Params; |
| 80 struct ViewMsg_StopFinding_Params; | 80 struct ViewMsg_StopFinding_Params; |
| 81 | 81 |
| 82 namespace ui { | 82 namespace ui { |
| 83 struct SelectedFileInfo; | 83 struct SelectedFileInfo; |
| 84 } // namespace ui | 84 } // namespace ui |
| 85 | 85 |
| 86 namespace blink { | 86 namespace blink { |
| 87 class WebApplicationCacheHost; | 87 class WebApplicationCacheHost; |
| 88 class WebApplicationCacheHostClient; | 88 class WebApplicationCacheHostClient; |
| (...skipping 708 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 797 FRIEND_TEST_ALL_PREFIXES(SuppressErrorPageTest, DoesNotSuppress); | 797 FRIEND_TEST_ALL_PREFIXES(SuppressErrorPageTest, DoesNotSuppress); |
| 798 | 798 |
| 799 typedef std::map<GURL, double> HostZoomLevels; | 799 typedef std::map<GURL, double> HostZoomLevels; |
| 800 | 800 |
| 801 enum ErrorPageType { | 801 enum ErrorPageType { |
| 802 DNS_ERROR, | 802 DNS_ERROR, |
| 803 HTTP_404, | 803 HTTP_404, |
| 804 CONNECTION_ERROR, | 804 CONNECTION_ERROR, |
| 805 }; | 805 }; |
| 806 | 806 |
| 807 static bool IsReload(const FrameMsg_Navigate_Params& params); | 807 static blink::WebReferrerPolicy GetReferrerPolicyFromRequest( |
| 808 blink::WebFrame* frame, |
| 809 const blink::WebURLRequest& request); |
| 808 | 810 |
| 809 static Referrer GetReferrerFromRequest( | 811 static Referrer GetReferrerFromRequest( |
| 810 blink::WebFrame* frame, | 812 blink::WebFrame* frame, |
| 811 const blink::WebURLRequest& request); | 813 const blink::WebURLRequest& request); |
| 812 | 814 |
| 813 static void NotifyTimezoneChange(blink::WebFrame* frame); | |
| 814 | |
| 815 void UpdateTitle(blink::WebFrame* frame, const base::string16& title, | 815 void UpdateTitle(blink::WebFrame* frame, const base::string16& title, |
| 816 blink::WebTextDirection title_direction); | 816 blink::WebTextDirection title_direction); |
| 817 void UpdateSessionHistory(blink::WebFrame* frame); | 817 void UpdateSessionHistory(blink::WebFrame* frame); |
| 818 void SendUpdateState(const blink::WebHistoryItem& item); | 818 void SendUpdateState(const blink::WebHistoryItem& item); |
| 819 | 819 |
| 820 // Update current main frame's encoding and send it to browser window. | 820 // Update current main frame's encoding and send it to browser window. |
| 821 // Since we want to let users see the right encoding info from menu | 821 // Since we want to let users see the right encoding info from menu |
| 822 // before finishing loading, we call the UpdateEncoding in | 822 // before finishing loading, we call the UpdateEncoding in |
| 823 // a) function:DidCommitLoadForFrame. When this function is called, | 823 // a) function:DidCommitLoadForFrame. When this function is called, |
| 824 // that means we have got first data. In here we try to get encoding | 824 // that means we have got first data. In here we try to get encoding |
| (...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 917 void OnGetSerializedHtmlDataForCurrentPageWithLocalLinks( | 917 void OnGetSerializedHtmlDataForCurrentPageWithLocalLinks( |
| 918 const std::vector<GURL>& links, | 918 const std::vector<GURL>& links, |
| 919 const std::vector<base::FilePath>& local_paths, | 919 const std::vector<base::FilePath>& local_paths, |
| 920 const base::FilePath& local_directory_name); | 920 const base::FilePath& local_directory_name); |
| 921 void OnMediaPlayerActionAt(const gfx::Point& location, | 921 void OnMediaPlayerActionAt(const gfx::Point& location, |
| 922 const blink::WebMediaPlayerAction& action); | 922 const blink::WebMediaPlayerAction& action); |
| 923 void OnOrientationChangeEvent(int orientation); | 923 void OnOrientationChangeEvent(int orientation); |
| 924 void OnPluginActionAt(const gfx::Point& location, | 924 void OnPluginActionAt(const gfx::Point& location, |
| 925 const blink::WebPluginAction& action); | 925 const blink::WebPluginAction& action); |
| 926 void OnMoveOrResizeStarted(); | 926 void OnMoveOrResizeStarted(); |
| 927 void OnNavigate(const ViewMsg_Navigate_Params& params); |
| 927 void OnPostMessageEvent(const ViewMsg_PostMessage_Params& params); | 928 void OnPostMessageEvent(const ViewMsg_PostMessage_Params& params); |
| 928 void OnReleaseDisambiguationPopupDIB(TransportDIB::Handle dib_handle); | 929 void OnReleaseDisambiguationPopupDIB(TransportDIB::Handle dib_handle); |
| 929 void OnReloadFrame(); | 930 void OnReloadFrame(); |
| 930 void OnResetPageEncodingToDefault(); | 931 void OnResetPageEncodingToDefault(); |
| 931 void OnScriptEvalRequest(const base::string16& frame_xpath, | 932 void OnScriptEvalRequest(const base::string16& frame_xpath, |
| 932 const base::string16& jscript, | 933 const base::string16& jscript, |
| 933 int id, | 934 int id, |
| 934 bool notify_result); | 935 bool notify_result); |
| 935 void OnSetAccessibilityMode(unsigned int new_mode); | 936 void OnSetAccessibilityMode(unsigned int new_mode); |
| 936 void OnSetActive(bool active); | 937 void OnSetActive(bool active); |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1017 blink::WebFrame* GetChildFrame(const base::string16& frame_xpath) const; | 1018 blink::WebFrame* GetChildFrame(const base::string16& frame_xpath) const; |
| 1018 | 1019 |
| 1019 // Returns the URL being loaded by the given frame's request. | 1020 // Returns the URL being loaded by the given frame's request. |
| 1020 GURL GetLoadingUrl(blink::WebFrame* frame) const; | 1021 GURL GetLoadingUrl(blink::WebFrame* frame) const; |
| 1021 | 1022 |
| 1022 // Should only be called if this object wraps a PluginDocument. | 1023 // Should only be called if this object wraps a PluginDocument. |
| 1023 blink::WebPlugin* GetWebPluginFromPluginDocument(); | 1024 blink::WebPlugin* GetWebPluginFromPluginDocument(); |
| 1024 | 1025 |
| 1025 // Returns true if the |params| navigation is to an entry that has been | 1026 // Returns true if the |params| navigation is to an entry that has been |
| 1026 // cropped due to a recent navigation the browser did not know about. | 1027 // cropped due to a recent navigation the browser did not know about. |
| 1027 bool IsBackForwardToStaleEntry(const FrameMsg_Navigate_Params& params, | 1028 bool IsBackForwardToStaleEntry(const ViewMsg_Navigate_Params& params, |
| 1028 bool is_reload); | 1029 bool is_reload); |
| 1029 | 1030 |
| 1030 // TODO(nasko): Remove this method when code is migrated to use | |
| 1031 // RenderFrameObserver. | |
| 1032 void OnNavigate(const FrameMsg_Navigate_Params& params); | |
| 1033 | |
| 1034 // Make this RenderView show an empty, unscriptable page. | 1031 // Make this RenderView show an empty, unscriptable page. |
| 1035 void NavigateToSwappedOutURL(blink::WebFrame* frame); | 1032 void NavigateToSwappedOutURL(blink::WebFrame* frame); |
| 1036 | 1033 |
| 1037 // If we initiated a navigation, this function will populate |document_state| | 1034 // If we initiated a navigation, this function will populate |document_state| |
| 1038 // with the navigation information saved in OnNavigate(). | 1035 // with the navigation information saved in OnNavigate(). |
| 1039 void PopulateDocumentStateFromPending(DocumentState* document_state); | 1036 void PopulateDocumentStateFromPending(DocumentState* document_state); |
| 1040 | 1037 |
| 1041 // Returns a new NavigationState populated with the navigation information | 1038 // Returns a new NavigationState populated with the navigation information |
| 1042 // saved in OnNavigate(). | 1039 // saved in OnNavigate(). |
| 1043 NavigationState* CreateNavigationStateFromPending(); | 1040 NavigationState* CreateNavigationStateFromPending(); |
| (...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1155 // because if the view grows beyond a size known to the browser, scroll bars | 1152 // because if the view grows beyond a size known to the browser, scroll bars |
| 1156 // should be drawn. | 1153 // should be drawn. |
| 1157 gfx::Size disable_scrollbars_size_limit_; | 1154 gfx::Size disable_scrollbars_size_limit_; |
| 1158 | 1155 |
| 1159 // Loading state ------------------------------------------------------------- | 1156 // Loading state ------------------------------------------------------------- |
| 1160 | 1157 |
| 1161 // True if the top level frame is currently being loaded. | 1158 // True if the top level frame is currently being loaded. |
| 1162 bool is_loading_; | 1159 bool is_loading_; |
| 1163 | 1160 |
| 1164 // The gesture that initiated the current navigation. | 1161 // The gesture that initiated the current navigation. |
| 1165 // TODO(nasko): Move to RenderFrame, as this is per-frame state. | |
| 1166 NavigationGesture navigation_gesture_; | 1162 NavigationGesture navigation_gesture_; |
| 1167 | 1163 |
| 1168 // Used for popups. | 1164 // Used for popups. |
| 1169 bool opened_by_user_gesture_; | 1165 bool opened_by_user_gesture_; |
| 1170 | 1166 |
| 1171 // Whether this RenderView was created by a frame that was suppressing its | 1167 // Whether this RenderView was created by a frame that was suppressing its |
| 1172 // opener. If so, we may want to load pages in a separate process. See | 1168 // opener. If so, we may want to load pages in a separate process. See |
| 1173 // decidePolicyForNavigation for details. | 1169 // decidePolicyForNavigation for details. |
| 1174 bool opener_suppressed_; | 1170 bool opener_suppressed_; |
| 1175 | 1171 |
| 1176 // Whether we must stop creating nested message loops for modal dialogs until | 1172 // Whether we must stop creating nested message loops for modal dialogs until |
| 1177 // OnSwapOut is called. This is necessary because modal dialogs have a | 1173 // OnSwapOut is called. This is necessary because modal dialogs have a |
| 1178 // PageGroupLoadDeferrer on the stack that interferes with swapping out. | 1174 // PageGroupLoadDeferrer on the stack that interferes with swapping out. |
| 1179 bool suppress_dialogs_until_swap_out_; | 1175 bool suppress_dialogs_until_swap_out_; |
| 1180 | 1176 |
| 1181 // Holds state pertaining to a navigation that we initiated. This is held by | 1177 // Holds state pertaining to a navigation that we initiated. This is held by |
| 1182 // the WebDataSource::ExtraData attribute. We use pending_navigation_state_ | 1178 // the WebDataSource::ExtraData attribute. We use pending_navigation_state_ |
| 1183 // as a temporary holder for the state until the WebDataSource corresponding | 1179 // as a temporary holder for the state until the WebDataSource corresponding |
| 1184 // to the new navigation is created. See DidCreateDataSource. | 1180 // to the new navigation is created. See DidCreateDataSource. |
| 1185 // TODO(nasko): Move to RenderFrame, as this is per-frame state. | 1181 scoped_ptr<ViewMsg_Navigate_Params> pending_navigation_params_; |
| 1186 scoped_ptr<FrameMsg_Navigate_Params> pending_navigation_params_; | |
| 1187 | 1182 |
| 1188 // Timer used to delay the updating of nav state (see SyncNavigationState). | 1183 // Timer used to delay the updating of nav state (see SyncNavigationState). |
| 1189 base::OneShotTimer<RenderViewImpl> nav_state_sync_timer_; | 1184 base::OneShotTimer<RenderViewImpl> nav_state_sync_timer_; |
| 1190 | 1185 |
| 1191 // Page IDs ------------------------------------------------------------------ | 1186 // Page IDs ------------------------------------------------------------------ |
| 1192 // See documentation in RenderView. | 1187 // See documentation in RenderView. |
| 1193 int32 page_id_; | 1188 int32 page_id_; |
| 1194 | 1189 |
| 1195 // Indicates the ID of the last page that we sent a FrameNavigate to the | 1190 // Indicates the ID of the last page that we sent a FrameNavigate to the |
| 1196 // browser for. This is used to determine if the most recent transition | 1191 // browser for. This is used to determine if the most recent transition |
| (...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1460 // use the Observer interface to filter IPC messages and receive frame change | 1455 // use the Observer interface to filter IPC messages and receive frame change |
| 1461 // notifications. | 1456 // notifications. |
| 1462 // --------------------------------------------------------------------------- | 1457 // --------------------------------------------------------------------------- |
| 1463 | 1458 |
| 1464 DISALLOW_COPY_AND_ASSIGN(RenderViewImpl); | 1459 DISALLOW_COPY_AND_ASSIGN(RenderViewImpl); |
| 1465 }; | 1460 }; |
| 1466 | 1461 |
| 1467 } // namespace content | 1462 } // namespace content |
| 1468 | 1463 |
| 1469 #endif // CONTENT_RENDERER_RENDER_VIEW_IMPL_H_ | 1464 #endif // CONTENT_RENDERER_RENDER_VIEW_IMPL_H_ |
| OLD | NEW |