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

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: Remove 'anonymous'. Created 4 years, 7 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 429 matching lines...) Expand 10 before | Expand all | Expand 10 after
678 void OnResetPageEncodingToDefault(); 683 void OnResetPageEncodingToDefault();
679 void OnSetActive(bool active); 684 void OnSetActive(bool active);
680 void OnSetBackgroundOpaque(bool opaque); 685 void OnSetBackgroundOpaque(bool opaque);
681 void OnExitFullscreen(); 686 void OnExitFullscreen();
682 void OnSetHistoryOffsetAndLength(int history_offset, int history_length); 687 void OnSetHistoryOffsetAndLength(int history_offset, int history_length);
683 void OnSetInitialFocus(bool reverse); 688 void OnSetInitialFocus(bool reverse);
684 void OnSetPageEncoding(const std::string& encoding_name); 689 void OnSetPageEncoding(const std::string& encoding_name);
685 void OnSetRendererPrefs(const RendererPreferences& renderer_prefs); 690 void OnSetRendererPrefs(const RendererPreferences& renderer_prefs);
686 void OnSetWebUIProperty(const std::string& name, const std::string& value); 691 void OnSetWebUIProperty(const std::string& name, const std::string& value);
687 void OnSetZoomLevelForLoadingURL(const GURL& url, double zoom_level); 692 void OnSetZoomLevelForLoadingURL(const GURL& url, double zoom_level);
688 void OnSetZoomLevelForView(bool uses_temporary_zoom_level, double level); 693 void OnSuppressDialogsUntilSwapOut();
689 void OnThemeChanged(); 694 void OnThemeChanged();
690 void OnUpdateTargetURLAck(); 695 void OnUpdateTargetURLAck();
691 void OnUpdateWebPreferences(const WebPreferences& prefs); 696 void OnUpdateWebPreferences(const WebPreferences& prefs);
692 void OnSetPageScale(float page_scale_factor); 697 void OnSetPageScale(float page_scale_factor);
693 void OnZoom(PageZoom zoom); 698 void OnZoom(PageZoom zoom);
694 void OnForceRedraw(int request_id); 699 void OnForceRedraw(int request_id);
695 void OnSelectWordAroundCaret(); 700 void OnSelectWordAroundCaret();
696 #if defined(OS_ANDROID) 701 #if defined(OS_ANDROID)
697 void OnUndoScrollFocusedEditableNodeIntoRect(); 702 void OnUndoScrollFocusedEditableNodeIntoRect();
698 void OnUpdateTopControlsState(bool enable_hiding, 703 void OnUpdateTopControlsState(bool enable_hiding,
699 bool enable_showing, 704 bool enable_showing,
700 bool animate); 705 bool animate);
701 void OnExtractSmartClipData(const gfx::Rect& rect); 706 void OnExtractSmartClipData(const gfx::Rect& rect);
702 #elif defined(OS_MACOSX) 707 #elif defined(OS_MACOSX)
703 void OnGetRenderedText(); 708 void OnGetRenderedText();
704 #endif 709 #endif
705 710
706 // Page message handlers ----------------------------------------------------- 711 // Page message handlers -----------------------------------------------------
707 void OnUpdateWindowScreenRect(gfx::Rect window_screen_rect); 712 void OnUpdateWindowScreenRect(gfx::Rect window_screen_rect);
713 void OnSetZoomLevel(PageMsg_SetZoomLevel_Command command, double zoom_level);
708 714
709 // Adding a new message handler? Please add it in alphabetical order above 715 // Adding a new message handler? Please add it in alphabetical order above
710 // and put it in the same position in the .cc file. 716 // and put it in the same position in the .cc file.
711 717
712 // Misc private functions ---------------------------------------------------- 718 // Misc private functions ----------------------------------------------------
713 // Check whether the preferred size has changed. 719 // Check whether the preferred size has changed.
714 void CheckPreferredSize(); 720 void CheckPreferredSize();
715 721
716 // Gets the currently focused element, if any. 722 // Gets the currently focused element, if any.
717 blink::WebElement GetFocusedElement() const; 723 blink::WebElement GetFocusedElement() const;
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after
904 910
905 // Used to delay determining the preferred size (to avoid intermediate 911 // Used to delay determining the preferred size (to avoid intermediate
906 // states for the sizes). 912 // states for the sizes).
907 base::OneShotTimer check_preferred_size_timer_; 913 base::OneShotTimer check_preferred_size_timer_;
908 914
909 // Bookkeeping to suppress redundant scroll and focus requests for an already 915 // Bookkeeping to suppress redundant scroll and focus requests for an already
910 // scrolled and focused editable node. 916 // scrolled and focused editable node.
911 bool has_scrolled_focused_editable_node_into_rect_; 917 bool has_scrolled_focused_editable_node_into_rect_;
912 gfx::Rect rect_for_scrolled_focused_editable_node_; 918 gfx::Rect rect_for_scrolled_focused_editable_node_;
913 919
920 // Used to indicate the zoom level to be used during subframe loads, since
921 // they should match page zoom level.
922 double page_zoom_level_;
923
914 // Helper objects ------------------------------------------------------------ 924 // Helper objects ------------------------------------------------------------
915 925
916 RenderFrameImpl* main_render_frame_; 926 RenderFrameImpl* main_render_frame_;
917 927
918 // Note: RenderViewImpl is pulling double duty: it's the RenderWidget for the 928 // Note: RenderViewImpl is pulling double duty: it's the RenderWidget for the
919 // "view", but it's also the RenderWidget for the main frame. 929 // "view", but it's also the RenderWidget for the main frame.
920 blink::WebFrameWidget* frame_widget_; 930 blink::WebFrameWidget* frame_widget_;
921 931
922 // The next group of objects all implement RenderViewObserver, so are deleted 932 // The next group of objects all implement RenderViewObserver, so are deleted
923 // along with the RenderView automatically. This is why we just store 933 // along with the RenderView automatically. This is why we just store
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
1015 // use the Observer interface to filter IPC messages and receive frame change 1025 // use the Observer interface to filter IPC messages and receive frame change
1016 // notifications. 1026 // notifications.
1017 // --------------------------------------------------------------------------- 1027 // ---------------------------------------------------------------------------
1018 1028
1019 DISALLOW_COPY_AND_ASSIGN(RenderViewImpl); 1029 DISALLOW_COPY_AND_ASSIGN(RenderViewImpl);
1020 }; 1030 };
1021 1031
1022 } // namespace content 1032 } // namespace content
1023 1033
1024 #endif // CONTENT_RENDERER_RENDER_VIEW_IMPL_H_ 1034 #endif // CONTENT_RENDERER_RENDER_VIEW_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698