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

Side by Side Diff: content/renderer/render_view_impl.cc

Issue 302603012: Zoom Extension API (content changes) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Additions to HostZoomMap API. Created 6 years, 6 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 | Annotate | Revision Log
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 #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 653 matching lines...) Expand 10 before | Expand all | Expand 10 after
664 #if defined(OS_WIN) 664 #if defined(OS_WIN)
665 focused_plugin_id_(-1), 665 focused_plugin_id_(-1),
666 #endif 666 #endif
667 #if defined(ENABLE_PLUGINS) 667 #if defined(ENABLE_PLUGINS)
668 plugin_find_handler_(NULL), 668 plugin_find_handler_(NULL),
669 focused_pepper_plugin_(NULL), 669 focused_pepper_plugin_(NULL),
670 pepper_last_mouse_event_target_(NULL), 670 pepper_last_mouse_event_target_(NULL),
671 #endif 671 #endif
672 enumeration_completion_id_(0), 672 enumeration_completion_id_(0),
673 session_storage_namespace_id_(params->session_storage_namespace_id), 673 session_storage_namespace_id_(params->session_storage_namespace_id),
674 next_snapshot_id_(0) { 674 next_snapshot_id_(0) {}
Fady Samuel 2014/06/09 15:43:21 Can we undo this change?
wjmaclean 2014/06/09 17:23:29 Done. Leftover debugging artifact I suspect.
675 }
676 675
677 void RenderViewImpl::Initialize(RenderViewImplParams* params) { 676 void RenderViewImpl::Initialize(RenderViewImplParams* params) {
678 routing_id_ = params->routing_id; 677 routing_id_ = params->routing_id;
679 surface_id_ = params->surface_id; 678 surface_id_ = params->surface_id;
680 if (params->opener_id != MSG_ROUTING_NONE && params->is_renderer_created) 679 if (params->opener_id != MSG_ROUTING_NONE && params->is_renderer_created)
681 opener_id_ = params->opener_id; 680 opener_id_ = params->opener_id;
682 681
683 // Ensure we start with a valid next_page_id_ from the browser. 682 // Ensure we start with a valid next_page_id_ from the browser.
684 DCHECK_GE(next_page_id_, 0); 683 DCHECK_GE(next_page_id_, 0);
685 684
(...skipping 380 matching lines...) Expand 10 before | Expand all | Expand 10 after
1066 OnSetEditCommandsForNextKeyEvent) 1065 OnSetEditCommandsForNextKeyEvent)
1067 IPC_MESSAGE_HANDLER(FrameMsg_Navigate, OnNavigate) 1066 IPC_MESSAGE_HANDLER(FrameMsg_Navigate, OnNavigate)
1068 IPC_MESSAGE_HANDLER(ViewMsg_Stop, OnStop) 1067 IPC_MESSAGE_HANDLER(ViewMsg_Stop, OnStop)
1069 IPC_MESSAGE_HANDLER(ViewMsg_CopyImageAt, OnCopyImageAt) 1068 IPC_MESSAGE_HANDLER(ViewMsg_CopyImageAt, OnCopyImageAt)
1070 IPC_MESSAGE_HANDLER(ViewMsg_SaveImageAt, OnSaveImageAt) 1069 IPC_MESSAGE_HANDLER(ViewMsg_SaveImageAt, OnSaveImageAt)
1071 IPC_MESSAGE_HANDLER(ViewMsg_Find, OnFind) 1070 IPC_MESSAGE_HANDLER(ViewMsg_Find, OnFind)
1072 IPC_MESSAGE_HANDLER(ViewMsg_StopFinding, OnStopFinding) 1071 IPC_MESSAGE_HANDLER(ViewMsg_StopFinding, OnStopFinding)
1073 IPC_MESSAGE_HANDLER(ViewMsg_Zoom, OnZoom) 1072 IPC_MESSAGE_HANDLER(ViewMsg_Zoom, OnZoom)
1074 IPC_MESSAGE_HANDLER(ViewMsg_SetZoomLevelForLoadingURL, 1073 IPC_MESSAGE_HANDLER(ViewMsg_SetZoomLevelForLoadingURL,
1075 OnSetZoomLevelForLoadingURL) 1074 OnSetZoomLevelForLoadingURL)
1075 IPC_MESSAGE_HANDLER(ViewMsg_SetZoomLevelForView,
1076 OnSetZoomLevelForView)
1076 IPC_MESSAGE_HANDLER(ViewMsg_SetPageEncoding, OnSetPageEncoding) 1077 IPC_MESSAGE_HANDLER(ViewMsg_SetPageEncoding, OnSetPageEncoding)
1077 IPC_MESSAGE_HANDLER(ViewMsg_ResetPageEncodingToDefault, 1078 IPC_MESSAGE_HANDLER(ViewMsg_ResetPageEncodingToDefault,
1078 OnResetPageEncodingToDefault) 1079 OnResetPageEncodingToDefault)
1079 IPC_MESSAGE_HANDLER(ViewMsg_PostMessageEvent, OnPostMessageEvent) 1080 IPC_MESSAGE_HANDLER(ViewMsg_PostMessageEvent, OnPostMessageEvent)
1080 IPC_MESSAGE_HANDLER(DragMsg_TargetDragEnter, OnDragTargetDragEnter) 1081 IPC_MESSAGE_HANDLER(DragMsg_TargetDragEnter, OnDragTargetDragEnter)
1081 IPC_MESSAGE_HANDLER(DragMsg_TargetDragOver, OnDragTargetDragOver) 1082 IPC_MESSAGE_HANDLER(DragMsg_TargetDragOver, OnDragTargetDragOver)
1082 IPC_MESSAGE_HANDLER(DragMsg_TargetDragLeave, OnDragTargetDragLeave) 1083 IPC_MESSAGE_HANDLER(DragMsg_TargetDragLeave, OnDragTargetDragLeave)
1083 IPC_MESSAGE_HANDLER(DragMsg_TargetDrop, OnDragTargetDrop) 1084 IPC_MESSAGE_HANDLER(DragMsg_TargetDrop, OnDragTargetDrop)
1084 IPC_MESSAGE_HANDLER(DragMsg_SourceEnded, OnDragSourceEnded) 1085 IPC_MESSAGE_HANDLER(DragMsg_SourceEnded, OnDragSourceEnded)
1085 IPC_MESSAGE_HANDLER(DragMsg_SourceSystemDragEnded, 1086 IPC_MESSAGE_HANDLER(DragMsg_SourceSystemDragEnded,
(...skipping 1567 matching lines...) Expand 10 before | Expand all | Expand 10 after
2653 void RenderViewImpl::OnSetZoomLevelForLoadingURL(const GURL& url, 2654 void RenderViewImpl::OnSetZoomLevelForLoadingURL(const GURL& url,
2654 double zoom_level) { 2655 double zoom_level) {
2655 #if !defined(OS_ANDROID) 2656 #if !defined(OS_ANDROID)
2656 // On Android, page zoom isn't used, and in case of WebView, text zoom is used 2657 // On Android, page zoom isn't used, and in case of WebView, text zoom is used
2657 // for legacy WebView text scaling emulation. Thus, the code that resets 2658 // for legacy WebView text scaling emulation. Thus, the code that resets
2658 // the zoom level from this map will be effectively resetting text zoom level. 2659 // the zoom level from this map will be effectively resetting text zoom level.
2659 host_zoom_levels_[url] = zoom_level; 2660 host_zoom_levels_[url] = zoom_level;
2660 #endif 2661 #endif
2661 } 2662 }
2662 2663
2664 void RenderViewImpl::OnSetZoomLevelForView(double level) {
2665 webview()->setZoomLevel(level);
Fady Samuel 2014/06/09 15:43:21 Do we need to close popups here?
wjmaclean 2014/06/09 17:23:29 Probably ... consider it added (unless I discover
2666 // zoomLevelChanged();
Fady Samuel 2014/06/09 15:43:21 Remove this?
wjmaclean 2014/06/09 17:23:29 Done.
2667 }
2668
2663 void RenderViewImpl::OnSetPageEncoding(const std::string& encoding_name) { 2669 void RenderViewImpl::OnSetPageEncoding(const std::string& encoding_name) {
2664 webview()->setPageEncoding(WebString::fromUTF8(encoding_name)); 2670 webview()->setPageEncoding(WebString::fromUTF8(encoding_name));
2665 } 2671 }
2666 2672
2667 void RenderViewImpl::OnResetPageEncodingToDefault() { 2673 void RenderViewImpl::OnResetPageEncodingToDefault() {
2668 WebString no_encoding; 2674 WebString no_encoding;
2669 webview()->setPageEncoding(no_encoding); 2675 webview()->setPageEncoding(no_encoding);
2670 } 2676 }
2671 2677
2672 void RenderViewImpl::OnPostMessageEvent( 2678 void RenderViewImpl::OnPostMessageEvent(
(...skipping 1380 matching lines...) Expand 10 before | Expand all | Expand 10 after
4053 std::vector<gfx::Size> sizes; 4059 std::vector<gfx::Size> sizes;
4054 ConvertToFaviconSizes(icon_urls[i].sizes(), &sizes); 4060 ConvertToFaviconSizes(icon_urls[i].sizes(), &sizes);
4055 if (!url.isEmpty()) 4061 if (!url.isEmpty())
4056 urls.push_back( 4062 urls.push_back(
4057 FaviconURL(url, ToFaviconType(icon_urls[i].iconType()), sizes)); 4063 FaviconURL(url, ToFaviconType(icon_urls[i].iconType()), sizes));
4058 } 4064 }
4059 SendUpdateFaviconURL(urls); 4065 SendUpdateFaviconURL(urls);
4060 } 4066 }
4061 4067
4062 } // namespace content 4068 } // namespace content
OLDNEW
« content/public/browser/host_zoom_map.h ('K') | « content/renderer/render_view_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698