summaryrefslogtreecommitdiffstats
path: root/ui
diff options
context:
space:
mode:
authorjam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-01-14 04:00:31 +0000
committerjam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-01-14 04:00:31 +0000
commitb3e37db57b9adf2f3948897e140d162ddba62ae8 (patch)
treef2c2920f5ca6bf8e63d307392a98c0e35b92f046 /ui
parent20f39480af598ca9e300aa15806ebb591da1621f (diff)
downloadchromium_src-b3e37db57b9adf2f3948897e140d162ddba62ae8.zip
chromium_src-b3e37db57b9adf2f3948897e140d162ddba62ae8.tar.gz
chromium_src-b3e37db57b9adf2f3948897e140d162ddba62ae8.tar.bz2
Make ui_controls only usable from interactive_ui_tests. This has two benefits:
1) don't link test code in shipping binary 2) ensure that people don't call these functions which depend on focus in sharded test targets In a followup cl, I'll move the files to chrome\test\base Review URL: https://codereview.chromium.org/11878013 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@176638 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui')
-rw-r--r--ui/aura/aura.gyp2
-rw-r--r--ui/aura/test/aura_test_helper.cc3
-rw-r--r--ui/aura/ui_controls_aura.h5
-rw-r--r--ui/ui.gyp8
-rw-r--r--ui/ui_controls/ui_controls.h53
-rw-r--r--ui/ui_controls/ui_controls_aura.h3
-rw-r--r--ui/ui_controls/ui_controls_internal_win.h23
-rw-r--r--ui/views/widget/desktop_aura/desktop_root_window_host_win.cc3
8 files changed, 41 insertions, 59 deletions
diff --git a/ui/aura/aura.gyp b/ui/aura/aura.gyp
index 9b87df4c..47ed7c6 100644
--- a/ui/aura/aura.gyp
+++ b/ui/aura/aura.gyp
@@ -93,8 +93,6 @@
'root_window_view_mac.mm',
'root_window.cc',
'root_window.h',
- 'ui_controls_win.cc',
- 'ui_controls_x11.cc',
'window.cc',
'window.h',
'window_delegate.h',
diff --git a/ui/aura/test/aura_test_helper.cc b/ui/aura/test/aura_test_helper.cc
index 343afef..617cd5c 100644
--- a/ui/aura/test/aura_test_helper.cc
+++ b/ui/aura/test/aura_test_helper.cc
@@ -15,11 +15,9 @@
#include "ui/aura/test/test_activation_client.h"
#include "ui/aura/test/test_screen.h"
#include "ui/aura/test/test_stacking_client.h"
-#include "ui/aura/ui_controls_aura.h"
#include "ui/base/test/dummy_input_method.h"
#include "ui/compositor/layer_animator.h"
#include "ui/gfx/screen.h"
-#include "ui/ui_controls/ui_controls.h"
namespace aura {
namespace test {
@@ -47,7 +45,6 @@ void AuraTestHelper::SetUp() {
test_screen_.reset(new TestScreen());
gfx::Screen::SetScreenInstance(gfx::SCREEN_TYPE_NATIVE, test_screen_.get());
root_window_.reset(test_screen_->CreateRootWindowForPrimaryDisplay());
- ui_controls::InstallUIControlsAura(CreateUIControlsAura(root_window_.get()));
focus_client_.reset(new FocusManager);
client::SetFocusClient(root_window_.get(), focus_client_.get());
diff --git a/ui/aura/ui_controls_aura.h b/ui/aura/ui_controls_aura.h
index 4007430..7e920bc 100644
--- a/ui/aura/ui_controls_aura.h
+++ b/ui/aura/ui_controls_aura.h
@@ -5,8 +5,6 @@
#ifndef UI_AURA_UI_CONTROLS_AURA_H_
#define UI_AURA_UI_CONTROLS_AURA_H_
-#include "ui/aura/aura_export.h"
-
namespace ui_controls {
class UIControlsAura;
}
@@ -14,8 +12,7 @@ class UIControlsAura;
namespace aura {
class RootWindow;
-AURA_EXPORT ui_controls::UIControlsAura* CreateUIControlsAura(
- RootWindow* root_window);
+ui_controls::UIControlsAura* CreateUIControlsAura(RootWindow* root_window);
} // namespace aura
diff --git a/ui/ui.gyp b/ui/ui.gyp
index 947ea2a..6c9437d 100644
--- a/ui/ui.gyp
+++ b/ui/ui.gyp
@@ -532,13 +532,6 @@
'gfx/video_decode_acceleration_support_mac.mm',
'notifications/notification_types.h',
'notifications/notification_types.cc',
- 'ui_controls/ui_controls.h',
- 'ui_controls/ui_controls_aura.cc',
- 'ui_controls/ui_controls_gtk.cc',
- 'ui_controls/ui_controls_internal_win.cc',
- 'ui_controls/ui_controls_internal_win.h',
- 'ui_controls/ui_controls_mac.mm',
- 'ui_controls/ui_controls_win.cc',
],
'target_conditions': [
['OS == "ios"', {
@@ -607,7 +600,6 @@
['exclude', 'base/x/root_window_property_watcher_x.h'],
['exclude', 'base/x/work_area_watcher_x.cc'],
['exclude', 'base/x/work_area_watcher_x.h'],
- ['exclude', 'ui_controls_win.cc'],
],
}, { # use_aura!=1
'sources!': [
diff --git a/ui/ui_controls/ui_controls.h b/ui/ui_controls/ui_controls.h
index 6cf908c..a52fa0f 100644
--- a/ui/ui_controls/ui_controls.h
+++ b/ui/ui_controls/ui_controls.h
@@ -9,7 +9,6 @@
#include "build/build_config.h"
#include "ui/base/keycodes/keyboard_codes.h"
#include "ui/gfx/native_widget_types.h"
-#include "ui/base/ui_export.h"
namespace ui_controls {
@@ -32,25 +31,25 @@ namespace ui_controls {
//
// If you're writing a test chances are you want the variant in ui_test_utils.
// See it for details.
-UI_EXPORT bool SendKeyPress(gfx::NativeWindow window,
- ui::KeyboardCode key,
- bool control,
- bool shift,
- bool alt,
- bool command);
-UI_EXPORT bool SendKeyPressNotifyWhenDone(gfx::NativeWindow window,
- ui::KeyboardCode key,
- bool control,
- bool shift,
- bool alt,
- bool command,
- const base::Closure& task);
+bool SendKeyPress(gfx::NativeWindow window,
+ ui::KeyboardCode key,
+ bool control,
+ bool shift,
+ bool alt,
+ bool command);
+bool SendKeyPressNotifyWhenDone(gfx::NativeWindow window,
+ ui::KeyboardCode key,
+ bool control,
+ bool shift,
+ bool alt,
+ bool command,
+ const base::Closure& task);
// Simulate a mouse move. (x,y) are absolute screen coordinates.
-UI_EXPORT bool SendMouseMove(long x, long y);
-UI_EXPORT bool SendMouseMoveNotifyWhenDone(long x,
- long y,
- const base::Closure& task);
+bool SendMouseMove(long x, long y);
+bool SendMouseMoveNotifyWhenDone(long x,
+ long y,
+ const base::Closure& task);
enum MouseButton {
LEFT = 0,
@@ -67,22 +66,26 @@ enum MouseButtonState {
// Sends a mouse down and/or up message. The click will be sent to wherever
// the cursor currently is, so be sure to move the cursor before calling this
// (and be sure the cursor has arrived!).
-UI_EXPORT bool SendMouseEvents(MouseButton type, int state);
-UI_EXPORT bool SendMouseEventsNotifyWhenDone(MouseButton type,
- int state,
- const base::Closure& task);
+bool SendMouseEvents(MouseButton type, int state);
+bool SendMouseEventsNotifyWhenDone(MouseButton type,
+ int state,
+ const base::Closure& task);
// Same as SendMouseEvents with UP | DOWN.
-UI_EXPORT bool SendMouseClick(MouseButton type);
+bool SendMouseClick(MouseButton type);
#if defined(TOOLKIT_VIEWS)
// Runs |closure| after processing all pending ui events.
-UI_EXPORT void RunClosureAfterAllPendingUIEvents(const base::Closure& closure);
+void RunClosureAfterAllPendingUIEvents(const base::Closure& closure);
#endif
#if defined(USE_AURA)
class UIControlsAura;
-UI_EXPORT void InstallUIControlsAura(UIControlsAura* instance);
+void InstallUIControlsAura(UIControlsAura* instance);
+#endif
+
+#if defined(USE_ASH)
+ui_controls::UIControlsAura* CreateAshUIControls();
#endif
} // namespace ui_controls
diff --git a/ui/ui_controls/ui_controls_aura.h b/ui/ui_controls/ui_controls_aura.h
index 90778fd..02adea5 100644
--- a/ui/ui_controls/ui_controls_aura.h
+++ b/ui/ui_controls/ui_controls_aura.h
@@ -7,14 +7,13 @@
#include "base/callback_forward.h"
#include "ui/base/keycodes/keyboard_codes.h"
-#include "ui/base/ui_export.h"
#include "ui/gfx/native_widget_types.h"
#include "ui/ui_controls/ui_controls.h"
namespace ui_controls {
// An interface to provide Aura implementation of UI control.
-class UI_EXPORT UIControlsAura {
+class UIControlsAura {
public:
UIControlsAura();
virtual ~UIControlsAura();
diff --git a/ui/ui_controls/ui_controls_internal_win.h b/ui/ui_controls/ui_controls_internal_win.h
index c0ff521..67d0eff 100644
--- a/ui/ui_controls/ui_controls_internal_win.h
+++ b/ui/ui_controls/ui_controls_internal_win.h
@@ -7,7 +7,6 @@
#include "base/callback_forward.h"
#include "ui/ui_controls/ui_controls.h"
-#include "ui/base/ui_export.h"
namespace ui_controls {
namespace internal {
@@ -15,17 +14,17 @@ namespace internal {
// A utility functions for windows to send key or mouse events and
// run the task. These functions are internal, but exported so that
// aura implementation can use these utility functions.
-UI_EXPORT bool SendKeyPressImpl(HWND hwnd,
- ui::KeyboardCode key,
- bool control,
- bool shift,
- bool alt,
- const base::Closure& task);
-UI_EXPORT bool SendMouseMoveImpl(long x, long y, const base::Closure& task);
-UI_EXPORT bool SendMouseEventsImpl(MouseButton type,
- int state,
- const base::Closure& task);
-UI_EXPORT void RunClosureAfterAllPendingUITasksImpl(const base::Closure& task);
+bool SendKeyPressImpl(HWND hwnd,
+ ui::KeyboardCode key,
+ bool control,
+ bool shift,
+ bool alt,
+ const base::Closure& task);
+bool SendMouseMoveImpl(long x, long y, const base::Closure& task);
+bool SendMouseEventsImpl(MouseButton type,
+ int state,
+ const base::Closure& task);
+void RunClosureAfterAllPendingUITasksImpl(const base::Closure& task);
} // namespace internal
} // namespace ui_controls
diff --git a/ui/views/widget/desktop_aura/desktop_root_window_host_win.cc b/ui/views/widget/desktop_aura/desktop_root_window_host_win.cc
index 9204a2f..ce7ee03 100644
--- a/ui/views/widget/desktop_aura/desktop_root_window_host_win.cc
+++ b/ui/views/widget/desktop_aura/desktop_root_window_host_win.cc
@@ -10,7 +10,6 @@
#include "ui/aura/client/default_capture_client.h"
#include "ui/aura/focus_manager.h"
#include "ui/aura/root_window.h"
-#include "ui/aura/ui_controls_aura.h"
#include "ui/aura/window_property.h"
#include "ui/base/cursor/cursor_loader_win.h"
#include "ui/base/ime/input_method_win.h"
@@ -19,7 +18,6 @@
#include "ui/gfx/path_win.h"
#include "ui/native_theme/native_theme_aura.h"
#include "ui/native_theme/native_theme_win.h"
-#include "ui/ui_controls/ui_controls.h"
#include "ui/views/corewm/compound_event_filter.h"
#include "ui/views/corewm/input_method_event_filter.h"
#include "ui/views/ime/input_method_bridge.h"
@@ -145,7 +143,6 @@ aura::RootWindow* DesktopRootWindowHostWin::Init(
focus_client_->FocusWindow(content_window_);
root_window_->SetProperty(kContentWindowForRootWindow, content_window_);
- ui_controls::InstallUIControlsAura(CreateUIControlsAura(root_window_));
return root_window_;
}