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

Unified Diff: content/renderer/render_view_impl.cc

Issue 236733006: Allow the user to tap the selected editable again after rotation to trigger another zoom/center anim (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 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 side-by-side diff with in-line comments
Download patch
Index: content/renderer/render_view_impl.cc
diff --git a/content/renderer/render_view_impl.cc b/content/renderer/render_view_impl.cc
index ca1bb655aab848afc9f9f5954d22426a36961c66..eabb94b62a264233c37a885903077e3bdb72fb8e 100644
--- a/content/renderer/render_view_impl.cc
+++ b/content/renderer/render_view_impl.cc
@@ -665,6 +665,7 @@ RenderViewImpl::RenderViewImpl(RenderViewImplParams* params)
cached_has_main_frame_horizontal_scrollbar_(false),
cached_has_main_frame_vertical_scrollbar_(false),
has_scrolled_focused_editable_node_into_rect_(false),
+ is_orientation_changed_(false),
notification_provider_(NULL),
push_messaging_dispatcher_(NULL),
geolocation_dispatcher_(NULL),
@@ -1262,7 +1263,8 @@ void RenderViewImpl::OnMoveCaret(const gfx::Point& point) {
void RenderViewImpl::OnScrollFocusedEditableNodeIntoRect(
const gfx::Rect& rect) {
if (has_scrolled_focused_editable_node_into_rect_ &&
- rect == rect_for_scrolled_focused_editable_node_) {
+ rect == rect_for_scrolled_focused_editable_node_ &&
+ !is_orientation_changed_) {
return;
}
@@ -1270,6 +1272,7 @@ void RenderViewImpl::OnScrollFocusedEditableNodeIntoRect(
if (!element.isNull() && IsEditableNode(element)) {
rect_for_scrolled_focused_editable_node_ = rect;
has_scrolled_focused_editable_node_into_rect_ = true;
+ is_orientation_changed_ = false;
webview()->scrollFocusedNodeIntoRect(rect);
}
}
@@ -3347,6 +3350,7 @@ void RenderViewImpl::OnMediaPlayerActionAt(const gfx::Point& location,
void RenderViewImpl::OnOrientationChangeEvent(int orientation) {
// Screen has rotated. 0 = default (portrait), 90 = one turn right, and so on.
+ is_orientation_changed_ = true;
jdduke (slow) 2014/04/15 14:36:00 Why not just set |has_scrolled_focused_editable_no
jdduke (slow) 2014/04/16 14:51:40 Until we have a solution to the multiple resize pr
FOR_EACH_OBSERVER(RenderViewObserver,
observers_,
OrientationChangeEvent(orientation));

Powered by Google App Engine
This is Rietveld 408576698