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

Side by Side Diff: content/browser/renderer_host/render_view_host_impl.cc

Issue 393133002: Migrate HostZoomMap to live in StoragePartition. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add proper method mock for BrowserContext::CreateZoomLevelDelegate() override. Created 6 years, 1 month 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/browser/renderer_host/render_view_host_impl.h" 5 #include "content/browser/renderer_host/render_view_host_impl.h"
6 6
7 #include <set> 7 #include <set>
8 #include <string> 8 #include <string>
9 #include <utility> 9 #include <utility>
10 #include <vector> 10 #include <vector>
(...skipping 1073 matching lines...) Expand 10 before | Expand all | Expand 10 after
1084 } 1084 }
1085 1085
1086 void RenderViewHostImpl::OnDocumentAvailableInMainFrame( 1086 void RenderViewHostImpl::OnDocumentAvailableInMainFrame(
1087 bool uses_temporary_zoom_level) { 1087 bool uses_temporary_zoom_level) {
1088 delegate_->DocumentAvailableInMainFrame(this); 1088 delegate_->DocumentAvailableInMainFrame(this);
1089 1089
1090 if (!uses_temporary_zoom_level) 1090 if (!uses_temporary_zoom_level)
1091 return; 1091 return;
1092 1092
1093 HostZoomMapImpl* host_zoom_map = 1093 HostZoomMapImpl* host_zoom_map =
1094 static_cast<HostZoomMapImpl*>(HostZoomMap::GetDefaultForBrowserContext( 1094 static_cast<HostZoomMapImpl*>(HostZoomMap::Get(GetSiteInstance()));
1095 GetProcess()->GetBrowserContext()));
1096 host_zoom_map->SetTemporaryZoomLevel(GetProcess()->GetID(), 1095 host_zoom_map->SetTemporaryZoomLevel(GetProcess()->GetID(),
1097 GetRoutingID(), 1096 GetRoutingID(),
1098 host_zoom_map->GetDefaultZoomLevel()); 1097 host_zoom_map->GetDefaultZoomLevel());
1099 } 1098 }
1100 1099
1101 void RenderViewHostImpl::OnToggleFullscreen(bool enter_fullscreen) { 1100 void RenderViewHostImpl::OnToggleFullscreen(bool enter_fullscreen) {
1102 DCHECK_CURRENTLY_ON(BrowserThread::UI); 1101 DCHECK_CURRENTLY_ON(BrowserThread::UI);
1103 delegate_->ToggleFullscreenMode(enter_fullscreen); 1102 delegate_->ToggleFullscreenMode(enter_fullscreen);
1104 // We need to notify the contents that its fullscreen state has changed. This 1103 // We need to notify the contents that its fullscreen state has changed. This
1105 // is done as part of the resize message. 1104 // is done as part of the resize message.
(...skipping 293 matching lines...) Expand 10 before | Expand all | Expand 10 after
1399 Send(new ViewMsg_PluginActionAt(GetRoutingID(), location, action)); 1398 Send(new ViewMsg_PluginActionAt(GetRoutingID(), location, action));
1400 } 1399 }
1401 1400
1402 void RenderViewHostImpl::NotifyMoveOrResizeStarted() { 1401 void RenderViewHostImpl::NotifyMoveOrResizeStarted() {
1403 Send(new ViewMsg_MoveOrResizeStarted(GetRoutingID())); 1402 Send(new ViewMsg_MoveOrResizeStarted(GetRoutingID()));
1404 } 1403 }
1405 1404
1406 void RenderViewHostImpl::OnDidZoomURL(double zoom_level, 1405 void RenderViewHostImpl::OnDidZoomURL(double zoom_level,
1407 const GURL& url) { 1406 const GURL& url) {
1408 HostZoomMapImpl* host_zoom_map = 1407 HostZoomMapImpl* host_zoom_map =
1409 static_cast<HostZoomMapImpl*>(HostZoomMap::GetDefaultForBrowserContext( 1408 static_cast<HostZoomMapImpl*>(HostZoomMap::Get(GetSiteInstance()));
1410 GetProcess()->GetBrowserContext()));
1411 1409
1412 host_zoom_map->SetZoomLevelForView(GetProcess()->GetID(), 1410 host_zoom_map->SetZoomLevelForView(GetProcess()->GetID(),
1413 GetRoutingID(), 1411 GetRoutingID(),
1414 zoom_level, 1412 zoom_level,
1415 net::GetHostOrSpecFromURL(url)); 1413 net::GetHostOrSpecFromURL(url));
1416 } 1414 }
1417 1415
1418 void RenderViewHostImpl::OnRunFileChooser(const FileChooserParams& params) { 1416 void RenderViewHostImpl::OnRunFileChooser(const FileChooserParams& params) {
1419 delegate_->RunFileChooser(this, params); 1417 delegate_->RunFileChooser(this, params);
1420 } 1418 }
(...skipping 27 matching lines...) Expand all
1448 FrameTree* frame_tree = delegate_->GetFrameTree(); 1446 FrameTree* frame_tree = delegate_->GetFrameTree();
1449 1447
1450 frame_tree->ResetForMainFrameSwap(); 1448 frame_tree->ResetForMainFrameSwap();
1451 } 1449 }
1452 1450
1453 void RenderViewHostImpl::SelectWordAroundCaret() { 1451 void RenderViewHostImpl::SelectWordAroundCaret() {
1454 Send(new ViewMsg_SelectWordAroundCaret(GetRoutingID())); 1452 Send(new ViewMsg_SelectWordAroundCaret(GetRoutingID()));
1455 } 1453 }
1456 1454
1457 } // namespace content 1455 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698