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

Side by Side Diff: content/browser/renderer_host/render_widget_host_view_aura.cc

Issue 23364004: Implementation of device metrics emulation in render view. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Style Created 7 years, 3 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 | Annotate | Revision Log
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/browser/renderer_host/render_widget_host_view_aura.h" 5 #include "content/browser/renderer_host/render_widget_host_view_aura.h"
6 6
7 #include "base/basictypes.h" 7 #include "base/basictypes.h"
8 #include "base/bind.h" 8 #include "base/bind.h"
9 #include "base/callback_helpers.h" 9 #include "base/callback_helpers.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 790 matching lines...) Expand 10 before | Expand all | Expand 10 after
801 touch_editing_client_->OnSelectionOrCursorChanged(selection_anchor_rect_, 801 touch_editing_client_->OnSelectionOrCursorChanged(selection_anchor_rect_,
802 selection_focus_rect_); 802 selection_focus_rect_);
803 } 803 }
804 } 804 }
805 805
806 void RenderWidgetHostViewAura::MaybeCreateResizeLock() { 806 void RenderWidgetHostViewAura::MaybeCreateResizeLock() {
807 gfx::Size desired_size = window_->bounds().size(); 807 gfx::Size desired_size = window_->bounds().size();
808 if (!host_->should_auto_resize() && 808 if (!host_->should_auto_resize() &&
809 !resize_lock_.get() && 809 !resize_lock_.get() &&
810 desired_size != current_frame_size_ && 810 desired_size != current_frame_size_ &&
811 !device_emulation_enabled_ &&
aelias_OOO_until_Jul13 2013/09/13 23:51:44 Is it really that you want to accept an image of *
dgozman 2013/09/14 07:42:42 I think, this would be a right choice.
aelias_OOO_until_Jul13 2013/09/14 07:50:53 Not necessarily. First, note that CC is rather fl
aelias_OOO_until_Jul13 2013/09/14 08:06:51 On second thought, the real difficulty if you go t
dgozman 2013/09/19 10:17:11 Done.
811 host_->is_accelerated_compositing_active()) { 812 host_->is_accelerated_compositing_active()) {
812 aura::RootWindow* root_window = window_->GetRootWindow(); 813 aura::RootWindow* root_window = window_->GetRootWindow();
813 ui::Compositor* compositor = root_window ? 814 ui::Compositor* compositor = root_window ?
814 root_window->compositor() : NULL; 815 root_window->compositor() : NULL;
815 if (root_window && compositor) { 816 if (root_window && compositor) {
816 // Listen to changes in the compositor lock state. 817 // Listen to changes in the compositor lock state.
817 if (!compositor->HasObserver(this)) 818 if (!compositor->HasObserver(this))
818 compositor->AddObserver(this); 819 compositor->AddObserver(this);
819 820
820 // On Windows while resizing, the the resize locks makes us mis-paint a white 821 // On Windows while resizing, the the resize locks makes us mis-paint a white
(...skipping 1174 matching lines...) Expand 10 before | Expand all | Expand 10 after
1995 gfx::Rect RenderWidgetHostViewAura::GetBoundsInRootWindow() { 1996 gfx::Rect RenderWidgetHostViewAura::GetBoundsInRootWindow() {
1996 return window_->GetToplevelWindow()->GetBoundsInScreen(); 1997 return window_->GetToplevelWindow()->GetBoundsInScreen();
1997 } 1998 }
1998 1999
1999 void RenderWidgetHostViewAura::GestureEventAck(int gesture_event_type, 2000 void RenderWidgetHostViewAura::GestureEventAck(int gesture_event_type,
2000 InputEventAckState ack_result) { 2001 InputEventAckState ack_result) {
2001 if (touch_editing_client_) 2002 if (touch_editing_client_)
2002 touch_editing_client_->GestureEventAck(gesture_event_type); 2003 touch_editing_client_->GestureEventAck(gesture_event_type);
2003 } 2004 }
2004 2005
2006 void RenderWidgetHostViewAura::EmulateDevice(bool enabled) {
2007 device_emulation_enabled_ = enabled;
2008 }
2009
2005 void RenderWidgetHostViewAura::ProcessAckedTouchEvent( 2010 void RenderWidgetHostViewAura::ProcessAckedTouchEvent(
2006 const TouchEventWithLatencyInfo& touch, InputEventAckState ack_result) { 2011 const TouchEventWithLatencyInfo& touch, InputEventAckState ack_result) {
2007 ScopedVector<ui::TouchEvent> events; 2012 ScopedVector<ui::TouchEvent> events;
2008 if (!MakeUITouchEventsFromWebTouchEvents(touch, &events, 2013 if (!MakeUITouchEventsFromWebTouchEvents(touch, &events,
2009 SCREEN_COORDINATES)) 2014 SCREEN_COORDINATES))
2010 return; 2015 return;
2011 2016
2012 aura::RootWindow* root = window_->GetRootWindow(); 2017 aura::RootWindow* root = window_->GetRootWindow();
2013 // |root| is NULL during tests. 2018 // |root| is NULL during tests.
2014 if (!root) 2019 if (!root)
(...skipping 1244 matching lines...) Expand 10 before | Expand all | Expand 10 after
3259 RenderWidgetHost* widget) { 3264 RenderWidgetHost* widget) {
3260 return new RenderWidgetHostViewAura(widget); 3265 return new RenderWidgetHostViewAura(widget);
3261 } 3266 }
3262 3267
3263 // static 3268 // static
3264 void RenderWidgetHostViewPort::GetDefaultScreenInfo(WebScreenInfo* results) { 3269 void RenderWidgetHostViewPort::GetDefaultScreenInfo(WebScreenInfo* results) {
3265 GetScreenInfoForWindow(results, NULL); 3270 GetScreenInfoForWindow(results, NULL);
3266 } 3271 }
3267 3272
3268 } // namespace content 3273 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698