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 716 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
727 IPC_MESSAGE_HANDLER(ViewHostMsg_PageScaleFactorChanged, | 727 IPC_MESSAGE_HANDLER(ViewHostMsg_PageScaleFactorChanged, |
728 OnPageScaleFactorChanged) | 728 OnPageScaleFactorChanged) |
729 IPC_MESSAGE_HANDLER(ViewHostMsg_EnumerateDirectory, OnEnumerateDirectory) | 729 IPC_MESSAGE_HANDLER(ViewHostMsg_EnumerateDirectory, OnEnumerateDirectory) |
730 IPC_MESSAGE_HANDLER(FrameHostMsg_RegisterProtocolHandler, | 730 IPC_MESSAGE_HANDLER(FrameHostMsg_RegisterProtocolHandler, |
731 OnRegisterProtocolHandler) | 731 OnRegisterProtocolHandler) |
732 IPC_MESSAGE_HANDLER(FrameHostMsg_UnregisterProtocolHandler, | 732 IPC_MESSAGE_HANDLER(FrameHostMsg_UnregisterProtocolHandler, |
733 OnUnregisterProtocolHandler) | 733 OnUnregisterProtocolHandler) |
734 IPC_MESSAGE_HANDLER(FrameHostMsg_UpdatePageImportanceSignals, | 734 IPC_MESSAGE_HANDLER(FrameHostMsg_UpdatePageImportanceSignals, |
735 OnUpdatePageImportanceSignals) | 735 OnUpdatePageImportanceSignals) |
736 IPC_MESSAGE_HANDLER(FrameHostMsg_Find_Reply, OnFindReply) | 736 IPC_MESSAGE_HANDLER(FrameHostMsg_Find_Reply, OnFindReply) |
| 737 IPC_MESSAGE_HANDLER(FrameHostMsg_RestorePageScaleFactorOnLoad, |
| 738 SetPageScaleFactorForSubframes) |
737 IPC_MESSAGE_HANDLER(ViewHostMsg_AppCacheAccessed, OnAppCacheAccessed) | 739 IPC_MESSAGE_HANDLER(ViewHostMsg_AppCacheAccessed, OnAppCacheAccessed) |
738 IPC_MESSAGE_HANDLER(ViewHostMsg_WebUISend, OnWebUISend) | 740 IPC_MESSAGE_HANDLER(ViewHostMsg_WebUISend, OnWebUISend) |
739 #if defined(ENABLE_PLUGINS) | 741 #if defined(ENABLE_PLUGINS) |
740 IPC_MESSAGE_HANDLER(FrameHostMsg_PepperInstanceCreated, | 742 IPC_MESSAGE_HANDLER(FrameHostMsg_PepperInstanceCreated, |
741 OnPepperInstanceCreated) | 743 OnPepperInstanceCreated) |
742 IPC_MESSAGE_HANDLER(FrameHostMsg_PepperInstanceDeleted, | 744 IPC_MESSAGE_HANDLER(FrameHostMsg_PepperInstanceDeleted, |
743 OnPepperInstanceDeleted) | 745 OnPepperInstanceDeleted) |
744 IPC_MESSAGE_HANDLER(FrameHostMsg_PepperPluginHung, OnPepperPluginHung) | 746 IPC_MESSAGE_HANDLER(FrameHostMsg_PepperPluginHung, OnPepperPluginHung) |
745 IPC_MESSAGE_HANDLER(FrameHostMsg_PepperStartsPlayback, | 747 IPC_MESSAGE_HANDLER(FrameHostMsg_PepperStartsPlayback, |
746 OnPepperStartsPlayback) | 748 OnPepperStartsPlayback) |
(...skipping 272 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1019 DCHECK(result.second); | 1021 DCHECK(result.second); |
1020 return base::Bind(&WebContentsImpl::RemoveBindingSet, | 1022 return base::Bind(&WebContentsImpl::RemoveBindingSet, |
1021 weak_factory_.GetWeakPtr(), interface_name); | 1023 weak_factory_.GetWeakPtr(), interface_name); |
1022 } | 1024 } |
1023 | 1025 |
1024 void WebContentsImpl::UpdateDeviceScaleFactor(double device_scale_factor) { | 1026 void WebContentsImpl::UpdateDeviceScaleFactor(double device_scale_factor) { |
1025 SendPageMessage( | 1027 SendPageMessage( |
1026 new PageMsg_SetDeviceScaleFactor(MSG_ROUTING_NONE, device_scale_factor)); | 1028 new PageMsg_SetDeviceScaleFactor(MSG_ROUTING_NONE, device_scale_factor)); |
1027 } | 1029 } |
1028 | 1030 |
| 1031 void WebContentsImpl::SetPageScaleFactorForSubframes(double page_scale_factor) { |
| 1032 SendPageMessage( |
| 1033 new PageMsg_SetPageScaleFactor(MSG_ROUTING_NONE, page_scale_factor)); |
| 1034 } |
| 1035 |
1029 void WebContentsImpl::GetScreenInfo(ScreenInfo* screen_info) { | 1036 void WebContentsImpl::GetScreenInfo(ScreenInfo* screen_info) { |
1030 if (GetView()) | 1037 if (GetView()) |
1031 GetView()->GetScreenInfo(screen_info); | 1038 GetView()->GetScreenInfo(screen_info); |
1032 } | 1039 } |
1033 | 1040 |
1034 std::unique_ptr<WebUI> WebContentsImpl::CreateSubframeWebUI( | 1041 std::unique_ptr<WebUI> WebContentsImpl::CreateSubframeWebUI( |
1035 const GURL& url, | 1042 const GURL& url, |
1036 const std::string& frame_name) { | 1043 const std::string& frame_name) { |
1037 DCHECK(!frame_name.empty()); | 1044 DCHECK(!frame_name.empty()); |
1038 return CreateWebUI(url, frame_name); | 1045 return CreateWebUI(url, frame_name); |
(...skipping 4142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5181 dialog_manager_ = dialog_manager; | 5188 dialog_manager_ = dialog_manager; |
5182 } | 5189 } |
5183 | 5190 |
5184 void WebContentsImpl::RemoveBindingSet(const std::string& interface_name) { | 5191 void WebContentsImpl::RemoveBindingSet(const std::string& interface_name) { |
5185 auto it = binding_sets_.find(interface_name); | 5192 auto it = binding_sets_.find(interface_name); |
5186 if (it != binding_sets_.end()) | 5193 if (it != binding_sets_.end()) |
5187 binding_sets_.erase(it); | 5194 binding_sets_.erase(it); |
5188 } | 5195 } |
5189 | 5196 |
5190 } // namespace content | 5197 } // namespace content |
OLD | NEW |