Chromium Code Reviews| 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_messages.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 preferred_subframe_zoom_level() { | |
| 241 return preferred_subframe_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 411 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 660 void OnResetPageEncodingToDefault(); | 665 void OnResetPageEncodingToDefault(); |
| 661 void OnSetActive(bool active); | 666 void OnSetActive(bool active); |
| 662 void OnSetBackgroundOpaque(bool opaque); | 667 void OnSetBackgroundOpaque(bool opaque); |
| 663 void OnExitFullscreen(); | 668 void OnExitFullscreen(); |
| 664 void OnSetHistoryOffsetAndLength(int history_offset, int history_length); | 669 void OnSetHistoryOffsetAndLength(int history_offset, int history_length); |
| 665 void OnSetInitialFocus(bool reverse); | 670 void OnSetInitialFocus(bool reverse); |
| 666 void OnSetPageEncoding(const std::string& encoding_name); | 671 void OnSetPageEncoding(const std::string& encoding_name); |
| 667 void OnSetRendererPrefs(const RendererPreferences& renderer_prefs); | 672 void OnSetRendererPrefs(const RendererPreferences& renderer_prefs); |
| 668 void OnSetWebUIProperty(const std::string& name, const std::string& value); | 673 void OnSetWebUIProperty(const std::string& name, const std::string& value); |
| 669 void OnSetZoomLevelForLoadingURL(const GURL& url, double zoom_level); | 674 void OnSetZoomLevelForLoadingURL(const GURL& url, double zoom_level); |
| 670 void OnSetZoomLevelForView(bool uses_temporary_zoom_level, double level); | |
| 671 void OnSuppressDialogsUntilSwapOut(); | 675 void OnSuppressDialogsUntilSwapOut(); |
| 672 void OnThemeChanged(); | 676 void OnThemeChanged(); |
| 673 void OnUpdateTargetURLAck(); | 677 void OnUpdateTargetURLAck(); |
| 674 void OnUpdateWebPreferences(const WebPreferences& prefs); | 678 void OnUpdateWebPreferences(const WebPreferences& prefs); |
| 675 void OnSetPageScale(float page_scale_factor); | 679 void OnSetPageScale(float page_scale_factor); |
| 676 void OnZoom(PageZoom zoom); | 680 void OnZoom(PageZoom zoom); |
| 677 void OnForceRedraw(int request_id); | 681 void OnForceRedraw(int request_id); |
| 678 void OnSelectWordAroundCaret(); | 682 void OnSelectWordAroundCaret(); |
| 679 #if defined(OS_ANDROID) | 683 #if defined(OS_ANDROID) |
| 680 void OnUndoScrollFocusedEditableNodeIntoRect(); | 684 void OnUndoScrollFocusedEditableNodeIntoRect(); |
| 681 void OnUpdateTopControlsState(bool enable_hiding, | 685 void OnUpdateTopControlsState(bool enable_hiding, |
| 682 bool enable_showing, | 686 bool enable_showing, |
| 683 bool animate); | 687 bool animate); |
| 684 void OnExtractSmartClipData(const gfx::Rect& rect); | 688 void OnExtractSmartClipData(const gfx::Rect& rect); |
| 685 #elif defined(OS_MACOSX) | 689 #elif defined(OS_MACOSX) |
| 686 void OnGetRenderedText(); | 690 void OnGetRenderedText(); |
| 687 void OnPluginImeCompositionCompleted(const base::string16& text, | 691 void OnPluginImeCompositionCompleted(const base::string16& text, |
| 688 int plugin_id); | 692 int plugin_id); |
| 689 void OnSetWindowVisibility(bool visible); | 693 void OnSetWindowVisibility(bool visible); |
| 690 void OnWindowFrameChanged(const gfx::Rect& window_frame, | 694 void OnWindowFrameChanged(const gfx::Rect& window_frame, |
| 691 const gfx::Rect& view_frame); | 695 const gfx::Rect& view_frame); |
| 692 #endif | 696 #endif |
| 693 | 697 |
| 694 // Page message handlers ----------------------------------------------------- | 698 // Page message handlers ----------------------------------------------------- |
| 695 void OnUpdateWindowScreenRect(gfx::Rect window_screen_rect); | 699 void OnUpdateWindowScreenRect(gfx::Rect window_screen_rect); |
| 700 void OnSetZoomLevelForView(PageMsg_SetZoomLevel_Command command, | |
| 701 double zoom_level); | |
| 696 | 702 |
| 697 // Adding a new message handler? Please add it in alphabetical order above | 703 // Adding a new message handler? Please add it in alphabetical order above |
| 698 // and put it in the same position in the .cc file. | 704 // and put it in the same position in the .cc file. |
| 699 | 705 |
| 700 // Misc private functions ---------------------------------------------------- | 706 // Misc private functions ---------------------------------------------------- |
| 701 // Check whether the preferred size has changed. | 707 // Check whether the preferred size has changed. |
| 702 void CheckPreferredSize(); | 708 void CheckPreferredSize(); |
| 703 | 709 |
| 704 // Gets the currently focused element, if any. | 710 // Gets the currently focused element, if any. |
| 705 blink::WebElement GetFocusedElement() const; | 711 blink::WebElement GetFocusedElement() const; |
| (...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 890 | 896 |
| 891 // Used to delay determining the preferred size (to avoid intermediate | 897 // Used to delay determining the preferred size (to avoid intermediate |
| 892 // states for the sizes). | 898 // states for the sizes). |
| 893 base::OneShotTimer check_preferred_size_timer_; | 899 base::OneShotTimer check_preferred_size_timer_; |
| 894 | 900 |
| 895 // Bookkeeping to suppress redundant scroll and focus requests for an already | 901 // Bookkeeping to suppress redundant scroll and focus requests for an already |
| 896 // scrolled and focused editable node. | 902 // scrolled and focused editable node. |
| 897 bool has_scrolled_focused_editable_node_into_rect_; | 903 bool has_scrolled_focused_editable_node_into_rect_; |
| 898 gfx::Rect rect_for_scrolled_focused_editable_node_; | 904 gfx::Rect rect_for_scrolled_focused_editable_node_; |
| 899 | 905 |
| 906 // Used to indicate the zoom level of the main-frame so that subframes can | |
|
alexmos
2016/04/07 23:48:08
nit: s/main-frame/main frame/
wjmaclean
2016/04/08 20:13:29
Done.
| |
| 907 // be displayed at the same zoom level. | |
| 908 double preferred_subframe_zoom_level_; | |
|
alexmos
2016/04/07 23:48:08
I'm not sure about this name - it makes it seem li
wjmaclean
2016/04/08 20:13:29
Done.
| |
| 909 | |
| 900 // Helper objects ------------------------------------------------------------ | 910 // Helper objects ------------------------------------------------------------ |
| 901 | 911 |
| 902 RenderFrameImpl* main_render_frame_; | 912 RenderFrameImpl* main_render_frame_; |
| 903 | 913 |
| 904 // Note: RenderViewImpl is pulling double duty: it's the RenderWidget for the | 914 // Note: RenderViewImpl is pulling double duty: it's the RenderWidget for the |
| 905 // "view", but it's also the RenderWidget for the main frame. | 915 // "view", but it's also the RenderWidget for the main frame. |
| 906 blink::WebFrameWidget* frame_widget_; | 916 blink::WebFrameWidget* frame_widget_; |
| 907 | 917 |
| 908 // The next group of objects all implement RenderViewObserver, so are deleted | 918 // The next group of objects all implement RenderViewObserver, so are deleted |
| 909 // along with the RenderView automatically. This is why we just store | 919 // along with the RenderView automatically. This is why we just store |
| (...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1007 // use the Observer interface to filter IPC messages and receive frame change | 1017 // use the Observer interface to filter IPC messages and receive frame change |
| 1008 // notifications. | 1018 // notifications. |
| 1009 // --------------------------------------------------------------------------- | 1019 // --------------------------------------------------------------------------- |
| 1010 | 1020 |
| 1011 DISALLOW_COPY_AND_ASSIGN(RenderViewImpl); | 1021 DISALLOW_COPY_AND_ASSIGN(RenderViewImpl); |
| 1012 }; | 1022 }; |
| 1013 | 1023 |
| 1014 } // namespace content | 1024 } // namespace content |
| 1015 | 1025 |
| 1016 #endif // CONTENT_RENDERER_RENDER_VIEW_IMPL_H_ | 1026 #endif // CONTENT_RENDERER_RENDER_VIEW_IMPL_H_ |
| OLD | NEW |