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 3615 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3626 return focused_pepper_plugin_->IsPluginAcceptingCompositionEvents(); | 3626 return focused_pepper_plugin_->IsPluginAcceptingCompositionEvents(); |
3627 #endif | 3627 #endif |
3628 return true; | 3628 return true; |
3629 } | 3629 } |
3630 | 3630 |
3631 void RenderViewImpl::DidCompletePageScaleAnimation() { | 3631 void RenderViewImpl::DidCompletePageScaleAnimation() { |
3632 FocusChangeComplete(); | 3632 FocusChangeComplete(); |
3633 } | 3633 } |
3634 | 3634 |
3635 void RenderViewImpl::SetScreenMetricsEmulationParameters( | 3635 void RenderViewImpl::SetScreenMetricsEmulationParameters( |
3636 float device_scale_factor, | 3636 bool enabled, |
3637 const gfx::Point& root_layer_offset, | 3637 const blink::WebDeviceEmulationParams& params) { |
3638 float root_layer_scale) { | |
3639 if (webview() && compositor()) { | 3638 if (webview() && compositor()) { |
3640 webview()->setCompositorDeviceScaleFactorOverride(device_scale_factor); | 3639 if (enabled) |
3641 webview()->setRootLayerTransform( | 3640 webview()->enableDeviceEmulation(params); |
3642 blink::WebSize(root_layer_offset.x(), root_layer_offset.y()), | 3641 else |
3643 root_layer_scale); | 3642 webview()->disableDeviceEmulation(); |
3644 } | 3643 } |
3645 } | 3644 } |
3646 | 3645 |
3647 bool RenderViewImpl::ScheduleFileChooser( | 3646 bool RenderViewImpl::ScheduleFileChooser( |
3648 const FileChooserParams& params, | 3647 const FileChooserParams& params, |
3649 WebFileChooserCompletion* completion) { | 3648 WebFileChooserCompletion* completion) { |
3650 static const size_t kMaximumPendingFileChooseRequests = 4; | 3649 static const size_t kMaximumPendingFileChooseRequests = 4; |
3651 if (file_chooser_completions_.size() > kMaximumPendingFileChooseRequests) { | 3650 if (file_chooser_completions_.size() > kMaximumPendingFileChooseRequests) { |
3652 // This sanity check prevents too many file choose requests from getting | 3651 // This sanity check prevents too many file choose requests from getting |
3653 // queued which could DoS the user. Getting these is most likely a | 3652 // 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... |
4028 std::vector<gfx::Size> sizes; | 4027 std::vector<gfx::Size> sizes; |
4029 ConvertToFaviconSizes(icon_urls[i].sizes(), &sizes); | 4028 ConvertToFaviconSizes(icon_urls[i].sizes(), &sizes); |
4030 if (!url.isEmpty()) | 4029 if (!url.isEmpty()) |
4031 urls.push_back( | 4030 urls.push_back( |
4032 FaviconURL(url, ToFaviconType(icon_urls[i].iconType()), sizes)); | 4031 FaviconURL(url, ToFaviconType(icon_urls[i].iconType()), sizes)); |
4033 } | 4032 } |
4034 SendUpdateFaviconURL(urls); | 4033 SendUpdateFaviconURL(urls); |
4035 } | 4034 } |
4036 | 4035 |
4037 } // namespace content | 4036 } // namespace content |
OLD | NEW |