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 3604 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3615 return focused_pepper_plugin_->IsPluginAcceptingCompositionEvents(); | 3615 return focused_pepper_plugin_->IsPluginAcceptingCompositionEvents(); |
3616 #endif | 3616 #endif |
3617 return true; | 3617 return true; |
3618 } | 3618 } |
3619 | 3619 |
3620 void RenderViewImpl::DidCompletePageScaleAnimation() { | 3620 void RenderViewImpl::DidCompletePageScaleAnimation() { |
3621 FocusChangeComplete(); | 3621 FocusChangeComplete(); |
3622 } | 3622 } |
3623 | 3623 |
3624 void RenderViewImpl::SetScreenMetricsEmulationParameters( | 3624 void RenderViewImpl::SetScreenMetricsEmulationParameters( |
3625 float device_scale_factor, | 3625 bool enabled, |
3626 const gfx::Point& root_layer_offset, | 3626 const blink::WebDeviceEmulationParams& params) { |
3627 float root_layer_scale) { | |
3628 if (webview() && compositor()) { | 3627 if (webview() && compositor()) { |
3629 webview()->setCompositorDeviceScaleFactorOverride(device_scale_factor); | 3628 if (enabled) |
3630 webview()->setRootLayerTransform( | 3629 webview()->enableDeviceEmulation(params); |
3631 blink::WebSize(root_layer_offset.x(), root_layer_offset.y()), | 3630 else |
3632 root_layer_scale); | 3631 webview()->disableDeviceEmulation(); |
3633 } | 3632 } |
3634 } | 3633 } |
3635 | 3634 |
3636 bool RenderViewImpl::ScheduleFileChooser( | 3635 bool RenderViewImpl::ScheduleFileChooser( |
3637 const FileChooserParams& params, | 3636 const FileChooserParams& params, |
3638 WebFileChooserCompletion* completion) { | 3637 WebFileChooserCompletion* completion) { |
3639 static const size_t kMaximumPendingFileChooseRequests = 4; | 3638 static const size_t kMaximumPendingFileChooseRequests = 4; |
3640 if (file_chooser_completions_.size() > kMaximumPendingFileChooseRequests) { | 3639 if (file_chooser_completions_.size() > kMaximumPendingFileChooseRequests) { |
3641 // This sanity check prevents too many file choose requests from getting | 3640 // This sanity check prevents too many file choose requests from getting |
3642 // queued which could DoS the user. Getting these is most likely a | 3641 // queued which could DoS the user. Getting these is most likely a |
(...skipping 374 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4017 std::vector<gfx::Size> sizes; | 4016 std::vector<gfx::Size> sizes; |
4018 ConvertToFaviconSizes(icon_urls[i].sizes(), &sizes); | 4017 ConvertToFaviconSizes(icon_urls[i].sizes(), &sizes); |
4019 if (!url.isEmpty()) | 4018 if (!url.isEmpty()) |
4020 urls.push_back( | 4019 urls.push_back( |
4021 FaviconURL(url, ToFaviconType(icon_urls[i].iconType()), sizes)); | 4020 FaviconURL(url, ToFaviconType(icon_urls[i].iconType()), sizes)); |
4022 } | 4021 } |
4023 SendUpdateFaviconURL(urls); | 4022 SendUpdateFaviconURL(urls); |
4024 } | 4023 } |
4025 | 4024 |
4026 } // namespace content | 4025 } // namespace content |
OLD | NEW |