| 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 755 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 766 IPC_MESSAGE_HANDLER(ViewHostMsg_Close, OnClose) | 766 IPC_MESSAGE_HANDLER(ViewHostMsg_Close, OnClose) |
| 767 IPC_MESSAGE_HANDLER(ViewHostMsg_RequestMove, OnRequestMove) | 767 IPC_MESSAGE_HANDLER(ViewHostMsg_RequestMove, OnRequestMove) |
| 768 IPC_MESSAGE_HANDLER(ViewHostMsg_DocumentAvailableInMainFrame, | 768 IPC_MESSAGE_HANDLER(ViewHostMsg_DocumentAvailableInMainFrame, |
| 769 OnDocumentAvailableInMainFrame) | 769 OnDocumentAvailableInMainFrame) |
| 770 IPC_MESSAGE_HANDLER(ViewHostMsg_DidContentsPreferredSizeChange, | 770 IPC_MESSAGE_HANDLER(ViewHostMsg_DidContentsPreferredSizeChange, |
| 771 OnDidContentsPreferredSizeChange) | 771 OnDidContentsPreferredSizeChange) |
| 772 IPC_MESSAGE_HANDLER(ViewHostMsg_RouteCloseEvent, | 772 IPC_MESSAGE_HANDLER(ViewHostMsg_RouteCloseEvent, |
| 773 OnRouteCloseEvent) | 773 OnRouteCloseEvent) |
| 774 IPC_MESSAGE_HANDLER(ViewHostMsg_TakeFocus, OnTakeFocus) | 774 IPC_MESSAGE_HANDLER(ViewHostMsg_TakeFocus, OnTakeFocus) |
| 775 IPC_MESSAGE_HANDLER(ViewHostMsg_ClosePage_ACK, OnClosePageACK) | 775 IPC_MESSAGE_HANDLER(ViewHostMsg_ClosePage_ACK, OnClosePageACK) |
| 776 IPC_MESSAGE_HANDLER(ViewHostMsg_DidZoomURL, OnDidZoomURL) | |
| 777 IPC_MESSAGE_HANDLER(ViewHostMsg_Focus, OnFocus) | 776 IPC_MESSAGE_HANDLER(ViewHostMsg_Focus, OnFocus) |
| 778 IPC_MESSAGE_UNHANDLED(handled = false) | 777 IPC_MESSAGE_UNHANDLED(handled = false) |
| 779 IPC_END_MESSAGE_MAP() | 778 IPC_END_MESSAGE_MAP() |
| 780 | 779 |
| 781 return handled; | 780 return handled; |
| 782 } | 781 } |
| 783 | 782 |
| 784 void RenderViewHostImpl::RenderWidgetDidInit() { | 783 void RenderViewHostImpl::RenderWidgetDidInit() { |
| 785 PostRenderViewReady(); | 784 PostRenderViewReady(); |
| 786 } | 785 } |
| (...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 974 if (delegate_) | 973 if (delegate_) |
| 975 delegate_->ClearFocusedElement(); | 974 delegate_->ClearFocusedElement(); |
| 976 } | 975 } |
| 977 | 976 |
| 978 bool RenderViewHostImpl::IsFocusedElementEditable() { | 977 bool RenderViewHostImpl::IsFocusedElementEditable() { |
| 979 // TODO(ekaramad): We should move this to WebContents instead | 978 // TODO(ekaramad): We should move this to WebContents instead |
| 980 // (https://crbug.com/675975). | 979 // (https://crbug.com/675975). |
| 981 return delegate_ && delegate_->IsFocusedElementEditable(); | 980 return delegate_ && delegate_->IsFocusedElementEditable(); |
| 982 } | 981 } |
| 983 | 982 |
| 984 void RenderViewHostImpl::Zoom(PageZoom zoom) { | |
| 985 Send(new ViewMsg_Zoom(GetRoutingID(), zoom)); | |
| 986 } | |
| 987 | |
| 988 void RenderViewHostImpl::DisableScrollbarsForThreshold(const gfx::Size& size) { | 983 void RenderViewHostImpl::DisableScrollbarsForThreshold(const gfx::Size& size) { |
| 989 Send(new ViewMsg_DisableScrollbarsForSmallWindows(GetRoutingID(), size)); | 984 Send(new ViewMsg_DisableScrollbarsForSmallWindows(GetRoutingID(), size)); |
| 990 } | 985 } |
| 991 | 986 |
| 992 void RenderViewHostImpl::EnablePreferredSizeMode() { | 987 void RenderViewHostImpl::EnablePreferredSizeMode() { |
| 993 Send(new ViewMsg_EnablePreferredSizeChangedMode(GetRoutingID())); | 988 Send(new ViewMsg_EnablePreferredSizeChangedMode(GetRoutingID())); |
| 994 } | 989 } |
| 995 | 990 |
| 996 void RenderViewHostImpl::EnableAutoResize(const gfx::Size& min_size, | 991 void RenderViewHostImpl::EnableAutoResize(const gfx::Size& min_size, |
| 997 const gfx::Size& max_size) { | 992 const gfx::Size& max_size) { |
| (...skipping 15 matching lines...) Expand all Loading... |
| 1013 | 1008 |
| 1014 void RenderViewHostImpl::ExecutePluginActionAtLocation( | 1009 void RenderViewHostImpl::ExecutePluginActionAtLocation( |
| 1015 const gfx::Point& location, const blink::WebPluginAction& action) { | 1010 const gfx::Point& location, const blink::WebPluginAction& action) { |
| 1016 Send(new ViewMsg_PluginActionAt(GetRoutingID(), location, action)); | 1011 Send(new ViewMsg_PluginActionAt(GetRoutingID(), location, action)); |
| 1017 } | 1012 } |
| 1018 | 1013 |
| 1019 void RenderViewHostImpl::NotifyMoveOrResizeStarted() { | 1014 void RenderViewHostImpl::NotifyMoveOrResizeStarted() { |
| 1020 Send(new ViewMsg_MoveOrResizeStarted(GetRoutingID())); | 1015 Send(new ViewMsg_MoveOrResizeStarted(GetRoutingID())); |
| 1021 } | 1016 } |
| 1022 | 1017 |
| 1023 void RenderViewHostImpl::OnDidZoomURL(double zoom_level, | |
| 1024 const GURL& url) { | |
| 1025 HostZoomMapImpl* host_zoom_map = | |
| 1026 static_cast<HostZoomMapImpl*>(HostZoomMap::Get(GetSiteInstance())); | |
| 1027 | |
| 1028 host_zoom_map->SetZoomLevelForView(GetProcess()->GetID(), | |
| 1029 GetRoutingID(), | |
| 1030 zoom_level, | |
| 1031 net::GetHostOrSpecFromURL(url)); | |
| 1032 } | |
| 1033 | |
| 1034 void RenderViewHostImpl::SelectWordAroundCaret() { | 1018 void RenderViewHostImpl::SelectWordAroundCaret() { |
| 1035 Send(new ViewMsg_SelectWordAroundCaret(GetRoutingID())); | 1019 Send(new ViewMsg_SelectWordAroundCaret(GetRoutingID())); |
| 1036 } | 1020 } |
| 1037 | 1021 |
| 1038 void RenderViewHostImpl::PostRenderViewReady() { | 1022 void RenderViewHostImpl::PostRenderViewReady() { |
| 1039 if (GetProcess()->IsReady()) { | 1023 if (GetProcess()->IsReady()) { |
| 1040 BrowserThread::PostTask( | 1024 BrowserThread::PostTask( |
| 1041 BrowserThread::UI, | 1025 BrowserThread::UI, |
| 1042 FROM_HERE, | 1026 FROM_HERE, |
| 1043 base::Bind(&RenderViewHostImpl::RenderViewReady, | 1027 base::Bind(&RenderViewHostImpl::RenderViewReady, |
| 1044 weak_factory_.GetWeakPtr())); | 1028 weak_factory_.GetWeakPtr())); |
| 1045 } else { | 1029 } else { |
| 1046 render_view_ready_on_process_launch_ = true; | 1030 render_view_ready_on_process_launch_ = true; |
| 1047 } | 1031 } |
| 1048 } | 1032 } |
| 1049 | 1033 |
| 1050 void RenderViewHostImpl::RenderViewReady() { | 1034 void RenderViewHostImpl::RenderViewReady() { |
| 1051 delegate_->RenderViewReady(this); | 1035 delegate_->RenderViewReady(this); |
| 1052 } | 1036 } |
| 1053 | 1037 |
| 1054 } // namespace content | 1038 } // namespace content |
| OLD | NEW |