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

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: Address sky@'s comments. 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 1081 matching lines...) Expand 10 before | Expand all | Expand 10 after
1092 } 1092 }
1093 1093
1094 void RenderViewHostImpl::OnDocumentAvailableInMainFrame( 1094 void RenderViewHostImpl::OnDocumentAvailableInMainFrame(
1095 bool uses_temporary_zoom_level) { 1095 bool uses_temporary_zoom_level) {
1096 delegate_->DocumentAvailableInMainFrame(this); 1096 delegate_->DocumentAvailableInMainFrame(this);
1097 1097
1098 if (!uses_temporary_zoom_level) 1098 if (!uses_temporary_zoom_level)
1099 return; 1099 return;
1100 1100
1101 HostZoomMapImpl* host_zoom_map = 1101 HostZoomMapImpl* host_zoom_map =
1102 static_cast<HostZoomMapImpl*>(HostZoomMap::GetDefaultForBrowserContext( 1102 static_cast<HostZoomMapImpl*>(HostZoomMap::Get(GetSiteInstance()));
1103 GetProcess()->GetBrowserContext()));
1104 host_zoom_map->SetTemporaryZoomLevel(GetProcess()->GetID(), 1103 host_zoom_map->SetTemporaryZoomLevel(GetProcess()->GetID(),
1105 GetRoutingID(), 1104 GetRoutingID(),
1106 host_zoom_map->GetDefaultZoomLevel()); 1105 host_zoom_map->GetDefaultZoomLevel());
1107 } 1106 }
1108 1107
1109 void RenderViewHostImpl::OnToggleFullscreen(bool enter_fullscreen) { 1108 void RenderViewHostImpl::OnToggleFullscreen(bool enter_fullscreen) {
1110 DCHECK_CURRENTLY_ON(BrowserThread::UI); 1109 DCHECK_CURRENTLY_ON(BrowserThread::UI);
1111 delegate_->ToggleFullscreenMode(enter_fullscreen); 1110 delegate_->ToggleFullscreenMode(enter_fullscreen);
1112 // We need to notify the contents that its fullscreen state has changed. This 1111 // We need to notify the contents that its fullscreen state has changed. This
1113 // is done as part of the resize message. 1112 // is done as part of the resize message.
(...skipping 294 matching lines...) Expand 10 before | Expand all | Expand 10 after
1408 Send(new ViewMsg_PluginActionAt(GetRoutingID(), location, action)); 1407 Send(new ViewMsg_PluginActionAt(GetRoutingID(), location, action));
1409 } 1408 }
1410 1409
1411 void RenderViewHostImpl::NotifyMoveOrResizeStarted() { 1410 void RenderViewHostImpl::NotifyMoveOrResizeStarted() {
1412 Send(new ViewMsg_MoveOrResizeStarted(GetRoutingID())); 1411 Send(new ViewMsg_MoveOrResizeStarted(GetRoutingID()));
1413 } 1412 }
1414 1413
1415 void RenderViewHostImpl::OnDidZoomURL(double zoom_level, 1414 void RenderViewHostImpl::OnDidZoomURL(double zoom_level,
1416 const GURL& url) { 1415 const GURL& url) {
1417 HostZoomMapImpl* host_zoom_map = 1416 HostZoomMapImpl* host_zoom_map =
1418 static_cast<HostZoomMapImpl*>(HostZoomMap::GetDefaultForBrowserContext( 1417 static_cast<HostZoomMapImpl*>(HostZoomMap::Get(GetSiteInstance()));
1419 GetProcess()->GetBrowserContext()));
1420 1418
1421 host_zoom_map->SetZoomLevelForView(GetProcess()->GetID(), 1419 host_zoom_map->SetZoomLevelForView(GetProcess()->GetID(),
1422 GetRoutingID(), 1420 GetRoutingID(),
1423 zoom_level, 1421 zoom_level,
1424 net::GetHostOrSpecFromURL(url)); 1422 net::GetHostOrSpecFromURL(url));
1425 } 1423 }
1426 1424
1427 void RenderViewHostImpl::OnRunFileChooser(const FileChooserParams& params) { 1425 void RenderViewHostImpl::OnRunFileChooser(const FileChooserParams& params) {
1428 delegate_->RunFileChooser(this, params); 1426 delegate_->RunFileChooser(this, params);
1429 } 1427 }
(...skipping 29 matching lines...) Expand all
1459 FrameTree* frame_tree = delegate_->GetFrameTree(); 1457 FrameTree* frame_tree = delegate_->GetFrameTree();
1460 1458
1461 frame_tree->ResetForMainFrameSwap(); 1459 frame_tree->ResetForMainFrameSwap();
1462 } 1460 }
1463 1461
1464 void RenderViewHostImpl::SelectWordAroundCaret() { 1462 void RenderViewHostImpl::SelectWordAroundCaret() {
1465 Send(new ViewMsg_SelectWordAroundCaret(GetRoutingID())); 1463 Send(new ViewMsg_SelectWordAroundCaret(GetRoutingID()));
1466 } 1464 }
1467 1465
1468 } // namespace content 1466 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698