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

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: Moved helper class to cc 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 787 matching lines...) Expand 10 before | Expand all | Expand 10 after
798 host_->WasResized(); 798 host_->WasResized();
799 MaybeCreateResizeLock(); 799 MaybeCreateResizeLock();
800 if (touch_editing_client_) { 800 if (touch_editing_client_) {
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 (!expected_rendered_size_.IsEmpty())
809 desired_size = expected_rendered_size_;
808 if (!host_->should_auto_resize() && 810 if (!host_->should_auto_resize() &&
809 !resize_lock_.get() && 811 !resize_lock_.get() &&
810 desired_size != current_frame_size_ && 812 desired_size != current_frame_size_ &&
811 host_->is_accelerated_compositing_active()) { 813 host_->is_accelerated_compositing_active()) {
812 aura::RootWindow* root_window = window_->GetRootWindow(); 814 aura::RootWindow* root_window = window_->GetRootWindow();
813 ui::Compositor* compositor = root_window ? 815 ui::Compositor* compositor = root_window ?
814 root_window->compositor() : NULL; 816 root_window->compositor() : NULL;
815 if (root_window && compositor) { 817 if (root_window && compositor) {
816 // Listen to changes in the compositor lock state. 818 // Listen to changes in the compositor lock state.
817 if (!compositor->HasObserver(this)) 819 if (!compositor->HasObserver(this))
(...skipping 1177 matching lines...) Expand 10 before | Expand all | Expand 10 after
1995 gfx::Rect RenderWidgetHostViewAura::GetBoundsInRootWindow() { 1997 gfx::Rect RenderWidgetHostViewAura::GetBoundsInRootWindow() {
1996 return window_->GetToplevelWindow()->GetBoundsInScreen(); 1998 return window_->GetToplevelWindow()->GetBoundsInScreen();
1997 } 1999 }
1998 2000
1999 void RenderWidgetHostViewAura::GestureEventAck(int gesture_event_type, 2001 void RenderWidgetHostViewAura::GestureEventAck(int gesture_event_type,
2000 InputEventAckState ack_result) { 2002 InputEventAckState ack_result) {
2001 if (touch_editing_client_) 2003 if (touch_editing_client_)
2002 touch_editing_client_->GestureEventAck(gesture_event_type); 2004 touch_editing_client_->GestureEventAck(gesture_event_type);
2003 } 2005 }
2004 2006
2007 void RenderWidgetHostViewAura::SetExpectedRenderedSize(const gfx::Size& size) {
2008 expected_rendered_size_ = size;
2009 }
2010
2005 void RenderWidgetHostViewAura::ProcessAckedTouchEvent( 2011 void RenderWidgetHostViewAura::ProcessAckedTouchEvent(
2006 const TouchEventWithLatencyInfo& touch, InputEventAckState ack_result) { 2012 const TouchEventWithLatencyInfo& touch, InputEventAckState ack_result) {
2007 ScopedVector<ui::TouchEvent> events; 2013 ScopedVector<ui::TouchEvent> events;
2008 if (!MakeUITouchEventsFromWebTouchEvents(touch, &events, 2014 if (!MakeUITouchEventsFromWebTouchEvents(touch, &events,
2009 SCREEN_COORDINATES)) 2015 SCREEN_COORDINATES))
2010 return; 2016 return;
2011 2017
2012 aura::RootWindow* root = window_->GetRootWindow(); 2018 aura::RootWindow* root = window_->GetRootWindow();
2013 // |root| is NULL during tests. 2019 // |root| is NULL during tests.
2014 if (!root) 2020 if (!root)
(...skipping 1244 matching lines...) Expand 10 before | Expand all | Expand 10 after
3259 RenderWidgetHost* widget) { 3265 RenderWidgetHost* widget) {
3260 return new RenderWidgetHostViewAura(widget); 3266 return new RenderWidgetHostViewAura(widget);
3261 } 3267 }
3262 3268
3263 // static 3269 // static
3264 void RenderWidgetHostViewPort::GetDefaultScreenInfo(WebScreenInfo* results) { 3270 void RenderWidgetHostViewPort::GetDefaultScreenInfo(WebScreenInfo* results) {
3265 GetScreenInfoForWindow(results, NULL); 3271 GetScreenInfoForWindow(results, NULL);
3266 } 3272 }
3267 3273
3268 } // namespace content 3274 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698