| 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 <stddef.h> | 8 #include <stddef.h> |
| 9 #include <stdint.h> | 9 #include <stdint.h> |
| 10 | 10 |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 #include "base/timer/timer.h" | 25 #include "base/timer/timer.h" |
| 26 #include "build/build_config.h" | 26 #include "build/build_config.h" |
| 27 #include "cc/input/top_controls_state.h" | 27 #include "cc/input/top_controls_state.h" |
| 28 #include "cc/resources/shared_bitmap.h" | 28 #include "cc/resources/shared_bitmap.h" |
| 29 #include "content/common/content_export.h" | 29 #include "content/common/content_export.h" |
| 30 #include "content/common/drag_event_source_info.h" | 30 #include "content/common/drag_event_source_info.h" |
| 31 #include "content/common/edit_command.h" | 31 #include "content/common/edit_command.h" |
| 32 #include "content/common/frame_message_enums.h" | 32 #include "content/common/frame_message_enums.h" |
| 33 #include "content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.h" | 33 #include "content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.h" |
| 34 #include "content/common/navigation_gesture.h" | 34 #include "content/common/navigation_gesture.h" |
| 35 #include "content/common/page_message_enums.h" |
| 35 #include "content/common/view_message_enums.h" | 36 #include "content/common/view_message_enums.h" |
| 36 #include "content/public/common/page_zoom.h" | 37 #include "content/public/common/page_zoom.h" |
| 37 #include "content/public/common/referrer.h" | 38 #include "content/public/common/referrer.h" |
| 38 #include "content/public/common/renderer_preferences.h" | 39 #include "content/public/common/renderer_preferences.h" |
| 39 #include "content/public/common/top_controls_state.h" | 40 #include "content/public/common/top_controls_state.h" |
| 40 #include "content/public/common/web_preferences.h" | 41 #include "content/public/common/web_preferences.h" |
| 41 #include "content/public/renderer/render_view.h" | 42 #include "content/public/renderer/render_view.h" |
| 42 #include "content/renderer/mouse_lock_dispatcher.h" | 43 #include "content/renderer/mouse_lock_dispatcher.h" |
| 43 #include "content/renderer/render_frame_impl.h" | 44 #include "content/renderer/render_frame_impl.h" |
| 44 #include "content/renderer/render_widget.h" | 45 #include "content/renderer/render_widget.h" |
| (...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 229 | 230 |
| 230 bool is_loading() const { return frames_in_progress_ != 0; } | 231 bool is_loading() const { return frames_in_progress_ != 0; } |
| 231 | 232 |
| 232 void FrameDidStartLoading(blink::WebFrame* frame); | 233 void FrameDidStartLoading(blink::WebFrame* frame); |
| 233 void FrameDidStopLoading(blink::WebFrame* frame); | 234 void FrameDidStopLoading(blink::WebFrame* frame); |
| 234 | 235 |
| 235 // Sets the zoom level and notifies observers. Doesn't call zoomLevelChanged, | 236 // Sets the zoom level and notifies observers. Doesn't call zoomLevelChanged, |
| 236 // as that is only for changes that aren't initiated by the client. | 237 // as that is only for changes that aren't initiated by the client. |
| 237 void SetZoomLevel(double zoom_level); | 238 void SetZoomLevel(double zoom_level); |
| 238 | 239 |
| 240 double page_zoom_level() { |
| 241 return page_zoom_level_; |
| 242 } |
| 243 |
| 239 // Indicates whether this page has been focused by the browser. | 244 // Indicates whether this page has been focused by the browser. |
| 240 bool has_focus() const { return has_focus_; } | 245 bool has_focus() const { return has_focus_; } |
| 241 | 246 |
| 242 // Sets page-level focus in this view and notifies plugins and Blink's | 247 // Sets page-level focus in this view and notifies plugins and Blink's |
| 243 // FocusController. | 248 // FocusController. |
| 244 void SetFocus(bool enable); | 249 void SetFocus(bool enable); |
| 245 | 250 |
| 246 void AttachWebFrameWidget(blink::WebFrameWidget* frame_widget); | 251 void AttachWebFrameWidget(blink::WebFrameWidget* frame_widget); |
| 247 | 252 |
| 248 // Plugin-related functions -------------------------------------------------- | 253 // Plugin-related functions -------------------------------------------------- |
| (...skipping 397 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 646 void OnResetPageEncodingToDefault(); | 651 void OnResetPageEncodingToDefault(); |
| 647 void OnSetActive(bool active); | 652 void OnSetActive(bool active); |
| 648 void OnSetBackgroundOpaque(bool opaque); | 653 void OnSetBackgroundOpaque(bool opaque); |
| 649 void OnExitFullscreen(); | 654 void OnExitFullscreen(); |
| 650 void OnSetHistoryOffsetAndLength(int history_offset, int history_length); | 655 void OnSetHistoryOffsetAndLength(int history_offset, int history_length); |
| 651 void OnSetInitialFocus(bool reverse); | 656 void OnSetInitialFocus(bool reverse); |
| 652 void OnSetPageEncoding(const std::string& encoding_name); | 657 void OnSetPageEncoding(const std::string& encoding_name); |
| 653 void OnSetRendererPrefs(const RendererPreferences& renderer_prefs); | 658 void OnSetRendererPrefs(const RendererPreferences& renderer_prefs); |
| 654 void OnSetWebUIProperty(const std::string& name, const std::string& value); | 659 void OnSetWebUIProperty(const std::string& name, const std::string& value); |
| 655 void OnSetZoomLevelForLoadingURL(const GURL& url, double zoom_level); | 660 void OnSetZoomLevelForLoadingURL(const GURL& url, double zoom_level); |
| 656 void OnSetZoomLevelForView(bool uses_temporary_zoom_level, double level); | 661 void OnSuppressDialogsUntilSwapOut(); |
| 657 void OnThemeChanged(); | 662 void OnThemeChanged(); |
| 658 void OnUpdateTargetURLAck(); | 663 void OnUpdateTargetURLAck(); |
| 659 void OnUpdateWebPreferences(const WebPreferences& prefs); | 664 void OnUpdateWebPreferences(const WebPreferences& prefs); |
| 660 void OnSetPageScale(float page_scale_factor); | 665 void OnSetPageScale(float page_scale_factor); |
| 661 void OnZoom(PageZoom zoom); | 666 void OnZoom(PageZoom zoom); |
| 662 void OnForceRedraw(int request_id); | 667 void OnForceRedraw(int request_id); |
| 663 void OnSelectWordAroundCaret(); | 668 void OnSelectWordAroundCaret(); |
| 664 #if defined(OS_ANDROID) | 669 #if defined(OS_ANDROID) |
| 665 void OnUndoScrollFocusedEditableNodeIntoRect(); | 670 void OnUndoScrollFocusedEditableNodeIntoRect(); |
| 666 void OnUpdateTopControlsState(bool enable_hiding, | 671 void OnUpdateTopControlsState(bool enable_hiding, |
| 667 bool enable_showing, | 672 bool enable_showing, |
| 668 bool animate); | 673 bool animate); |
| 669 void OnExtractSmartClipData(const gfx::Rect& rect); | 674 void OnExtractSmartClipData(const gfx::Rect& rect); |
| 670 #elif defined(OS_MACOSX) | 675 #elif defined(OS_MACOSX) |
| 671 void OnGetRenderedText(); | 676 void OnGetRenderedText(); |
| 672 #endif | 677 #endif |
| 673 | 678 |
| 674 // Page message handlers ----------------------------------------------------- | 679 // Page message handlers ----------------------------------------------------- |
| 675 void OnUpdateWindowScreenRect(gfx::Rect window_screen_rect); | 680 void OnUpdateWindowScreenRect(gfx::Rect window_screen_rect); |
| 681 void OnSetZoomLevel(PageMsg_SetZoomLevel_Command command, double zoom_level); |
| 676 | 682 |
| 677 // Adding a new message handler? Please add it in alphabetical order above | 683 // Adding a new message handler? Please add it in alphabetical order above |
| 678 // and put it in the same position in the .cc file. | 684 // and put it in the same position in the .cc file. |
| 679 | 685 |
| 680 // Misc private functions ---------------------------------------------------- | 686 // Misc private functions ---------------------------------------------------- |
| 681 // Check whether the preferred size has changed. | 687 // Check whether the preferred size has changed. |
| 682 void CheckPreferredSize(); | 688 void CheckPreferredSize(); |
| 683 | 689 |
| 684 // Gets the currently focused element, if any. | 690 // Gets the currently focused element, if any. |
| 685 blink::WebElement GetFocusedElement() const; | 691 blink::WebElement GetFocusedElement() const; |
| (...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 865 | 871 |
| 866 // Used to delay determining the preferred size (to avoid intermediate | 872 // Used to delay determining the preferred size (to avoid intermediate |
| 867 // states for the sizes). | 873 // states for the sizes). |
| 868 base::OneShotTimer check_preferred_size_timer_; | 874 base::OneShotTimer check_preferred_size_timer_; |
| 869 | 875 |
| 870 // Bookkeeping to suppress redundant scroll and focus requests for an already | 876 // Bookkeeping to suppress redundant scroll and focus requests for an already |
| 871 // scrolled and focused editable node. | 877 // scrolled and focused editable node. |
| 872 bool has_scrolled_focused_editable_node_into_rect_; | 878 bool has_scrolled_focused_editable_node_into_rect_; |
| 873 gfx::Rect rect_for_scrolled_focused_editable_node_; | 879 gfx::Rect rect_for_scrolled_focused_editable_node_; |
| 874 | 880 |
| 881 // Used to indicate the zoom level to be used during subframe loads, since |
| 882 // they should match page zoom level. |
| 883 double page_zoom_level_; |
| 884 |
| 875 // Helper objects ------------------------------------------------------------ | 885 // Helper objects ------------------------------------------------------------ |
| 876 | 886 |
| 877 RenderFrameImpl* main_render_frame_; | 887 RenderFrameImpl* main_render_frame_; |
| 878 | 888 |
| 879 // Note: RenderViewImpl is pulling double duty: it's the RenderWidget for the | 889 // Note: RenderViewImpl is pulling double duty: it's the RenderWidget for the |
| 880 // "view", but it's also the RenderWidget for the main frame. | 890 // "view", but it's also the RenderWidget for the main frame. |
| 881 blink::WebFrameWidget* frame_widget_; | 891 blink::WebFrameWidget* frame_widget_; |
| 882 | 892 |
| 883 // The next group of objects all implement RenderViewObserver, so are deleted | 893 // The next group of objects all implement RenderViewObserver, so are deleted |
| 884 // along with the RenderView automatically. This is why we just store | 894 // along with the RenderView automatically. This is why we just store |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 976 // use the Observer interface to filter IPC messages and receive frame change | 986 // use the Observer interface to filter IPC messages and receive frame change |
| 977 // notifications. | 987 // notifications. |
| 978 // --------------------------------------------------------------------------- | 988 // --------------------------------------------------------------------------- |
| 979 | 989 |
| 980 DISALLOW_COPY_AND_ASSIGN(RenderViewImpl); | 990 DISALLOW_COPY_AND_ASSIGN(RenderViewImpl); |
| 981 }; | 991 }; |
| 982 | 992 |
| 983 } // namespace content | 993 } // namespace content |
| 984 | 994 |
| 985 #endif // CONTENT_RENDERER_RENDER_VIEW_IMPL_H_ | 995 #endif // CONTENT_RENDERER_RENDER_VIEW_IMPL_H_ |
| OLD | NEW |