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

Side by Side Diff: ash/ui_controls_ash.cc

Issue 11030017: Add context to gfx::Screen calls in support of simultaneous desktop+ash (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix new addition Created 8 years, 2 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
« no previous file with comments | « ash/touch/touch_observer_hud.cc ('k') | ash/wm/base_layout_manager_unittest.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 (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 "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 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
100 long y, 100 long y,
101 const base::Closure& closure) OVERRIDE { 101 const base::Closure& closure) OVERRIDE {
102 gfx::Point p(x, y); 102 gfx::Point p(x, y);
103 ui_controls::UIControlsAura* ui_controls = GetUIControlsAt(&p); 103 ui_controls::UIControlsAura* ui_controls = GetUIControlsAt(&p);
104 return ui_controls && 104 return ui_controls &&
105 ui_controls->SendMouseMoveNotifyWhenDone(p.x(), p.y(), closure); 105 ui_controls->SendMouseMoveNotifyWhenDone(p.x(), p.y(), closure);
106 } 106 }
107 107
108 virtual bool SendMouseEvents(ui_controls::MouseButton type, 108 virtual bool SendMouseEvents(ui_controls::MouseButton type,
109 int state) OVERRIDE { 109 int state) OVERRIDE {
110 gfx::Point p(gfx::Screen::GetCursorScreenPoint()); 110 gfx::Point p(Shell::GetScreen()->GetCursorScreenPoint());
111 ui_controls::UIControlsAura* ui_controls = GetUIControlsAt(&p); 111 ui_controls::UIControlsAura* ui_controls = GetUIControlsAt(&p);
112 return ui_controls && ui_controls->SendMouseEvents(type, state); 112 return ui_controls && ui_controls->SendMouseEvents(type, state);
113 } 113 }
114 114
115 virtual bool SendMouseEventsNotifyWhenDone( 115 virtual bool SendMouseEventsNotifyWhenDone(
116 ui_controls::MouseButton type, 116 ui_controls::MouseButton type,
117 int state, 117 int state,
118 const base::Closure& closure) OVERRIDE { 118 const base::Closure& closure) OVERRIDE {
119 gfx::Point p(gfx::Screen::GetCursorScreenPoint()); 119 gfx::Point p(Shell::GetScreen()->GetCursorScreenPoint());
120 ui_controls::UIControlsAura* ui_controls = GetUIControlsAt(&p); 120 ui_controls::UIControlsAura* ui_controls = GetUIControlsAt(&p);
121 return ui_controls && ui_controls->SendMouseEventsNotifyWhenDone( 121 return ui_controls && ui_controls->SendMouseEventsNotifyWhenDone(
122 type, state, closure); 122 type, state, closure);
123 } 123 }
124 124
125 virtual bool SendMouseClick(ui_controls::MouseButton type) OVERRIDE { 125 virtual bool SendMouseClick(ui_controls::MouseButton type) OVERRIDE {
126 gfx::Point p(gfx::Screen::GetCursorScreenPoint()); 126 gfx::Point p(Shell::GetScreen()->GetCursorScreenPoint());
127 ui_controls::UIControlsAura* ui_controls = GetUIControlsAt(&p); 127 ui_controls::UIControlsAura* ui_controls = GetUIControlsAt(&p);
128 return ui_controls && ui_controls->SendMouseClick(type); 128 return ui_controls && ui_controls->SendMouseClick(type);
129 } 129 }
130 130
131 virtual void RunClosureAfterAllPendingUIEvents( 131 virtual void RunClosureAfterAllPendingUIEvents(
132 const base::Closure& closure) OVERRIDE { 132 const base::Closure& closure) OVERRIDE {
133 ui_controls::UIControlsAura* ui_controls = GetUIControlsForRootWindow( 133 ui_controls::UIControlsAura* ui_controls = GetUIControlsForRootWindow(
134 Shell::GetActiveRootWindow()); 134 Shell::GetActiveRootWindow());
135 if (ui_controls) 135 if (ui_controls)
136 ui_controls->RunClosureAfterAllPendingUIEvents(closure); 136 ui_controls->RunClosureAfterAllPendingUIEvents(closure);
137 } 137 }
138 138
139 private: 139 private:
140 DISALLOW_COPY_AND_ASSIGN(UIControlsAsh); 140 DISALLOW_COPY_AND_ASSIGN(UIControlsAsh);
141 }; 141 };
142 142
143 ui_controls::UIControlsAura* CreateUIControls() { 143 ui_controls::UIControlsAura* CreateUIControls() {
144 return new UIControlsAsh(); 144 return new UIControlsAsh();
145 } 145 }
146 146
147 } // namespace internal 147 } // namespace internal
148 } // namespace ash 148 } // namespace ash
OLDNEW
« no previous file with comments | « ash/touch/touch_observer_hud.cc ('k') | ash/wm/base_layout_manager_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698