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

Unified Diff: ash/ui_controls_ash.cc

Issue 11878013: Make ui_controls only usable from interactive_ui_tests. This has two benefits: (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ash/shell_factory.h ('k') | ash/wm/window_properties.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/ui_controls_ash.cc
===================================================================
--- ash/ui_controls_ash.cc (revision 176470)
+++ ash/ui_controls_ash.cc (working copy)
@@ -10,13 +10,17 @@
#include "ui/aura/client/screen_position_client.h"
#include "ui/aura/root_window.h"
#include "ui/aura/ui_controls_aura.h"
+#include "ui/aura/window_property.h"
#include "ui/gfx/screen.h"
#include "ui/ui_controls/ui_controls_aura.h"
-namespace ash {
-namespace internal {
+namespace ui_controls {
namespace {
+DEFINE_OWNED_WINDOW_PROPERTY_KEY(ui_controls::UIControlsAura,
+ kUIControlsKey,
+ NULL);
+
// Returns the UIControls object for RootWindow.
// kUIControlsKey is owned property and UIControls object
// will be deleted when the root window is deleted.
@@ -38,7 +42,7 @@
// the |point_in_screen|.
ui_controls::UIControlsAura* GetUIControlsAt(gfx::Point* point_in_screen) {
// TODO(mazda): Support the case passive grab is taken.
- aura::RootWindow* root = wm::GetRootWindowAt(*point_in_screen);
+ aura::RootWindow* root = ash::wm::GetRootWindowAt(*point_in_screen);
aura::client::ScreenPositionClient* screen_position_client =
aura::client::GetScreenPositionClient(root);
@@ -77,7 +81,7 @@
bool command,
const base::Closure& closure) OVERRIDE {
aura::RootWindow* root =
- window ? window->GetRootWindow() : Shell::GetActiveRootWindow();
+ window ? window->GetRootWindow() : ash::Shell::GetActiveRootWindow();
ui_controls::UIControlsAura* ui_controls = GetUIControlsForRootWindow(root);
return ui_controls && ui_controls->SendKeyPressNotifyWhenDone(
window, key, control, shift, alt, command, closure);
@@ -101,7 +105,7 @@
virtual bool SendMouseEvents(ui_controls::MouseButton type,
int state) OVERRIDE {
- gfx::Point p(Shell::GetScreen()->GetCursorScreenPoint());
+ gfx::Point p(ash::Shell::GetScreen()->GetCursorScreenPoint());
ui_controls::UIControlsAura* ui_controls = GetUIControlsAt(&p);
return ui_controls && ui_controls->SendMouseEvents(type, state);
}
@@ -110,14 +114,14 @@
ui_controls::MouseButton type,
int state,
const base::Closure& closure) OVERRIDE {
- gfx::Point p(Shell::GetScreen()->GetCursorScreenPoint());
+ gfx::Point p(ash::Shell::GetScreen()->GetCursorScreenPoint());
ui_controls::UIControlsAura* ui_controls = GetUIControlsAt(&p);
return ui_controls && ui_controls->SendMouseEventsNotifyWhenDone(
type, state, closure);
}
virtual bool SendMouseClick(ui_controls::MouseButton type) OVERRIDE {
- gfx::Point p(Shell::GetScreen()->GetCursorScreenPoint());
+ gfx::Point p(ash::Shell::GetScreen()->GetCursorScreenPoint());
ui_controls::UIControlsAura* ui_controls = GetUIControlsAt(&p);
return ui_controls && ui_controls->SendMouseClick(type);
}
@@ -125,7 +129,7 @@
virtual void RunClosureAfterAllPendingUIEvents(
const base::Closure& closure) OVERRIDE {
ui_controls::UIControlsAura* ui_controls = GetUIControlsForRootWindow(
- Shell::GetActiveRootWindow());
+ ash::Shell::GetActiveRootWindow());
if (ui_controls)
ui_controls->RunClosureAfterAllPendingUIEvents(closure);
}
@@ -134,9 +138,8 @@
DISALLOW_COPY_AND_ASSIGN(UIControlsAsh);
};
-ui_controls::UIControlsAura* CreateUIControls() {
+ui_controls::UIControlsAura* CreateAshUIControls() {
return new UIControlsAsh();
}
-} // namespace internal
-} // namespace ash
+} // namespace ui_controls
« no previous file with comments | « ash/shell_factory.h ('k') | ash/wm/window_properties.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698