| 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 657 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 668 #if defined(OS_WIN) | 668 #if defined(OS_WIN) |
| 669 focused_plugin_id_(-1), | 669 focused_plugin_id_(-1), |
| 670 #endif | 670 #endif |
| 671 #if defined(ENABLE_PLUGINS) | 671 #if defined(ENABLE_PLUGINS) |
| 672 plugin_find_handler_(NULL), | 672 plugin_find_handler_(NULL), |
| 673 focused_pepper_plugin_(NULL), | 673 focused_pepper_plugin_(NULL), |
| 674 pepper_last_mouse_event_target_(NULL), | 674 pepper_last_mouse_event_target_(NULL), |
| 675 #endif | 675 #endif |
| 676 enumeration_completion_id_(0), | 676 enumeration_completion_id_(0), |
| 677 session_storage_namespace_id_(params->session_storage_namespace_id), | 677 session_storage_namespace_id_(params->session_storage_namespace_id), |
| 678 next_snapshot_id_(0) { | 678 next_snapshot_id_(0) {} |
| 679 } | |
| 680 | 679 |
| 681 void RenderViewImpl::Initialize(RenderViewImplParams* params) { | 680 void RenderViewImpl::Initialize(RenderViewImplParams* params) { |
| 682 routing_id_ = params->routing_id; | 681 routing_id_ = params->routing_id; |
| 683 surface_id_ = params->surface_id; | 682 surface_id_ = params->surface_id; |
| 684 if (params->opener_id != MSG_ROUTING_NONE && params->is_renderer_created) | 683 if (params->opener_id != MSG_ROUTING_NONE && params->is_renderer_created) |
| 685 opener_id_ = params->opener_id; | 684 opener_id_ = params->opener_id; |
| 686 | 685 |
| 687 // Ensure we start with a valid next_page_id_ from the browser. | 686 // Ensure we start with a valid next_page_id_ from the browser. |
| 688 DCHECK_GE(next_page_id_, 0); | 687 DCHECK_GE(next_page_id_, 0); |
| 689 | 688 |
| (...skipping 382 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1072 OnSetEditCommandsForNextKeyEvent) | 1071 OnSetEditCommandsForNextKeyEvent) |
| 1073 IPC_MESSAGE_HANDLER(FrameMsg_Navigate, OnNavigate) | 1072 IPC_MESSAGE_HANDLER(FrameMsg_Navigate, OnNavigate) |
| 1074 IPC_MESSAGE_HANDLER(ViewMsg_Stop, OnStop) | 1073 IPC_MESSAGE_HANDLER(ViewMsg_Stop, OnStop) |
| 1075 IPC_MESSAGE_HANDLER(ViewMsg_CopyImageAt, OnCopyImageAt) | 1074 IPC_MESSAGE_HANDLER(ViewMsg_CopyImageAt, OnCopyImageAt) |
| 1076 IPC_MESSAGE_HANDLER(ViewMsg_SaveImageAt, OnSaveImageAt) | 1075 IPC_MESSAGE_HANDLER(ViewMsg_SaveImageAt, OnSaveImageAt) |
| 1077 IPC_MESSAGE_HANDLER(ViewMsg_Find, OnFind) | 1076 IPC_MESSAGE_HANDLER(ViewMsg_Find, OnFind) |
| 1078 IPC_MESSAGE_HANDLER(ViewMsg_StopFinding, OnStopFinding) | 1077 IPC_MESSAGE_HANDLER(ViewMsg_StopFinding, OnStopFinding) |
| 1079 IPC_MESSAGE_HANDLER(ViewMsg_Zoom, OnZoom) | 1078 IPC_MESSAGE_HANDLER(ViewMsg_Zoom, OnZoom) |
| 1080 IPC_MESSAGE_HANDLER(ViewMsg_SetZoomLevelForLoadingURL, | 1079 IPC_MESSAGE_HANDLER(ViewMsg_SetZoomLevelForLoadingURL, |
| 1081 OnSetZoomLevelForLoadingURL) | 1080 OnSetZoomLevelForLoadingURL) |
| 1081 IPC_MESSAGE_HANDLER(ViewMsg_SetZoomLevelForView, |
| 1082 OnSetZoomLevelForView) |
| 1082 IPC_MESSAGE_HANDLER(ViewMsg_SetPageEncoding, OnSetPageEncoding) | 1083 IPC_MESSAGE_HANDLER(ViewMsg_SetPageEncoding, OnSetPageEncoding) |
| 1083 IPC_MESSAGE_HANDLER(ViewMsg_ResetPageEncodingToDefault, | 1084 IPC_MESSAGE_HANDLER(ViewMsg_ResetPageEncodingToDefault, |
| 1084 OnResetPageEncodingToDefault) | 1085 OnResetPageEncodingToDefault) |
| 1085 IPC_MESSAGE_HANDLER(ViewMsg_PostMessageEvent, OnPostMessageEvent) | 1086 IPC_MESSAGE_HANDLER(ViewMsg_PostMessageEvent, OnPostMessageEvent) |
| 1086 IPC_MESSAGE_HANDLER(DragMsg_TargetDragEnter, OnDragTargetDragEnter) | 1087 IPC_MESSAGE_HANDLER(DragMsg_TargetDragEnter, OnDragTargetDragEnter) |
| 1087 IPC_MESSAGE_HANDLER(DragMsg_TargetDragOver, OnDragTargetDragOver) | 1088 IPC_MESSAGE_HANDLER(DragMsg_TargetDragOver, OnDragTargetDragOver) |
| 1088 IPC_MESSAGE_HANDLER(DragMsg_TargetDragLeave, OnDragTargetDragLeave) | 1089 IPC_MESSAGE_HANDLER(DragMsg_TargetDragLeave, OnDragTargetDragLeave) |
| 1089 IPC_MESSAGE_HANDLER(DragMsg_TargetDrop, OnDragTargetDrop) | 1090 IPC_MESSAGE_HANDLER(DragMsg_TargetDrop, OnDragTargetDrop) |
| 1090 IPC_MESSAGE_HANDLER(DragMsg_SourceEnded, OnDragSourceEnded) | 1091 IPC_MESSAGE_HANDLER(DragMsg_SourceEnded, OnDragSourceEnded) |
| 1091 IPC_MESSAGE_HANDLER(DragMsg_SourceSystemDragEnded, | 1092 IPC_MESSAGE_HANDLER(DragMsg_SourceSystemDragEnded, |
| (...skipping 1559 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2651 void RenderViewImpl::OnSetZoomLevelForLoadingURL(const GURL& url, | 2652 void RenderViewImpl::OnSetZoomLevelForLoadingURL(const GURL& url, |
| 2652 double zoom_level) { | 2653 double zoom_level) { |
| 2653 #if !defined(OS_ANDROID) | 2654 #if !defined(OS_ANDROID) |
| 2654 // On Android, page zoom isn't used, and in case of WebView, text zoom is used | 2655 // On Android, page zoom isn't used, and in case of WebView, text zoom is used |
| 2655 // for legacy WebView text scaling emulation. Thus, the code that resets | 2656 // for legacy WebView text scaling emulation. Thus, the code that resets |
| 2656 // the zoom level from this map will be effectively resetting text zoom level. | 2657 // the zoom level from this map will be effectively resetting text zoom level. |
| 2657 host_zoom_levels_[url] = zoom_level; | 2658 host_zoom_levels_[url] = zoom_level; |
| 2658 #endif | 2659 #endif |
| 2659 } | 2660 } |
| 2660 | 2661 |
| 2662 void RenderViewImpl::OnSetZoomLevelForView(double level) { |
| 2663 webview()->hidePopups(); |
| 2664 webview()->setZoomLevel(level); |
| 2665 } |
| 2666 |
| 2661 void RenderViewImpl::OnSetPageEncoding(const std::string& encoding_name) { | 2667 void RenderViewImpl::OnSetPageEncoding(const std::string& encoding_name) { |
| 2662 webview()->setPageEncoding(WebString::fromUTF8(encoding_name)); | 2668 webview()->setPageEncoding(WebString::fromUTF8(encoding_name)); |
| 2663 } | 2669 } |
| 2664 | 2670 |
| 2665 void RenderViewImpl::OnResetPageEncodingToDefault() { | 2671 void RenderViewImpl::OnResetPageEncodingToDefault() { |
| 2666 WebString no_encoding; | 2672 WebString no_encoding; |
| 2667 webview()->setPageEncoding(no_encoding); | 2673 webview()->setPageEncoding(no_encoding); |
| 2668 } | 2674 } |
| 2669 | 2675 |
| 2670 void RenderViewImpl::OnPostMessageEvent( | 2676 void RenderViewImpl::OnPostMessageEvent( |
| (...skipping 1389 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4060 std::vector<gfx::Size> sizes; | 4066 std::vector<gfx::Size> sizes; |
| 4061 ConvertToFaviconSizes(icon_urls[i].sizes(), &sizes); | 4067 ConvertToFaviconSizes(icon_urls[i].sizes(), &sizes); |
| 4062 if (!url.isEmpty()) | 4068 if (!url.isEmpty()) |
| 4063 urls.push_back( | 4069 urls.push_back( |
| 4064 FaviconURL(url, ToFaviconType(icon_urls[i].iconType()), sizes)); | 4070 FaviconURL(url, ToFaviconType(icon_urls[i].iconType()), sizes)); |
| 4065 } | 4071 } |
| 4066 SendUpdateFaviconURL(urls); | 4072 SendUpdateFaviconURL(urls); |
| 4067 } | 4073 } |
| 4068 | 4074 |
| 4069 } // namespace content | 4075 } // namespace content |
| OLD | NEW |