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

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: 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/bind.h" 7 #include "base/bind.h"
8 #include "base/bind_helpers.h" 8 #include "base/bind_helpers.h"
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/debug/trace_event.h" 10 #include "base/debug/trace_event.h"
(...skipping 789 matching lines...) Expand 10 before | Expand all | Expand 10 after
800 touch_editing_client_->OnSelectionOrCursorChanged(selection_anchor_rect_, 800 touch_editing_client_->OnSelectionOrCursorChanged(selection_anchor_rect_,
801 selection_focus_rect_); 801 selection_focus_rect_);
802 } 802 }
803 } 803 }
804 804
805 void RenderWidgetHostViewAura::MaybeCreateResizeLock() { 805 void RenderWidgetHostViewAura::MaybeCreateResizeLock() {
806 gfx::Size desired_size = window_->bounds().size(); 806 gfx::Size desired_size = window_->bounds().size();
807 if (!host_->should_auto_resize() && 807 if (!host_->should_auto_resize() &&
808 !resize_lock_.get() && 808 !resize_lock_.get() &&
809 desired_size != current_frame_size_ && 809 desired_size != current_frame_size_ &&
810 !device_emulation_enabled_ &&
810 host_->is_accelerated_compositing_active()) { 811 host_->is_accelerated_compositing_active()) {
811 aura::RootWindow* root_window = window_->GetRootWindow(); 812 aura::RootWindow* root_window = window_->GetRootWindow();
812 ui::Compositor* compositor = root_window ? 813 ui::Compositor* compositor = root_window ?
813 root_window->compositor() : NULL; 814 root_window->compositor() : NULL;
814 if (root_window && compositor) { 815 if (root_window && compositor) {
815 // Listen to changes in the compositor lock state. 816 // Listen to changes in the compositor lock state.
816 if (!compositor->HasObserver(this)) 817 if (!compositor->HasObserver(this))
817 compositor->AddObserver(this); 818 compositor->AddObserver(this);
818 819
819 // On Windows while resizing, the the resize locks makes us mis-paint a white 820 // On Windows while resizing, the the resize locks makes us mis-paint a white
(...skipping 1157 matching lines...) Expand 10 before | Expand all | Expand 10 after
1977 gfx::Rect RenderWidgetHostViewAura::GetBoundsInRootWindow() { 1978 gfx::Rect RenderWidgetHostViewAura::GetBoundsInRootWindow() {
1978 return window_->GetToplevelWindow()->GetBoundsInScreen(); 1979 return window_->GetToplevelWindow()->GetBoundsInScreen();
1979 } 1980 }
1980 1981
1981 void RenderWidgetHostViewAura::GestureEventAck(int gesture_event_type, 1982 void RenderWidgetHostViewAura::GestureEventAck(int gesture_event_type,
1982 InputEventAckState ack_result) { 1983 InputEventAckState ack_result) {
1983 if (touch_editing_client_) 1984 if (touch_editing_client_)
1984 touch_editing_client_->GestureEventAck(gesture_event_type); 1985 touch_editing_client_->GestureEventAck(gesture_event_type);
1985 } 1986 }
1986 1987
1988 void RenderWidgetHostViewAura::EmulateDevice(bool enabled) {
1989 device_emulation_enabled_ = enabled;
1990 }
1991
1987 void RenderWidgetHostViewAura::ProcessAckedTouchEvent( 1992 void RenderWidgetHostViewAura::ProcessAckedTouchEvent(
1988 const TouchEventWithLatencyInfo& touch, InputEventAckState ack_result) { 1993 const TouchEventWithLatencyInfo& touch, InputEventAckState ack_result) {
1989 ScopedVector<ui::TouchEvent> events; 1994 ScopedVector<ui::TouchEvent> events;
1990 if (!MakeUITouchEventsFromWebTouchEvents(touch, &events, 1995 if (!MakeUITouchEventsFromWebTouchEvents(touch, &events,
1991 SCREEN_COORDINATES)) 1996 SCREEN_COORDINATES))
1992 return; 1997 return;
1993 1998
1994 aura::RootWindow* root = window_->GetRootWindow(); 1999 aura::RootWindow* root = window_->GetRootWindow();
1995 // |root| is NULL during tests. 2000 // |root| is NULL during tests.
1996 if (!root) 2001 if (!root)
(...skipping 1244 matching lines...) Expand 10 before | Expand all | Expand 10 after
3241 RenderWidgetHost* widget) { 3246 RenderWidgetHost* widget) {
3242 return new RenderWidgetHostViewAura(widget); 3247 return new RenderWidgetHostViewAura(widget);
3243 } 3248 }
3244 3249
3245 // static 3250 // static
3246 void RenderWidgetHostViewPort::GetDefaultScreenInfo(WebScreenInfo* results) { 3251 void RenderWidgetHostViewPort::GetDefaultScreenInfo(WebScreenInfo* results) {
3247 GetScreenInfoForWindow(results, NULL); 3252 GetScreenInfoForWindow(results, NULL);
3248 } 3253 }
3249 3254
3250 } // namespace content 3255 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698