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 1163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1174 // events, and we can take the fast path. | 1174 // events, and we can take the fast path. |
1175 ClosePageIgnoringUnloadEvents(); | 1175 ClosePageIgnoringUnloadEvents(); |
1176 } | 1176 } |
1177 | 1177 |
1178 void RenderViewHostImpl::OnRequestMove(const gfx::Rect& pos) { | 1178 void RenderViewHostImpl::OnRequestMove(const gfx::Rect& pos) { |
1179 if (IsRVHStateActive(rvh_state_)) | 1179 if (IsRVHStateActive(rvh_state_)) |
1180 delegate_->RequestMove(pos); | 1180 delegate_->RequestMove(pos); |
1181 Send(new ViewMsg_Move_ACK(GetRoutingID())); | 1181 Send(new ViewMsg_Move_ACK(GetRoutingID())); |
1182 } | 1182 } |
1183 | 1183 |
1184 void RenderViewHostImpl::OnDocumentAvailableInMainFrame() { | 1184 void RenderViewHostImpl::OnDocumentAvailableInMainFrame( |
| 1185 bool uses_temporary_zoom_level) { |
1185 delegate_->DocumentAvailableInMainFrame(this); | 1186 delegate_->DocumentAvailableInMainFrame(this); |
| 1187 |
| 1188 HostZoomMapImpl* host_zoom_map = static_cast<HostZoomMapImpl*>( |
| 1189 HostZoomMap::GetForBrowserContext(GetProcess()->GetBrowserContext())); |
| 1190 host_zoom_map->SetUsesTemporaryZoomLevel( |
| 1191 GetProcess()->GetID(), GetRoutingID(), uses_temporary_zoom_level); |
1186 } | 1192 } |
1187 | 1193 |
1188 void RenderViewHostImpl::OnToggleFullscreen(bool enter_fullscreen) { | 1194 void RenderViewHostImpl::OnToggleFullscreen(bool enter_fullscreen) { |
1189 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 1195 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
1190 delegate_->ToggleFullscreenMode(enter_fullscreen); | 1196 delegate_->ToggleFullscreenMode(enter_fullscreen); |
1191 // We need to notify the contents that its fullscreen state has changed. This | 1197 // We need to notify the contents that its fullscreen state has changed. This |
1192 // is done as part of the resize message. | 1198 // is done as part of the resize message. |
1193 WasResized(); | 1199 WasResized(); |
1194 } | 1200 } |
1195 | 1201 |
(...skipping 388 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1584 BrowserAccessibilityManager* manager = | 1590 BrowserAccessibilityManager* manager = |
1585 view_->GetBrowserAccessibilityManager(); | 1591 view_->GetBrowserAccessibilityManager(); |
1586 if (manager) | 1592 if (manager) |
1587 manager->OnLocationChanges(params); | 1593 manager->OnLocationChanges(params); |
1588 } | 1594 } |
1589 // TODO(aboxhall): send location change events to web contents observers too | 1595 // TODO(aboxhall): send location change events to web contents observers too |
1590 } | 1596 } |
1591 } | 1597 } |
1592 | 1598 |
1593 void RenderViewHostImpl::OnDidZoomURL(double zoom_level, | 1599 void RenderViewHostImpl::OnDidZoomURL(double zoom_level, |
1594 bool remember, | |
1595 const GURL& url) { | 1600 const GURL& url) { |
1596 HostZoomMapImpl* host_zoom_map = static_cast<HostZoomMapImpl*>( | 1601 HostZoomMapImpl* host_zoom_map = static_cast<HostZoomMapImpl*>( |
1597 HostZoomMap::GetForBrowserContext(GetProcess()->GetBrowserContext())); | 1602 HostZoomMap::GetForBrowserContext(GetProcess()->GetBrowserContext())); |
1598 if (remember) { | 1603 |
1599 host_zoom_map-> | 1604 host_zoom_map->SetZoomLevelForView(GetProcess()->GetID(), |
1600 SetZoomLevelForHost(net::GetHostOrSpecFromURL(url), zoom_level); | 1605 GetRoutingID(), |
1601 } else { | 1606 zoom_level, |
1602 host_zoom_map->SetTemporaryZoomLevel( | 1607 net::GetHostOrSpecFromURL(url)); |
1603 GetProcess()->GetID(), GetRoutingID(), zoom_level); | |
1604 } | |
1605 } | 1608 } |
1606 | 1609 |
1607 void RenderViewHostImpl::OnRunFileChooser(const FileChooserParams& params) { | 1610 void RenderViewHostImpl::OnRunFileChooser(const FileChooserParams& params) { |
1608 delegate_->RunFileChooser(this, params); | 1611 delegate_->RunFileChooser(this, params); |
1609 } | 1612 } |
1610 | 1613 |
1611 void RenderViewHostImpl::OnFocusedNodeTouched(bool editable) { | 1614 void RenderViewHostImpl::OnFocusedNodeTouched(bool editable) { |
1612 #if defined(OS_WIN) | 1615 #if defined(OS_WIN) |
1613 if (editable) { | 1616 if (editable) { |
1614 virtual_keyboard_requested_ = base::win::DisplayVirtualKeyboard(); | 1617 virtual_keyboard_requested_ = base::win::DisplayVirtualKeyboard(); |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1680 FrameTree* frame_tree = delegate_->GetFrameTree(); | 1683 FrameTree* frame_tree = delegate_->GetFrameTree(); |
1681 | 1684 |
1682 frame_tree->ResetForMainFrameSwap(); | 1685 frame_tree->ResetForMainFrameSwap(); |
1683 } | 1686 } |
1684 | 1687 |
1685 void RenderViewHostImpl::SelectWordAroundCaret() { | 1688 void RenderViewHostImpl::SelectWordAroundCaret() { |
1686 Send(new ViewMsg_SelectWordAroundCaret(GetRoutingID())); | 1689 Send(new ViewMsg_SelectWordAroundCaret(GetRoutingID())); |
1687 } | 1690 } |
1688 | 1691 |
1689 } // namespace content | 1692 } // namespace content |
OLD | NEW |