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 687 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
738 if (RenderThreadImpl::current()) { | 739 if (RenderThreadImpl::current()) { |
739 RenderThreadImpl::current()->WidgetCreated(); | 740 RenderThreadImpl::current()->WidgetCreated(); |
740 if (is_hidden_) | 741 if (is_hidden_) |
741 RenderThreadImpl::current()->WidgetHidden(); | 742 RenderThreadImpl::current()->WidgetHidden(); |
742 } | 743 } |
743 | 744 |
744 // If this is a popup, we must wait for the CreatingNew_ACK message before | 745 // If this is a popup, we must wait for the CreatingNew_ACK message before |
745 // completing initialization. Otherwise, we can finish it now. | 746 // completing initialization. Otherwise, we can finish it now. |
746 if (opener_id_ == MSG_ROUTING_NONE) | 747 if (opener_id_ == MSG_ROUTING_NONE) |
747 did_show_ = true; | 748 did_show_ = true; |
748 | 749 UpdateDeviceScaleFactor(); |
749 webview()->setDeviceScaleFactor(device_scale_factor_); | |
750 webview()->setDisplayMode(display_mode_); | 750 webview()->setDisplayMode(display_mode_); |
751 webview()->settings()->setPreferCompositingToLCDTextEnabled( | 751 webview()->settings()->setPreferCompositingToLCDTextEnabled( |
752 PreferCompositingToLCDText(compositor_deps_, device_scale_factor_)); | 752 PreferCompositingToLCDText(compositor_deps_, device_scale_factor_)); |
753 webview()->settings()->setThreadedScrollingEnabled( | 753 webview()->settings()->setThreadedScrollingEnabled( |
754 !command_line.HasSwitch(switches::kDisableThreadedScrolling)); | 754 !command_line.HasSwitch(switches::kDisableThreadedScrolling)); |
755 webview()->settings()->setRootLayerScrolls( | 755 webview()->settings()->setRootLayerScrolls( |
756 command_line.HasSwitch(switches::kRootLayerScrolls)); | 756 command_line.HasSwitch(switches::kRootLayerScrolls)); |
757 | 757 |
758 ApplyWebPreferencesInternal(webkit_preferences_, webview(), compositor_deps_); | 758 ApplyWebPreferencesInternal(webkit_preferences_, webview(), compositor_deps_); |
759 | 759 |
(...skipping 2428 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3188 } | 3188 } |
3189 } | 3189 } |
3190 RenderWidget::OnImeConfirmComposition(text, | 3190 RenderWidget::OnImeConfirmComposition(text, |
3191 replacement_range, | 3191 replacement_range, |
3192 keep_selection); | 3192 keep_selection); |
3193 } | 3193 } |
3194 | 3194 |
3195 void RenderViewImpl::SetDeviceScaleFactor(float device_scale_factor) { | 3195 void RenderViewImpl::SetDeviceScaleFactor(float device_scale_factor) { |
3196 RenderWidget::SetDeviceScaleFactor(device_scale_factor); | 3196 RenderWidget::SetDeviceScaleFactor(device_scale_factor); |
3197 if (webview()) { | 3197 if (webview()) { |
3198 webview()->setDeviceScaleFactor(device_scale_factor); | 3198 UpdateDeviceScaleFactor(); |
3199 webview()->settings()->setPreferCompositingToLCDTextEnabled( | 3199 webview()->settings()->setPreferCompositingToLCDTextEnabled( |
3200 PreferCompositingToLCDText(compositor_deps_, device_scale_factor_)); | 3200 PreferCompositingToLCDText(compositor_deps_, device_scale_factor_)); |
3201 } | 3201 } |
3202 if (auto_resize_mode_) | 3202 if (auto_resize_mode_) |
3203 AutoResizeCompositor(); | 3203 AutoResizeCompositor(); |
3204 } | 3204 } |
3205 | 3205 |
3206 bool RenderViewImpl::SetDeviceColorProfile( | 3206 bool RenderViewImpl::SetDeviceColorProfile( |
3207 const std::vector<char>& profile) { | 3207 const std::vector<char>& profile) { |
3208 bool changed = RenderWidget::SetDeviceColorProfile(profile); | 3208 bool changed = RenderWidget::SetDeviceColorProfile(profile); |
(...skipping 487 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3696 WebURL url = icon_urls[i].iconURL(); | 3696 WebURL url = icon_urls[i].iconURL(); |
3697 std::vector<gfx::Size> sizes; | 3697 std::vector<gfx::Size> sizes; |
3698 ConvertToFaviconSizes(icon_urls[i].sizes(), &sizes); | 3698 ConvertToFaviconSizes(icon_urls[i].sizes(), &sizes); |
3699 if (!url.isEmpty()) | 3699 if (!url.isEmpty()) |
3700 urls.push_back( | 3700 urls.push_back( |
3701 FaviconURL(url, ToFaviconType(icon_urls[i].iconType()), sizes)); | 3701 FaviconURL(url, ToFaviconType(icon_urls[i].iconType()), sizes)); |
3702 } | 3702 } |
3703 SendUpdateFaviconURL(urls); | 3703 SendUpdateFaviconURL(urls); |
3704 } | 3704 } |
3705 | 3705 |
| 3706 void RenderViewImpl::UpdateDeviceScaleFactor() { |
| 3707 if (IsUseZoomForDSFEnabled()) { |
| 3708 compositor_->SetPaintedDeviceScaleFactor(device_scale_factor_); |
| 3709 webview()->setZoomFactorForDeviceScaleFactor( |
| 3710 device_scale_factor_); |
| 3711 } else { |
| 3712 webview()->setDeviceScaleFactor(device_scale_factor_); |
| 3713 } |
| 3714 } |
| 3715 |
3706 } // namespace content | 3716 } // namespace content |
OLD | NEW |