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