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/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 1086 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1097 } | 1097 } |
1098 | 1098 |
1099 void RenderViewHostImpl::OnDocumentAvailableInMainFrame( | 1099 void RenderViewHostImpl::OnDocumentAvailableInMainFrame( |
1100 bool uses_temporary_zoom_level) { | 1100 bool uses_temporary_zoom_level) { |
1101 delegate_->DocumentAvailableInMainFrame(this); | 1101 delegate_->DocumentAvailableInMainFrame(this); |
1102 | 1102 |
1103 if (!uses_temporary_zoom_level) | 1103 if (!uses_temporary_zoom_level) |
1104 return; | 1104 return; |
1105 | 1105 |
1106 HostZoomMapImpl* host_zoom_map = | 1106 HostZoomMapImpl* host_zoom_map = |
1107 static_cast<HostZoomMapImpl*>(HostZoomMap::GetDefaultForBrowserContext( | 1107 static_cast<HostZoomMapImpl*>(HostZoomMap::Get(GetSiteInstance())); |
1108 GetProcess()->GetBrowserContext())); | |
1109 host_zoom_map->SetTemporaryZoomLevel(GetProcess()->GetID(), | 1108 host_zoom_map->SetTemporaryZoomLevel(GetProcess()->GetID(), |
1110 GetRoutingID(), | 1109 GetRoutingID(), |
1111 host_zoom_map->GetDefaultZoomLevel()); | 1110 host_zoom_map->GetDefaultZoomLevel()); |
1112 } | 1111 } |
1113 | 1112 |
1114 void RenderViewHostImpl::OnToggleFullscreen(bool enter_fullscreen) { | 1113 void RenderViewHostImpl::OnToggleFullscreen(bool enter_fullscreen) { |
1115 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 1114 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
1116 delegate_->ToggleFullscreenMode(enter_fullscreen); | 1115 delegate_->ToggleFullscreenMode(enter_fullscreen); |
1117 // We need to notify the contents that its fullscreen state has changed. This | 1116 // We need to notify the contents that its fullscreen state has changed. This |
1118 // is done as part of the resize message. | 1117 // is done as part of the resize message. |
(...skipping 294 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1413 Send(new ViewMsg_PluginActionAt(GetRoutingID(), location, action)); | 1412 Send(new ViewMsg_PluginActionAt(GetRoutingID(), location, action)); |
1414 } | 1413 } |
1415 | 1414 |
1416 void RenderViewHostImpl::NotifyMoveOrResizeStarted() { | 1415 void RenderViewHostImpl::NotifyMoveOrResizeStarted() { |
1417 Send(new ViewMsg_MoveOrResizeStarted(GetRoutingID())); | 1416 Send(new ViewMsg_MoveOrResizeStarted(GetRoutingID())); |
1418 } | 1417 } |
1419 | 1418 |
1420 void RenderViewHostImpl::OnDidZoomURL(double zoom_level, | 1419 void RenderViewHostImpl::OnDidZoomURL(double zoom_level, |
1421 const GURL& url) { | 1420 const GURL& url) { |
1422 HostZoomMapImpl* host_zoom_map = | 1421 HostZoomMapImpl* host_zoom_map = |
1423 static_cast<HostZoomMapImpl*>(HostZoomMap::GetDefaultForBrowserContext( | 1422 static_cast<HostZoomMapImpl*>(HostZoomMap::Get(GetSiteInstance())); |
1424 GetProcess()->GetBrowserContext())); | |
1425 | 1423 |
1426 host_zoom_map->SetZoomLevelForView(GetProcess()->GetID(), | 1424 host_zoom_map->SetZoomLevelForView(GetProcess()->GetID(), |
1427 GetRoutingID(), | 1425 GetRoutingID(), |
1428 zoom_level, | 1426 zoom_level, |
1429 net::GetHostOrSpecFromURL(url)); | 1427 net::GetHostOrSpecFromURL(url)); |
1430 } | 1428 } |
1431 | 1429 |
1432 void RenderViewHostImpl::OnRunFileChooser(const FileChooserParams& params) { | 1430 void RenderViewHostImpl::OnRunFileChooser(const FileChooserParams& params) { |
1433 delegate_->RunFileChooser(this, params); | 1431 delegate_->RunFileChooser(this, params); |
1434 } | 1432 } |
(...skipping 29 matching lines...) Expand all Loading... |
1464 FrameTree* frame_tree = delegate_->GetFrameTree(); | 1462 FrameTree* frame_tree = delegate_->GetFrameTree(); |
1465 | 1463 |
1466 frame_tree->ResetForMainFrameSwap(); | 1464 frame_tree->ResetForMainFrameSwap(); |
1467 } | 1465 } |
1468 | 1466 |
1469 void RenderViewHostImpl::SelectWordAroundCaret() { | 1467 void RenderViewHostImpl::SelectWordAroundCaret() { |
1470 Send(new ViewMsg_SelectWordAroundCaret(GetRoutingID())); | 1468 Send(new ViewMsg_SelectWordAroundCaret(GetRoutingID())); |
1471 } | 1469 } |
1472 | 1470 |
1473 } // namespace content | 1471 } // namespace content |
OLD | NEW |