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/renderer/render_view_impl.h" | 5 #include "content/renderer/render_view_impl.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <cmath> | 8 #include <cmath> |
9 | 9 |
10 #include "base/auto_reset.h" | 10 #include "base/auto_reset.h" |
(...skipping 20 matching lines...) Expand all Loading... |
31 #include "base/time/time.h" | 31 #include "base/time/time.h" |
32 #include "base/trace_event/trace_event.h" | 32 #include "base/trace_event/trace_event.h" |
33 #include "content/child/appcache/appcache_dispatcher.h" | 33 #include "content/child/appcache/appcache_dispatcher.h" |
34 #include "content/child/appcache/web_application_cache_host_impl.h" | 34 #include "content/child/appcache/web_application_cache_host_impl.h" |
35 #include "content/child/child_shared_bitmap_manager.h" | 35 #include "content/child/child_shared_bitmap_manager.h" |
36 #include "content/child/npapi/webplugin_delegate_impl.h" | 36 #include "content/child/npapi/webplugin_delegate_impl.h" |
37 #include "content/child/request_extra_data.h" | 37 #include "content/child/request_extra_data.h" |
38 #include "content/child/v8_value_converter_impl.h" | 38 #include "content/child/v8_value_converter_impl.h" |
39 #include "content/child/webmessageportchannel_impl.h" | 39 #include "content/child/webmessageportchannel_impl.h" |
40 #include "content/common/content_constants_internal.h" | 40 #include "content/common/content_constants_internal.h" |
| 41 #include "content/common/content_switches_internal.h" |
41 #include "content/common/database_messages.h" | 42 #include "content/common/database_messages.h" |
42 #include "content/common/dom_storage/dom_storage_types.h" | 43 #include "content/common/dom_storage/dom_storage_types.h" |
43 #include "content/common/drag_messages.h" | 44 #include "content/common/drag_messages.h" |
44 #include "content/common/frame_messages.h" | 45 #include "content/common/frame_messages.h" |
45 #include "content/common/frame_replication_state.h" | 46 #include "content/common/frame_replication_state.h" |
46 #include "content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.h" | 47 #include "content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.h" |
47 #include "content/common/input_messages.h" | 48 #include "content/common/input_messages.h" |
48 #include "content/common/pepper_messages.h" | 49 #include "content/common/pepper_messages.h" |
49 #include "content/common/site_isolation_policy.h" | 50 #include "content/common/site_isolation_policy.h" |
50 #include "content/common/ssl_status_serialization.h" | 51 #include "content/common/ssl_status_serialization.h" |
(...skipping 685 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
736 if (RenderThreadImpl::current()) { | 737 if (RenderThreadImpl::current()) { |
737 RenderThreadImpl::current()->WidgetCreated(); | 738 RenderThreadImpl::current()->WidgetCreated(); |
738 if (is_hidden_) | 739 if (is_hidden_) |
739 RenderThreadImpl::current()->WidgetHidden(); | 740 RenderThreadImpl::current()->WidgetHidden(); |
740 } | 741 } |
741 | 742 |
742 // If this is a popup, we must wait for the CreatingNew_ACK message before | 743 // If this is a popup, we must wait for the CreatingNew_ACK message before |
743 // completing initialization. Otherwise, we can finish it now. | 744 // completing initialization. Otherwise, we can finish it now. |
744 if (opener_id_ == MSG_ROUTING_NONE) | 745 if (opener_id_ == MSG_ROUTING_NONE) |
745 did_show_ = true; | 746 did_show_ = true; |
746 | 747 if (IsUseZoomForDSFEnabled()) |
747 webview()->setDeviceScaleFactor(device_scale_factor_); | 748 webview()->setZoomFactorForDeviceScaleFactor(device_scale_factor_); |
| 749 else |
| 750 webview()->setDeviceScaleFactor(device_scale_factor_); |
748 webview()->setDisplayMode(display_mode_); | 751 webview()->setDisplayMode(display_mode_); |
749 webview()->settings()->setPreferCompositingToLCDTextEnabled( | 752 webview()->settings()->setPreferCompositingToLCDTextEnabled( |
750 PreferCompositingToLCDText(compositor_deps_, device_scale_factor_)); | 753 PreferCompositingToLCDText(compositor_deps_, device_scale_factor_)); |
751 webview()->settings()->setThreadedScrollingEnabled( | 754 webview()->settings()->setThreadedScrollingEnabled( |
752 !command_line.HasSwitch(switches::kDisableThreadedScrolling)); | 755 !command_line.HasSwitch(switches::kDisableThreadedScrolling)); |
753 webview()->settings()->setRootLayerScrolls( | 756 webview()->settings()->setRootLayerScrolls( |
754 command_line.HasSwitch(switches::kRootLayerScrolls)); | 757 command_line.HasSwitch(switches::kRootLayerScrolls)); |
755 | 758 |
756 ApplyWebPreferencesInternal(webkit_preferences_, webview(), compositor_deps_); | 759 ApplyWebPreferencesInternal(webkit_preferences_, webview(), compositor_deps_); |
757 | 760 |
(...skipping 2418 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3176 } | 3179 } |
3177 } | 3180 } |
3178 RenderWidget::OnImeConfirmComposition(text, | 3181 RenderWidget::OnImeConfirmComposition(text, |
3179 replacement_range, | 3182 replacement_range, |
3180 keep_selection); | 3183 keep_selection); |
3181 } | 3184 } |
3182 | 3185 |
3183 void RenderViewImpl::SetDeviceScaleFactor(float device_scale_factor) { | 3186 void RenderViewImpl::SetDeviceScaleFactor(float device_scale_factor) { |
3184 RenderWidget::SetDeviceScaleFactor(device_scale_factor); | 3187 RenderWidget::SetDeviceScaleFactor(device_scale_factor); |
3185 if (webview()) { | 3188 if (webview()) { |
3186 webview()->setDeviceScaleFactor(device_scale_factor); | 3189 if (IsUseZoomForDSFEnabled()) |
| 3190 webview()->setZoomFactorForDeviceScaleFactor(device_scale_factor); |
| 3191 else |
| 3192 webview()->setDeviceScaleFactor(device_scale_factor); |
3187 webview()->settings()->setPreferCompositingToLCDTextEnabled( | 3193 webview()->settings()->setPreferCompositingToLCDTextEnabled( |
3188 PreferCompositingToLCDText(compositor_deps_, device_scale_factor_)); | 3194 PreferCompositingToLCDText(compositor_deps_, device_scale_factor_)); |
3189 } | 3195 } |
3190 if (auto_resize_mode_) | 3196 if (auto_resize_mode_) |
3191 AutoResizeCompositor(); | 3197 AutoResizeCompositor(); |
3192 } | 3198 } |
3193 | 3199 |
3194 bool RenderViewImpl::SetDeviceColorProfile( | 3200 bool RenderViewImpl::SetDeviceColorProfile( |
3195 const std::vector<char>& profile) { | 3201 const std::vector<char>& profile) { |
3196 bool changed = RenderWidget::SetDeviceColorProfile(profile); | 3202 bool changed = RenderWidget::SetDeviceColorProfile(profile); |
(...skipping 488 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3685 std::vector<gfx::Size> sizes; | 3691 std::vector<gfx::Size> sizes; |
3686 ConvertToFaviconSizes(icon_urls[i].sizes(), &sizes); | 3692 ConvertToFaviconSizes(icon_urls[i].sizes(), &sizes); |
3687 if (!url.isEmpty()) | 3693 if (!url.isEmpty()) |
3688 urls.push_back( | 3694 urls.push_back( |
3689 FaviconURL(url, ToFaviconType(icon_urls[i].iconType()), sizes)); | 3695 FaviconURL(url, ToFaviconType(icon_urls[i].iconType()), sizes)); |
3690 } | 3696 } |
3691 SendUpdateFaviconURL(urls); | 3697 SendUpdateFaviconURL(urls); |
3692 } | 3698 } |
3693 | 3699 |
3694 } // namespace content | 3700 } // namespace content |
OLD | NEW |