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

Side by Side Diff: ash/test/ui_controls_factory_ash.cc

Issue 1608053002: Remove now-unnecessary wrappers around gfx::Screen::GetScreen() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@metro-mode-5
Patch Set: cros Created 4 years, 11 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 | « ash/test/ash_test_base.cc ('k') | ash/touch/touch_observer_hud.cc » ('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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "ash/shell.h" 5 #include "ash/shell.h"
6 #include "ash/shell_factory.h" 6 #include "ash/shell_factory.h"
7 #include "ash/wm/coordinate_conversion.h" 7 #include "ash/wm/coordinate_conversion.h"
8 #include "ash/wm/window_properties.h" 8 #include "ash/wm/window_properties.h"
9 #include "ui/aura/client/capture_client.h" 9 #include "ui/aura/client/capture_client.h"
10 #include "ui/aura/client/screen_position_client.h" 10 #include "ui/aura/client/screen_position_client.h"
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
90 bool SendMouseMoveNotifyWhenDone(long x, 90 bool SendMouseMoveNotifyWhenDone(long x,
91 long y, 91 long y,
92 const base::Closure& closure) override { 92 const base::Closure& closure) override {
93 gfx::Point p(x, y); 93 gfx::Point p(x, y);
94 UIControlsAura* ui_controls = GetUIControlsAt(p); 94 UIControlsAura* ui_controls = GetUIControlsAt(p);
95 return ui_controls && 95 return ui_controls &&
96 ui_controls->SendMouseMoveNotifyWhenDone(p.x(), p.y(), closure); 96 ui_controls->SendMouseMoveNotifyWhenDone(p.x(), p.y(), closure);
97 } 97 }
98 98
99 bool SendMouseEvents(MouseButton type, int state) override { 99 bool SendMouseEvents(MouseButton type, int state) override {
100 gfx::Point p(ash::Shell::GetScreen()->GetCursorScreenPoint()); 100 gfx::Point p(gfx::Screen::GetScreen()->GetCursorScreenPoint());
101 UIControlsAura* ui_controls = GetUIControlsAt(p); 101 UIControlsAura* ui_controls = GetUIControlsAt(p);
102 return ui_controls && ui_controls->SendMouseEvents(type, state); 102 return ui_controls && ui_controls->SendMouseEvents(type, state);
103 } 103 }
104 104
105 bool SendMouseEventsNotifyWhenDone(MouseButton type, 105 bool SendMouseEventsNotifyWhenDone(MouseButton type,
106 int state, 106 int state,
107 const base::Closure& closure) override { 107 const base::Closure& closure) override {
108 gfx::Point p(aura::Env::GetInstance()->last_mouse_location()); 108 gfx::Point p(aura::Env::GetInstance()->last_mouse_location());
109 UIControlsAura* ui_controls = GetUIControlsAt(p); 109 UIControlsAura* ui_controls = GetUIControlsAt(p);
110 return ui_controls && ui_controls->SendMouseEventsNotifyWhenDone( 110 return ui_controls && ui_controls->SendMouseEventsNotifyWhenDone(
111 type, state, closure); 111 type, state, closure);
112 } 112 }
113 113
114 bool SendMouseClick(MouseButton type) override { 114 bool SendMouseClick(MouseButton type) override {
115 gfx::Point p(ash::Shell::GetScreen()->GetCursorScreenPoint()); 115 gfx::Point p(gfx::Screen::GetScreen()->GetCursorScreenPoint());
116 UIControlsAura* ui_controls = GetUIControlsAt(p); 116 UIControlsAura* ui_controls = GetUIControlsAt(p);
117 return ui_controls && ui_controls->SendMouseClick(type); 117 return ui_controls && ui_controls->SendMouseClick(type);
118 } 118 }
119 119
120 void RunClosureAfterAllPendingUIEvents( 120 void RunClosureAfterAllPendingUIEvents(
121 const base::Closure& closure) override { 121 const base::Closure& closure) override {
122 UIControlsAura* ui_controls = GetUIControlsForRootWindow( 122 UIControlsAura* ui_controls = GetUIControlsForRootWindow(
123 ash::Shell::GetTargetRootWindow()); 123 ash::Shell::GetTargetRootWindow());
124 if (ui_controls) 124 if (ui_controls)
125 ui_controls->RunClosureAfterAllPendingUIEvents(closure); 125 ui_controls->RunClosureAfterAllPendingUIEvents(closure);
126 } 126 }
127 127
128 private: 128 private:
129 DISALLOW_COPY_AND_ASSIGN(UIControlsAsh); 129 DISALLOW_COPY_AND_ASSIGN(UIControlsAsh);
130 }; 130 };
131 131
132 ui_controls::UIControlsAura* CreateAshUIControls() { 132 ui_controls::UIControlsAura* CreateAshUIControls() {
133 return new ash::test::UIControlsAsh(); 133 return new ash::test::UIControlsAsh();
134 } 134 }
135 135
136 } // namespace test 136 } // namespace test
137 } // namespace ash 137 } // namespace ash
OLDNEW
« no previous file with comments | « ash/test/ash_test_base.cc ('k') | ash/touch/touch_observer_hud.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698