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 #include "content/renderer/render_view_impl.h" | 5 #include "content/renderer/render_view_impl.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <cmath> | 8 #include <cmath> |
9 | 9 |
10 #include "base/auto_reset.h" | 10 #include "base/auto_reset.h" |
(...skipping 647 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
658 frames_in_progress_(0), | 658 frames_in_progress_(0), |
659 target_url_status_(TARGET_NONE), | 659 target_url_status_(TARGET_NONE), |
660 #if defined(OS_ANDROID) | 660 #if defined(OS_ANDROID) |
661 top_controls_constraints_(cc::BOTH), | 661 top_controls_constraints_(cc::BOTH), |
662 #endif | 662 #endif |
663 cached_is_main_frame_pinned_to_left_(false), | 663 cached_is_main_frame_pinned_to_left_(false), |
664 cached_is_main_frame_pinned_to_right_(false), | 664 cached_is_main_frame_pinned_to_right_(false), |
665 cached_has_main_frame_horizontal_scrollbar_(false), | 665 cached_has_main_frame_horizontal_scrollbar_(false), |
666 cached_has_main_frame_vertical_scrollbar_(false), | 666 cached_has_main_frame_vertical_scrollbar_(false), |
667 has_scrolled_focused_editable_node_into_rect_(false), | 667 has_scrolled_focused_editable_node_into_rect_(false), |
668 is_orientation_changed_(false), | |
668 notification_provider_(NULL), | 669 notification_provider_(NULL), |
669 push_messaging_dispatcher_(NULL), | 670 push_messaging_dispatcher_(NULL), |
670 geolocation_dispatcher_(NULL), | 671 geolocation_dispatcher_(NULL), |
671 input_tag_speech_dispatcher_(NULL), | 672 input_tag_speech_dispatcher_(NULL), |
672 speech_recognition_dispatcher_(NULL), | 673 speech_recognition_dispatcher_(NULL), |
673 media_stream_dispatcher_(NULL), | 674 media_stream_dispatcher_(NULL), |
674 browser_plugin_manager_(NULL), | 675 browser_plugin_manager_(NULL), |
675 media_stream_client_(NULL), | 676 media_stream_client_(NULL), |
676 web_user_media_client_(NULL), | 677 web_user_media_client_(NULL), |
677 midi_dispatcher_(NULL), | 678 midi_dispatcher_(NULL), |
(...skipping 577 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1255 return; | 1256 return; |
1256 | 1257 |
1257 Send(new ViewHostMsg_MoveCaret_ACK(routing_id_)); | 1258 Send(new ViewHostMsg_MoveCaret_ACK(routing_id_)); |
1258 | 1259 |
1259 webview()->focusedFrame()->moveCaretSelection(point); | 1260 webview()->focusedFrame()->moveCaretSelection(point); |
1260 } | 1261 } |
1261 | 1262 |
1262 void RenderViewImpl::OnScrollFocusedEditableNodeIntoRect( | 1263 void RenderViewImpl::OnScrollFocusedEditableNodeIntoRect( |
1263 const gfx::Rect& rect) { | 1264 const gfx::Rect& rect) { |
1264 if (has_scrolled_focused_editable_node_into_rect_ && | 1265 if (has_scrolled_focused_editable_node_into_rect_ && |
1265 rect == rect_for_scrolled_focused_editable_node_) { | 1266 rect == rect_for_scrolled_focused_editable_node_ && |
1267 !is_orientation_changed_) { | |
1266 return; | 1268 return; |
1267 } | 1269 } |
1268 | 1270 |
1269 blink::WebElement element = GetFocusedElement(); | 1271 blink::WebElement element = GetFocusedElement(); |
1270 if (!element.isNull() && IsEditableNode(element)) { | 1272 if (!element.isNull() && IsEditableNode(element)) { |
1271 rect_for_scrolled_focused_editable_node_ = rect; | 1273 rect_for_scrolled_focused_editable_node_ = rect; |
1272 has_scrolled_focused_editable_node_into_rect_ = true; | 1274 has_scrolled_focused_editable_node_into_rect_ = true; |
1275 is_orientation_changed_ = false; | |
1273 webview()->scrollFocusedNodeIntoRect(rect); | 1276 webview()->scrollFocusedNodeIntoRect(rect); |
1274 } | 1277 } |
1275 } | 1278 } |
1276 | 1279 |
1277 void RenderViewImpl::OnSetEditCommandsForNextKeyEvent( | 1280 void RenderViewImpl::OnSetEditCommandsForNextKeyEvent( |
1278 const EditCommands& edit_commands) { | 1281 const EditCommands& edit_commands) { |
1279 edit_commands_ = edit_commands; | 1282 edit_commands_ = edit_commands; |
1280 } | 1283 } |
1281 | 1284 |
1282 void RenderViewImpl::OnSetName(const std::string& name) { | 1285 void RenderViewImpl::OnSetName(const std::string& name) { |
(...skipping 2057 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3340 } | 3343 } |
3341 | 3344 |
3342 void RenderViewImpl::OnMediaPlayerActionAt(const gfx::Point& location, | 3345 void RenderViewImpl::OnMediaPlayerActionAt(const gfx::Point& location, |
3343 const WebMediaPlayerAction& action) { | 3346 const WebMediaPlayerAction& action) { |
3344 if (webview()) | 3347 if (webview()) |
3345 webview()->performMediaPlayerAction(action, location); | 3348 webview()->performMediaPlayerAction(action, location); |
3346 } | 3349 } |
3347 | 3350 |
3348 void RenderViewImpl::OnOrientationChangeEvent(int orientation) { | 3351 void RenderViewImpl::OnOrientationChangeEvent(int orientation) { |
3349 // Screen has rotated. 0 = default (portrait), 90 = one turn right, and so on. | 3352 // Screen has rotated. 0 = default (portrait), 90 = one turn right, and so on. |
3353 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
| |
3350 FOR_EACH_OBSERVER(RenderViewObserver, | 3354 FOR_EACH_OBSERVER(RenderViewObserver, |
3351 observers_, | 3355 observers_, |
3352 OrientationChangeEvent(orientation)); | 3356 OrientationChangeEvent(orientation)); |
3353 webview()->mainFrame()->sendOrientationChangeEvent(orientation); | 3357 webview()->mainFrame()->sendOrientationChangeEvent(orientation); |
3354 } | 3358 } |
3355 | 3359 |
3356 void RenderViewImpl::OnPluginActionAt(const gfx::Point& location, | 3360 void RenderViewImpl::OnPluginActionAt(const gfx::Point& location, |
3357 const WebPluginAction& action) { | 3361 const WebPluginAction& action) { |
3358 if (webview()) | 3362 if (webview()) |
3359 webview()->performPluginAction(action, location); | 3363 webview()->performPluginAction(action, location); |
(...skipping 1168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
4528 std::vector<gfx::Size> sizes(icon_urls[i].sizes().size()); | 4532 std::vector<gfx::Size> sizes(icon_urls[i].sizes().size()); |
4529 ConvertToFaviconSizes(icon_urls[i].sizes(), &sizes); | 4533 ConvertToFaviconSizes(icon_urls[i].sizes(), &sizes); |
4530 if (!url.isEmpty()) | 4534 if (!url.isEmpty()) |
4531 urls.push_back( | 4535 urls.push_back( |
4532 FaviconURL(url, ToFaviconType(icon_urls[i].iconType()), sizes)); | 4536 FaviconURL(url, ToFaviconType(icon_urls[i].iconType()), sizes)); |
4533 } | 4537 } |
4534 SendUpdateFaviconURL(urls); | 4538 SendUpdateFaviconURL(urls); |
4535 } | 4539 } |
4536 | 4540 |
4537 } // namespace content | 4541 } // namespace content |
OLD | NEW |