Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(888)

Side by Side Diff: content/renderer/render_view_impl.cc

Issue 1003113003: [DevTools] Handle emulation in embedder, call into web API. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix tests and mac popups compilation Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « content/renderer/render_view_impl.h ('k') | content/renderer/render_widget.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « content/renderer/render_view_impl.h ('k') | content/renderer/render_widget.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698