| 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/web_contents/web_contents_impl.h" | 5 #include "content/browser/web_contents/web_contents_impl.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <cmath> | 9 #include <cmath> |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 952 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 963 | 963 |
| 964 GURL url = HostZoomMap::GetURLFromEntry(entry); | 964 GURL url = HostZoomMap::GetURLFromEntry(entry); |
| 965 if (host != net::GetHostOrSpecFromURL(url) || | 965 if (host != net::GetHostOrSpecFromURL(url) || |
| 966 (!scheme.empty() && !url.SchemeIs(scheme))) { | 966 (!scheme.empty() && !url.SchemeIs(scheme))) { |
| 967 return; | 967 return; |
| 968 } | 968 } |
| 969 | 969 |
| 970 UpdateZoom(level); | 970 UpdateZoom(level); |
| 971 } | 971 } |
| 972 | 972 |
| 973 void WebContentsImpl::UpdateDeviceScaleFactor(double device_scale_factor) { |
| 974 SendPageMessage( |
| 975 new PageMsg_SetDeviceScaleFactor(MSG_ROUTING_NONE, device_scale_factor)); |
| 976 } |
| 977 |
| 978 double WebContentsImpl::DefaultDeviceScaleFactor() { |
| 979 // TODO(wjmaclean): is it simpler to just remember the value from the last |
| 980 // call to UpdateDeviceScaleFactor()? It's perhaps not the sort of state we |
| 981 // expect WebContents to be hanging on to. |
| 982 RenderWidgetHostViewBase* rwhv = |
| 983 static_cast<RenderWidgetHostViewBase*>(GetRenderWidgetHostView()); |
| 984 if (rwhv) |
| 985 return rwhv->current_device_scale_factor(); |
| 986 |
| 987 return RenderWidgetHostDelegate::DefaultDeviceScaleFactor(); |
| 988 } |
| 989 |
| 973 WebUI* WebContentsImpl::CreateSubframeWebUI(const GURL& url, | 990 WebUI* WebContentsImpl::CreateSubframeWebUI(const GURL& url, |
| 974 const std::string& frame_name) { | 991 const std::string& frame_name) { |
| 975 DCHECK(!frame_name.empty()); | 992 DCHECK(!frame_name.empty()); |
| 976 return CreateWebUI(url, frame_name); | 993 return CreateWebUI(url, frame_name); |
| 977 } | 994 } |
| 978 | 995 |
| 979 WebUI* WebContentsImpl::GetWebUI() const { | 996 WebUI* WebContentsImpl::GetWebUI() const { |
| 980 WebUI* commited_web_ui = GetCommittedWebUI(); | 997 WebUI* commited_web_ui = GetCommittedWebUI(); |
| 981 return commited_web_ui ? commited_web_ui | 998 return commited_web_ui ? commited_web_ui |
| 982 : GetRenderManager()->GetNavigatingWebUI(); | 999 : GetRenderManager()->GetNavigatingWebUI(); |
| (...skipping 4178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5161 for (RenderViewHost* render_view_host : render_view_host_set) | 5178 for (RenderViewHost* render_view_host : render_view_host_set) |
| 5162 render_view_host->OnWebkitPreferencesChanged(); | 5179 render_view_host->OnWebkitPreferencesChanged(); |
| 5163 } | 5180 } |
| 5164 | 5181 |
| 5165 void WebContentsImpl::SetJavaScriptDialogManagerForTesting( | 5182 void WebContentsImpl::SetJavaScriptDialogManagerForTesting( |
| 5166 JavaScriptDialogManager* dialog_manager) { | 5183 JavaScriptDialogManager* dialog_manager) { |
| 5167 dialog_manager_ = dialog_manager; | 5184 dialog_manager_ = dialog_manager; |
| 5168 } | 5185 } |
| 5169 | 5186 |
| 5170 } // namespace content | 5187 } // namespace content |
| OLD | NEW |