Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(86)

Side by Side Diff: content/renderer/render_view_impl.h

Issue 1804023002: Fix page zoom to be frame-centric for out-of-process frames. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase to master@{#386187}. Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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
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 OnSetZoomLevelForView(PageMsg_SetZoomLevel_Command command,
682 double zoom_level);
676 683
677 // Adding a new message handler? Please add it in alphabetical order above 684 // Adding a new message handler? Please add it in alphabetical order above
678 // and put it in the same position in the .cc file. 685 // and put it in the same position in the .cc file.
679 686
680 // Misc private functions ---------------------------------------------------- 687 // Misc private functions ----------------------------------------------------
681 // Check whether the preferred size has changed. 688 // Check whether the preferred size has changed.
682 void CheckPreferredSize(); 689 void CheckPreferredSize();
683 690
684 // Gets the currently focused element, if any. 691 // Gets the currently focused element, if any.
685 blink::WebElement GetFocusedElement() const; 692 blink::WebElement GetFocusedElement() const;
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after
865 872
866 // Used to delay determining the preferred size (to avoid intermediate 873 // Used to delay determining the preferred size (to avoid intermediate
867 // states for the sizes). 874 // states for the sizes).
868 base::OneShotTimer check_preferred_size_timer_; 875 base::OneShotTimer check_preferred_size_timer_;
869 876
870 // Bookkeeping to suppress redundant scroll and focus requests for an already 877 // Bookkeeping to suppress redundant scroll and focus requests for an already
871 // scrolled and focused editable node. 878 // scrolled and focused editable node.
872 bool has_scrolled_focused_editable_node_into_rect_; 879 bool has_scrolled_focused_editable_node_into_rect_;
873 gfx::Rect rect_for_scrolled_focused_editable_node_; 880 gfx::Rect rect_for_scrolled_focused_editable_node_;
874 881
882 // Used to indicate the zoom level to be used during subframes loads, since
883 // they should match page zoom level.
884 double page_zoom_level_;
885
875 // Helper objects ------------------------------------------------------------ 886 // Helper objects ------------------------------------------------------------
876 887
877 RenderFrameImpl* main_render_frame_; 888 RenderFrameImpl* main_render_frame_;
878 889
879 // Note: RenderViewImpl is pulling double duty: it's the RenderWidget for the 890 // Note: RenderViewImpl is pulling double duty: it's the RenderWidget for the
880 // "view", but it's also the RenderWidget for the main frame. 891 // "view", but it's also the RenderWidget for the main frame.
881 blink::WebFrameWidget* frame_widget_; 892 blink::WebFrameWidget* frame_widget_;
882 893
883 // The next group of objects all implement RenderViewObserver, so are deleted 894 // The next group of objects all implement RenderViewObserver, so are deleted
884 // along with the RenderView automatically. This is why we just store 895 // along with the RenderView automatically. This is why we just store
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
976 // use the Observer interface to filter IPC messages and receive frame change 987 // use the Observer interface to filter IPC messages and receive frame change
977 // notifications. 988 // notifications.
978 // --------------------------------------------------------------------------- 989 // ---------------------------------------------------------------------------
979 990
980 DISALLOW_COPY_AND_ASSIGN(RenderViewImpl); 991 DISALLOW_COPY_AND_ASSIGN(RenderViewImpl);
981 }; 992 };
982 993
983 } // namespace content 994 } // namespace content
984 995
985 #endif // CONTENT_RENDERER_RENDER_VIEW_IMPL_H_ 996 #endif // CONTENT_RENDERER_RENDER_VIEW_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698