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 #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 629 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 640 opened_by_user_gesture_(true), | 640 opened_by_user_gesture_(true), |
| 641 opener_suppressed_(false), | 641 opener_suppressed_(false), |
| 642 suppress_dialogs_until_swap_out_(false), | 642 suppress_dialogs_until_swap_out_(false), |
| 643 page_id_(-1), | 643 page_id_(-1), |
| 644 last_page_id_sent_to_browser_(-1), | 644 last_page_id_sent_to_browser_(-1), |
| 645 next_page_id_(params->next_page_id), | 645 next_page_id_(params->next_page_id), |
| 646 history_list_offset_(-1), | 646 history_list_offset_(-1), |
| 647 history_list_length_(0), | 647 history_list_length_(0), |
| 648 frames_in_progress_(0), | 648 frames_in_progress_(0), |
| 649 target_url_status_(TARGET_NONE), | 649 target_url_status_(TARGET_NONE), |
| 650 uses_temporary_zoom_level_(false), | |
| 650 #if defined(OS_ANDROID) | 651 #if defined(OS_ANDROID) |
| 651 top_controls_constraints_(cc::BOTH), | 652 top_controls_constraints_(cc::BOTH), |
| 652 #endif | 653 #endif |
| 653 has_scrolled_focused_editable_node_into_rect_(false), | 654 has_scrolled_focused_editable_node_into_rect_(false), |
| 654 push_messaging_dispatcher_(NULL), | 655 push_messaging_dispatcher_(NULL), |
| 655 speech_recognition_dispatcher_(NULL), | 656 speech_recognition_dispatcher_(NULL), |
| 656 media_stream_dispatcher_(NULL), | 657 media_stream_dispatcher_(NULL), |
| 657 browser_plugin_manager_(NULL), | 658 browser_plugin_manager_(NULL), |
| 658 midi_dispatcher_(NULL), | 659 midi_dispatcher_(NULL), |
| 659 devtools_agent_(NULL), | 660 devtools_agent_(NULL), |
| 660 accessibility_mode_(AccessibilityModeOff), | 661 accessibility_mode_(AccessibilityModeOff), |
| 661 renderer_accessibility_(NULL), | 662 renderer_accessibility_(NULL), |
| 662 mouse_lock_dispatcher_(NULL), | 663 mouse_lock_dispatcher_(NULL), |
| 663 #if defined(OS_ANDROID) | 664 #if defined(OS_ANDROID) |
| 664 expected_content_intent_id_(0), | 665 expected_content_intent_id_(0), |
| 665 #endif | 666 #endif |
| 666 #if defined(OS_WIN) | 667 #if defined(OS_WIN) |
| 667 focused_plugin_id_(-1), | 668 focused_plugin_id_(-1), |
| 668 #endif | 669 #endif |
| 669 #if defined(ENABLE_PLUGINS) | 670 #if defined(ENABLE_PLUGINS) |
| 670 plugin_find_handler_(NULL), | 671 plugin_find_handler_(NULL), |
| 671 focused_pepper_plugin_(NULL), | 672 focused_pepper_plugin_(NULL), |
| 672 pepper_last_mouse_event_target_(NULL), | 673 pepper_last_mouse_event_target_(NULL), |
| 673 #endif | 674 #endif |
| 674 enumeration_completion_id_(0), | 675 enumeration_completion_id_(0), |
| 675 session_storage_namespace_id_(params->session_storage_namespace_id), | 676 session_storage_namespace_id_(params->session_storage_namespace_id), |
| 676 next_snapshot_id_(0) { | 677 next_snapshot_id_(0) {} |
|
jam
2014/06/12 21:35:52
i believe this is something that is supposed to be
wjmaclean
2014/06/13 16:00:17
Done.
| |
| 677 } | |
| 678 | 678 |
| 679 void RenderViewImpl::Initialize(RenderViewImplParams* params) { | 679 void RenderViewImpl::Initialize(RenderViewImplParams* params) { |
| 680 routing_id_ = params->routing_id; | 680 routing_id_ = params->routing_id; |
| 681 surface_id_ = params->surface_id; | 681 surface_id_ = params->surface_id; |
| 682 if (params->opener_id != MSG_ROUTING_NONE && params->is_renderer_created) | 682 if (params->opener_id != MSG_ROUTING_NONE && params->is_renderer_created) |
| 683 opener_id_ = params->opener_id; | 683 opener_id_ = params->opener_id; |
| 684 | 684 |
| 685 // Ensure we start with a valid next_page_id_ from the browser. | 685 // Ensure we start with a valid next_page_id_ from the browser. |
| 686 DCHECK_GE(next_page_id_, 0); | 686 DCHECK_GE(next_page_id_, 0); |
| 687 | 687 |
| (...skipping 382 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1070 OnSetEditCommandsForNextKeyEvent) | 1070 OnSetEditCommandsForNextKeyEvent) |
| 1071 IPC_MESSAGE_HANDLER(FrameMsg_Navigate, OnNavigate) | 1071 IPC_MESSAGE_HANDLER(FrameMsg_Navigate, OnNavigate) |
| 1072 IPC_MESSAGE_HANDLER(ViewMsg_Stop, OnStop) | 1072 IPC_MESSAGE_HANDLER(ViewMsg_Stop, OnStop) |
| 1073 IPC_MESSAGE_HANDLER(ViewMsg_CopyImageAt, OnCopyImageAt) | 1073 IPC_MESSAGE_HANDLER(ViewMsg_CopyImageAt, OnCopyImageAt) |
| 1074 IPC_MESSAGE_HANDLER(ViewMsg_SaveImageAt, OnSaveImageAt) | 1074 IPC_MESSAGE_HANDLER(ViewMsg_SaveImageAt, OnSaveImageAt) |
| 1075 IPC_MESSAGE_HANDLER(ViewMsg_Find, OnFind) | 1075 IPC_MESSAGE_HANDLER(ViewMsg_Find, OnFind) |
| 1076 IPC_MESSAGE_HANDLER(ViewMsg_StopFinding, OnStopFinding) | 1076 IPC_MESSAGE_HANDLER(ViewMsg_StopFinding, OnStopFinding) |
| 1077 IPC_MESSAGE_HANDLER(ViewMsg_Zoom, OnZoom) | 1077 IPC_MESSAGE_HANDLER(ViewMsg_Zoom, OnZoom) |
| 1078 IPC_MESSAGE_HANDLER(ViewMsg_SetZoomLevelForLoadingURL, | 1078 IPC_MESSAGE_HANDLER(ViewMsg_SetZoomLevelForLoadingURL, |
| 1079 OnSetZoomLevelForLoadingURL) | 1079 OnSetZoomLevelForLoadingURL) |
| 1080 IPC_MESSAGE_HANDLER(ViewMsg_SetZoomLevelForView, | |
| 1081 OnSetZoomLevelForView) | |
| 1080 IPC_MESSAGE_HANDLER(ViewMsg_SetPageEncoding, OnSetPageEncoding) | 1082 IPC_MESSAGE_HANDLER(ViewMsg_SetPageEncoding, OnSetPageEncoding) |
| 1081 IPC_MESSAGE_HANDLER(ViewMsg_ResetPageEncodingToDefault, | 1083 IPC_MESSAGE_HANDLER(ViewMsg_ResetPageEncodingToDefault, |
| 1082 OnResetPageEncodingToDefault) | 1084 OnResetPageEncodingToDefault) |
| 1083 IPC_MESSAGE_HANDLER(ViewMsg_PostMessageEvent, OnPostMessageEvent) | 1085 IPC_MESSAGE_HANDLER(ViewMsg_PostMessageEvent, OnPostMessageEvent) |
| 1084 IPC_MESSAGE_HANDLER(DragMsg_TargetDragEnter, OnDragTargetDragEnter) | 1086 IPC_MESSAGE_HANDLER(DragMsg_TargetDragEnter, OnDragTargetDragEnter) |
| 1085 IPC_MESSAGE_HANDLER(DragMsg_TargetDragOver, OnDragTargetDragOver) | 1087 IPC_MESSAGE_HANDLER(DragMsg_TargetDragOver, OnDragTargetDragOver) |
| 1086 IPC_MESSAGE_HANDLER(DragMsg_TargetDragLeave, OnDragTargetDragLeave) | 1088 IPC_MESSAGE_HANDLER(DragMsg_TargetDragLeave, OnDragTargetDragLeave) |
| 1087 IPC_MESSAGE_HANDLER(DragMsg_TargetDrop, OnDragTargetDrop) | 1089 IPC_MESSAGE_HANDLER(DragMsg_TargetDrop, OnDragTargetDrop) |
| 1088 IPC_MESSAGE_HANDLER(DragMsg_SourceEnded, OnDragSourceEnded) | 1090 IPC_MESSAGE_HANDLER(DragMsg_SourceEnded, OnDragSourceEnded) |
| 1089 IPC_MESSAGE_HANDLER(DragMsg_SourceSystemDragEnded, | 1091 IPC_MESSAGE_HANDLER(DragMsg_SourceSystemDragEnded, |
| (...skipping 1543 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2633 void RenderViewImpl::OnSetZoomLevelForLoadingURL(const GURL& url, | 2635 void RenderViewImpl::OnSetZoomLevelForLoadingURL(const GURL& url, |
| 2634 double zoom_level) { | 2636 double zoom_level) { |
| 2635 #if !defined(OS_ANDROID) | 2637 #if !defined(OS_ANDROID) |
| 2636 // On Android, page zoom isn't used, and in case of WebView, text zoom is used | 2638 // On Android, page zoom isn't used, and in case of WebView, text zoom is used |
| 2637 // for legacy WebView text scaling emulation. Thus, the code that resets | 2639 // for legacy WebView text scaling emulation. Thus, the code that resets |
| 2638 // the zoom level from this map will be effectively resetting text zoom level. | 2640 // the zoom level from this map will be effectively resetting text zoom level. |
| 2639 host_zoom_levels_[url] = zoom_level; | 2641 host_zoom_levels_[url] = zoom_level; |
| 2640 #endif | 2642 #endif |
| 2641 } | 2643 } |
| 2642 | 2644 |
| 2645 void RenderViewImpl::OnSetZoomLevelForView(bool uses_temporary_zoom_level, | |
| 2646 double level) { | |
| 2647 uses_temporary_zoom_level_ = uses_temporary_zoom_level; | |
| 2648 | |
| 2649 webview()->hidePopups(); | |
| 2650 webview()->setZoomLevel(level); | |
| 2651 } | |
| 2652 | |
| 2643 void RenderViewImpl::OnSetPageEncoding(const std::string& encoding_name) { | 2653 void RenderViewImpl::OnSetPageEncoding(const std::string& encoding_name) { |
| 2644 webview()->setPageEncoding(WebString::fromUTF8(encoding_name)); | 2654 webview()->setPageEncoding(WebString::fromUTF8(encoding_name)); |
| 2645 } | 2655 } |
| 2646 | 2656 |
| 2647 void RenderViewImpl::OnResetPageEncodingToDefault() { | 2657 void RenderViewImpl::OnResetPageEncodingToDefault() { |
| 2648 WebString no_encoding; | 2658 WebString no_encoding; |
| 2649 webview()->setPageEncoding(no_encoding); | 2659 webview()->setPageEncoding(no_encoding); |
| 2650 } | 2660 } |
| 2651 | 2661 |
| 2652 void RenderViewImpl::OnPostMessageEvent( | 2662 void RenderViewImpl::OnPostMessageEvent( |
| (...skipping 1385 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 4038 std::vector<gfx::Size> sizes; | 4048 std::vector<gfx::Size> sizes; |
| 4039 ConvertToFaviconSizes(icon_urls[i].sizes(), &sizes); | 4049 ConvertToFaviconSizes(icon_urls[i].sizes(), &sizes); |
| 4040 if (!url.isEmpty()) | 4050 if (!url.isEmpty()) |
| 4041 urls.push_back( | 4051 urls.push_back( |
| 4042 FaviconURL(url, ToFaviconType(icon_urls[i].iconType()), sizes)); | 4052 FaviconURL(url, ToFaviconType(icon_urls[i].iconType()), sizes)); |
| 4043 } | 4053 } |
| 4044 SendUpdateFaviconURL(urls); | 4054 SendUpdateFaviconURL(urls); |
| 4045 } | 4055 } |
| 4046 | 4056 |
| 4047 } // namespace content | 4057 } // namespace content |
| OLD | NEW |