summaryrefslogtreecommitdiffstats
path: root/ash
diff options
context:
space:
mode:
authorjam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-01-14 17:19:02 +0000
committerjam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-01-14 17:19:02 +0000
commitb73674288eb2277336403739faa7da7df2101e4c (patch)
tree1b1154873cbf7a05666252dff036fdb33dcc9e49 /ash
parent1cf075aff641f554f98504242cc42a884b791a3b (diff)
downloadchromium_src-b73674288eb2277336403739faa7da7df2101e4c.zip
chromium_src-b73674288eb2277336403739faa7da7df2101e4c.tar.gz
chromium_src-b73674288eb2277336403739faa7da7df2101e4c.tar.bz2
Move ui_controls files to chrome\test\base since they're now only usd within chrome.
Review URL: https://codereview.chromium.org/11886018 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@176680 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ash')
-rw-r--r--ash/ui_controls_ash.cc145
-rw-r--r--ash/wm/window_properties.cc2
2 files changed, 0 insertions, 147 deletions
diff --git a/ash/ui_controls_ash.cc b/ash/ui_controls_ash.cc
deleted file mode 100644
index e455fe5..0000000
--- a/ash/ui_controls_ash.cc
+++ /dev/null
@@ -1,145 +0,0 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "ash/shell.h"
-#include "ash/shell_factory.h"
-#include "ash/wm/coordinate_conversion.h"
-#include "ash/wm/window_properties.h"
-#include "ui/aura/client/capture_client.h"
-#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 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.
-ui_controls::UIControlsAura* GetUIControlsForRootWindow(
- aura::RootWindow* root_window) {
- ui_controls::UIControlsAura* native_ui_control =
- root_window->GetProperty(kUIControlsKey);
- if (!native_ui_control) {
- native_ui_control = aura::CreateUIControlsAura(root_window);
- // Pass the ownership to the |root_window|.
- root_window->SetProperty(kUIControlsKey, native_ui_control);
- }
- return native_ui_control;
-}
-
-// Returns the UIControls object for the RootWindow at the |point_in_screen|
-// in virtual screen coordinates, and updates the |point| relative to the
-// UIControlsAura's root window. NULL if there is no RootWindow under
-// 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 = ash::wm::GetRootWindowAt(*point_in_screen);
-
- aura::client::ScreenPositionClient* screen_position_client =
- aura::client::GetScreenPositionClient(root);
- if (screen_position_client)
- screen_position_client->ConvertPointFromScreen(root, point_in_screen);
-
- return GetUIControlsForRootWindow(root);
-}
-
-} // namespace
-
-class UIControlsAsh : public ui_controls::UIControlsAura {
- public:
- UIControlsAsh() {
- }
- virtual ~UIControlsAsh() {
- }
-
- // ui_controls::UIControslAura overrides:
- virtual bool SendKeyPress(gfx::NativeWindow window,
- ui::KeyboardCode key,
- bool control,
- bool shift,
- bool alt,
- bool command) OVERRIDE {
- return SendKeyPressNotifyWhenDone(
- window, key, control, shift, alt, command, base::Closure());
- }
-
- virtual bool SendKeyPressNotifyWhenDone(
- gfx::NativeWindow window,
- ui::KeyboardCode key,
- bool control,
- bool shift,
- bool alt,
- bool command,
- const base::Closure& closure) OVERRIDE {
- aura::RootWindow* root =
- 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);
- }
-
- virtual bool SendMouseMove(long x, long y) OVERRIDE {
- gfx::Point p(x, y);
- ui_controls::UIControlsAura* ui_controls = GetUIControlsAt(&p);
- return ui_controls && ui_controls->SendMouseMove(p.x(), p.y());
- }
-
- virtual bool SendMouseMoveNotifyWhenDone(
- long x,
- long y,
- const base::Closure& closure) OVERRIDE {
- gfx::Point p(x, y);
- ui_controls::UIControlsAura* ui_controls = GetUIControlsAt(&p);
- return ui_controls &&
- ui_controls->SendMouseMoveNotifyWhenDone(p.x(), p.y(), closure);
- }
-
- virtual bool SendMouseEvents(ui_controls::MouseButton type,
- int state) OVERRIDE {
- gfx::Point p(ash::Shell::GetScreen()->GetCursorScreenPoint());
- ui_controls::UIControlsAura* ui_controls = GetUIControlsAt(&p);
- return ui_controls && ui_controls->SendMouseEvents(type, state);
- }
-
- virtual bool SendMouseEventsNotifyWhenDone(
- ui_controls::MouseButton type,
- int state,
- const base::Closure& closure) OVERRIDE {
- 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(ash::Shell::GetScreen()->GetCursorScreenPoint());
- ui_controls::UIControlsAura* ui_controls = GetUIControlsAt(&p);
- return ui_controls && ui_controls->SendMouseClick(type);
- }
-
- virtual void RunClosureAfterAllPendingUIEvents(
- const base::Closure& closure) OVERRIDE {
- ui_controls::UIControlsAura* ui_controls = GetUIControlsForRootWindow(
- ash::Shell::GetActiveRootWindow());
- if (ui_controls)
- ui_controls->RunClosureAfterAllPendingUIEvents(closure);
- }
-
- private:
- DISALLOW_COPY_AND_ASSIGN(UIControlsAsh);
-};
-
-ui_controls::UIControlsAura* CreateAshUIControls() {
- return new UIControlsAsh();
-}
-
-} // namespace ui_controls
diff --git a/ash/wm/window_properties.cc b/ash/wm/window_properties.cc
index 7c3a519..a52ab21 100644
--- a/ash/wm/window_properties.cc
+++ b/ash/wm/window_properties.cc
@@ -9,12 +9,10 @@
#include "ash/wm/frame_painter.h"
#include "ui/aura/window_property.h"
#include "ui/gfx/rect.h"
-#include "ui/ui_controls/ui_controls_aura.h"
DECLARE_WINDOW_PROPERTY_TYPE(ash::internal::AlwaysOnTopController*);
DECLARE_EXPORTED_WINDOW_PROPERTY_TYPE(ASH_EXPORT, ash::FramePainter*);
DECLARE_WINDOW_PROPERTY_TYPE(ash::WindowPersistsAcrossAllWorkspacesType)
-DECLARE_WINDOW_PROPERTY_TYPE(ui_controls::UIControlsAura*)
DECLARE_WINDOW_PROPERTY_TYPE(ash::internal::RootWindowController*);
namespace ash {