diff options
author | ben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-03-26 14:48:10 +0000 |
---|---|---|
committer | ben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-03-26 14:48:10 +0000 |
commit | bcd1567c3bfdb094b2c24e0935ed16f08b0d1e41 (patch) | |
tree | 8d170862fabd03b266f6960f1dd615a987872a62 /ui/wm | |
parent | b596068321d72606cd8e65204380e2b23b9169cc (diff) | |
download | chromium_src-bcd1567c3bfdb094b2c24e0935ed16f08b0d1e41.zip chromium_src-bcd1567c3bfdb094b2c24e0935ed16f08b0d1e41.tar.gz chromium_src-bcd1567c3bfdb094b2c24e0935ed16f08b0d1e41.tar.bz2 |
Move wm/public into wm target
TBR=sky@chromium.org
http://crbug/com/308710
Review URL: https://codereview.chromium.org/209383003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@259580 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui/wm')
45 files changed, 420 insertions, 250 deletions
diff --git a/ui/wm/core/base_focus_rules.h b/ui/wm/core/base_focus_rules.h index 7195dad..07dfb65 100644 --- a/ui/wm/core/base_focus_rules.h +++ b/ui/wm/core/base_focus_rules.h @@ -13,7 +13,7 @@ namespace wm { // A set of basic focus and activation rules. Specializations should most likely // subclass this and call up to these methods rather than reimplementing them. -class WM_CORE_EXPORT BaseFocusRules : public FocusRules { +class WM_EXPORT BaseFocusRules : public FocusRules { protected: BaseFocusRules(); virtual ~BaseFocusRules(); diff --git a/ui/wm/core/capture_controller.h b/ui/wm/core/capture_controller.h index a368b63..d802818 100644 --- a/ui/wm/core/capture_controller.h +++ b/ui/wm/core/capture_controller.h @@ -11,12 +11,12 @@ #include "base/compiler_specific.h" #include "ui/aura/client/capture_client.h" #include "ui/aura/window_observer.h" -#include "ui/wm/core/wm_core_export.h" +#include "ui/wm/wm_export.h" namespace wm { // Internal CaptureClient implementation. See ScopedCaptureClient for details. -class WM_CORE_EXPORT CaptureController : public aura::client::CaptureClient { +class WM_EXPORT CaptureController : public aura::client::CaptureClient { public: // Adds |root| to the list of RootWindows notified when capture changes. void Attach(aura::Window* root); @@ -53,7 +53,7 @@ class WM_CORE_EXPORT CaptureController : public aura::client::CaptureClient { // ScopedCaptureClient is responsible for creating a CaptureClient for a // RootWindow. Specifically it creates a single CaptureController that is shared // among all ScopedCaptureClients and adds the RootWindow to it. -class WM_CORE_EXPORT ScopedCaptureClient : public aura::WindowObserver { +class WM_EXPORT ScopedCaptureClient : public aura::WindowObserver { public: explicit ScopedCaptureClient(aura::Window* root); virtual ~ScopedCaptureClient(); diff --git a/ui/wm/core/compound_event_filter.h b/ui/wm/core/compound_event_filter.h index 4b72673..ab4fdf8 100644 --- a/ui/wm/core/compound_event_filter.h +++ b/ui/wm/core/compound_event_filter.h @@ -10,7 +10,7 @@ #include "ui/events/event.h" #include "ui/events/event_handler.h" #include "ui/gfx/native_widget_types.h" -#include "ui/wm/core/wm_core_export.h" +#include "ui/wm/wm_export.h" namespace aura { class CursorManager; @@ -37,7 +37,7 @@ namespace wm { // consumed by any of those filters. If an event is consumed by a filter, the // rest of the filter(s) and CompoundEventFilter will not see the consumed // event. -class WM_CORE_EXPORT CompoundEventFilter : public ui::EventHandler { +class WM_EXPORT CompoundEventFilter : public ui::EventHandler { public: CompoundEventFilter(); virtual ~CompoundEventFilter(); diff --git a/ui/wm/core/cursor_manager.h b/ui/wm/core/cursor_manager.h index 3640c7e..b8ade87 100644 --- a/ui/wm/core/cursor_manager.h +++ b/ui/wm/core/cursor_manager.h @@ -14,7 +14,7 @@ #include "ui/gfx/native_widget_types.h" #include "ui/gfx/point.h" #include "ui/wm/core/native_cursor_manager_delegate.h" -#include "ui/wm/core/wm_core_export.h" +#include "ui/wm/wm_export.h" namespace gfx { class Display; @@ -32,8 +32,8 @@ class NativeCursorManager; // requests to queue any further changes until a later time. It sends changes // to the NativeCursorManager, which communicates back to us when these changes // were made through the NativeCursorManagerDelegate interface. -class WM_CORE_EXPORT CursorManager : public aura::client::CursorClient, - public NativeCursorManagerDelegate { +class WM_EXPORT CursorManager : public aura::client::CursorClient, + public NativeCursorManagerDelegate { public: CursorManager(scoped_ptr<NativeCursorManager> delegate); virtual ~CursorManager(); diff --git a/ui/wm/core/default_activation_client.cc b/ui/wm/core/default_activation_client.cc new file mode 100644 index 0000000..d4a55ee --- /dev/null +++ b/ui/wm/core/default_activation_client.cc @@ -0,0 +1,128 @@ +// Copyright 2013 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 "ui/wm/core/default_activation_client.h" + +#include "ui/aura/window.h" +#include "ui/wm/public/activation_change_observer.h" +#include "ui/wm/public/activation_delegate.h" + +namespace aura { +namespace client { + +//////////////////////////////////////////////////////////////////////////////// +// DefaultActivationClient, public: + +DefaultActivationClient::DefaultActivationClient(Window* root_window) + : last_active_(NULL) { + client::SetActivationClient(root_window, this); +} + +DefaultActivationClient::~DefaultActivationClient() { + for (unsigned int i = 0; i < active_windows_.size(); ++i) { + active_windows_[i]->RemoveObserver(this); + } +} + +//////////////////////////////////////////////////////////////////////////////// +// DefaultActivationClient, client::ActivationClient implementation: + +void DefaultActivationClient::AddObserver( + client::ActivationChangeObserver* observer) { + observers_.AddObserver(observer); +} + +void DefaultActivationClient::RemoveObserver( + client::ActivationChangeObserver* observer) { + observers_.RemoveObserver(observer); +} + +void DefaultActivationClient::ActivateWindow(Window* window) { + Window* last_active = GetActiveWindow(); + if (last_active == window) + return; + + last_active_ = last_active; + RemoveActiveWindow(window); + active_windows_.push_back(window); + window->parent()->StackChildAtTop(window); + window->AddObserver(this); + + FOR_EACH_OBSERVER(client::ActivationChangeObserver, + observers_, + OnWindowActivated(window, last_active)); + + aura::client::ActivationChangeObserver* observer = + aura::client::GetActivationChangeObserver(last_active); + if (observer) + observer->OnWindowActivated(window, last_active); + observer = aura::client::GetActivationChangeObserver(window); + if (observer) + observer->OnWindowActivated(window, last_active); +} + +void DefaultActivationClient::DeactivateWindow(Window* window) { + aura::client::ActivationChangeObserver* observer = + aura::client::GetActivationChangeObserver(window); + if (observer) + observer->OnWindowActivated(NULL, window); + if (last_active_) + ActivateWindow(last_active_); +} + +Window* DefaultActivationClient::GetActiveWindow() { + if (active_windows_.empty()) + return NULL; + return active_windows_.back(); +} + +Window* DefaultActivationClient::GetActivatableWindow(Window* window) { + return NULL; +} + +Window* DefaultActivationClient::GetToplevelWindow(Window* window) { + return NULL; +} + +bool DefaultActivationClient::OnWillFocusWindow(Window* window, + const ui::Event* event) { + return true; +} + +bool DefaultActivationClient::CanActivateWindow(Window* window) const { + return true; +} + +//////////////////////////////////////////////////////////////////////////////// +// DefaultActivationClient, WindowObserver implementation: + +void DefaultActivationClient::OnWindowDestroyed(Window* window) { + if (window == last_active_) + last_active_ = NULL; + + if (window == GetActiveWindow()) { + active_windows_.pop_back(); + Window* next_active = GetActiveWindow(); + if (next_active && aura::client::GetActivationChangeObserver(next_active)) { + aura::client::GetActivationChangeObserver(next_active)->OnWindowActivated( + next_active, NULL); + } + return; + } + + RemoveActiveWindow(window); +} + +void DefaultActivationClient::RemoveActiveWindow(Window* window) { + for (unsigned int i = 0; i < active_windows_.size(); ++i) { + if (active_windows_[i] == window) { + active_windows_.erase(active_windows_.begin() + i); + window->RemoveObserver(this); + return; + } + } +} + +} // namespace client +} // namespace aura diff --git a/ui/wm/core/default_activation_client.h b/ui/wm/core/default_activation_client.h new file mode 100644 index 0000000..8153068 --- /dev/null +++ b/ui/wm/core/default_activation_client.h @@ -0,0 +1,69 @@ +// Copyright 2013 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. + +#ifndef UI_WM_CORE_DEFAULT_ACTIVATION_CLIENT_H_ +#define UI_WM_CORE_DEFAULT_ACTIVATION_CLIENT_H_ + +#include <vector> + +#include "base/compiler_specific.h" +#include "base/logging.h" +#include "base/observer_list.h" +#include "ui/aura/window_observer.h" +#include "ui/wm/public/activation_client.h" +#include "ui/wm/wm_export.h" + +namespace aura { +namespace client { +class ActivationChangeObserver; +} + +namespace client { + +// Simple ActivationClient implementation for use by tests and other targets +// that just need basic behavior (e.g. activate windows whenever requested, +// restack windows at the top when they're activated, etc.). +class WM_EXPORT DefaultActivationClient : public client::ActivationClient, + public WindowObserver { + public: + explicit DefaultActivationClient(Window* root_window); + virtual ~DefaultActivationClient(); + + // Overridden from client::ActivationClient: + virtual void AddObserver(client::ActivationChangeObserver* observer) OVERRIDE; + virtual void RemoveObserver( + client::ActivationChangeObserver* observer) OVERRIDE; + virtual void ActivateWindow(Window* window) OVERRIDE; + virtual void DeactivateWindow(Window* window) OVERRIDE; + virtual Window* GetActiveWindow() OVERRIDE; + virtual Window* GetActivatableWindow(Window* window) OVERRIDE; + virtual Window* GetToplevelWindow(Window* window) OVERRIDE; + virtual bool OnWillFocusWindow(Window* window, + const ui::Event* event) OVERRIDE; + virtual bool CanActivateWindow(Window* window) const OVERRIDE; + + // Overridden from WindowObserver: + virtual void OnWindowDestroyed(Window* window) OVERRIDE; + + private: + void RemoveActiveWindow(Window* window); + + // This class explicitly does NOT store the active window in a window property + // to make sure that ActivationChangeObserver is not treated as part of the + // aura API. Assumptions to that end will cause tests that use this client to + // fail. + std::vector<Window*> active_windows_; + + // The window which was active before the currently active one. + Window* last_active_; + + ObserverList<client::ActivationChangeObserver> observers_; + + DISALLOW_COPY_AND_ASSIGN(DefaultActivationClient); +}; + +} // namespace client +} // namespace aura + +#endif // UI_WM_CORE_DEFAULT_ACTIVATION_CLIENT_H_ diff --git a/ui/wm/core/easy_resize_window_targeter.h b/ui/wm/core/easy_resize_window_targeter.h index fae6d46..90b0848 100644 --- a/ui/wm/core/easy_resize_window_targeter.h +++ b/ui/wm/core/easy_resize_window_targeter.h @@ -7,13 +7,13 @@ #include "ui/aura/window_targeter.h" #include "ui/gfx/geometry/insets.h" -#include "ui/wm/core/wm_core_export.h" +#include "ui/wm/wm_export.h" namespace wm { // An EventTargeter for a container window that uses a slightly larger // hit-target region for easier resize. -class WM_CORE_EXPORT EasyResizeWindowTargeter : public aura::WindowTargeter { +class WM_EXPORT EasyResizeWindowTargeter : public aura::WindowTargeter { public: // |container| window is the owner of this targeter. EasyResizeWindowTargeter(aura::Window* container, diff --git a/ui/wm/core/focus_controller.h b/ui/wm/core/focus_controller.h index fecdd2e..de15d71 100644 --- a/ui/wm/core/focus_controller.h +++ b/ui/wm/core/focus_controller.h @@ -12,8 +12,8 @@ #include "ui/aura/client/focus_client.h" #include "ui/aura/window_observer.h" #include "ui/events/event_handler.h" -#include "ui/wm/core/wm_core_export.h" #include "ui/wm/public/activation_client.h" +#include "ui/wm/wm_export.h" namespace wm { @@ -34,7 +34,7 @@ class FocusRules; // . Window disposition changes (implemented here in aura::WindowObserver). // (The FocusController registers itself as an observer of the active and // focused windows). -class WM_CORE_EXPORT FocusController : public aura::client::ActivationClient, +class WM_EXPORT FocusController : public aura::client::ActivationClient, public aura::client::FocusClient, public ui::EventHandler, public aura::WindowObserver { diff --git a/ui/wm/core/focus_rules.h b/ui/wm/core/focus_rules.h index 79ffd74..cb9a4dd 100644 --- a/ui/wm/core/focus_rules.h +++ b/ui/wm/core/focus_rules.h @@ -5,7 +5,7 @@ #ifndef UI_WM_CORE_FOCUS_RULES_H_ #define UI_WM_CORE_FOCUS_RULES_H_ -#include "ui/wm/core/wm_core_export.h" +#include "ui/wm/wm_export.h" namespace aura { class Window; @@ -15,7 +15,7 @@ namespace wm { // Implemented by an object that establishes the rules about what can be // focused or activated. -class WM_CORE_EXPORT FocusRules { +class WM_EXPORT FocusRules { public: virtual ~FocusRules() {} diff --git a/ui/wm/core/image_grid.h b/ui/wm/core/image_grid.h index 49ac642..bee1e46 100644 --- a/ui/wm/core/image_grid.h +++ b/ui/wm/core/image_grid.h @@ -12,7 +12,7 @@ #include "ui/compositor/layer_delegate.h" #include "ui/gfx/rect.h" #include "ui/gfx/size.h" -#include "ui/wm/core/wm_core_export.h" +#include "ui/wm/wm_export.h" namespace gfx { class Image; @@ -56,10 +56,10 @@ namespace wm { // | xXX| // ... // -class WM_CORE_EXPORT ImageGrid { +class WM_EXPORT ImageGrid { public: // Helper class for use by tests. - class WM_CORE_EXPORT TestAPI { + class WM_EXPORT TestAPI { public: TestAPI(ImageGrid* grid) : grid_(grid) {} diff --git a/ui/wm/core/input_method_event_filter.h b/ui/wm/core/input_method_event_filter.h index 17a6a0e..c4033d1 100644 --- a/ui/wm/core/input_method_event_filter.h +++ b/ui/wm/core/input_method_event_filter.h @@ -11,7 +11,7 @@ #include "ui/base/ime/input_method_delegate.h" #include "ui/events/event_handler.h" #include "ui/gfx/native_widget_types.h" -#include "ui/wm/core/wm_core_export.h" +#include "ui/wm/wm_export.h" namespace ui { class EventProcessor; @@ -22,7 +22,7 @@ namespace wm { // An event filter that forwards a KeyEvent to a system IME, and dispatches a // TranslatedKeyEvent to the root window as needed. -class WM_CORE_EXPORT InputMethodEventFilter +class WM_EXPORT InputMethodEventFilter : public ui::EventHandler, public ui::internal::InputMethodDelegate { public: diff --git a/ui/wm/core/masked_window_targeter.h b/ui/wm/core/masked_window_targeter.h index 846021a..46cf4d2 100644 --- a/ui/wm/core/masked_window_targeter.h +++ b/ui/wm/core/masked_window_targeter.h @@ -6,7 +6,7 @@ #define UI_WM_CORE_MASKED_WINDOW_TARGETER_H_ #include "ui/aura/window_targeter.h" -#include "ui/wm/core/wm_core_export.h" +#include "ui/wm/wm_export.h" namespace gfx { class Path; @@ -14,7 +14,7 @@ class Path; namespace wm { -class WM_CORE_EXPORT MaskedWindowTargeter : public aura::WindowTargeter { +class WM_EXPORT MaskedWindowTargeter : public aura::WindowTargeter { public: explicit MaskedWindowTargeter(aura::Window* masked_window); virtual ~MaskedWindowTargeter(); diff --git a/ui/wm/core/native_cursor_manager.h b/ui/wm/core/native_cursor_manager.h index 68c9d46..60f72bd 100644 --- a/ui/wm/core/native_cursor_manager.h +++ b/ui/wm/core/native_cursor_manager.h @@ -7,7 +7,7 @@ #include "base/strings/string16.h" #include "ui/wm/core/native_cursor_manager_delegate.h" -#include "ui/wm/core/wm_core_export.h" +#include "ui/wm/wm_export.h" namespace gfx { class Display; @@ -19,7 +19,7 @@ namespace wm { // requested changes to cursor state. When requested, implementer should tell // the CursorManager of any actual state changes performed through the // delegate. -class WM_CORE_EXPORT NativeCursorManager { +class WM_EXPORT NativeCursorManager { public: virtual ~NativeCursorManager() {} diff --git a/ui/wm/core/native_cursor_manager_delegate.h b/ui/wm/core/native_cursor_manager_delegate.h index 0571d57..5237221 100644 --- a/ui/wm/core/native_cursor_manager_delegate.h +++ b/ui/wm/core/native_cursor_manager_delegate.h @@ -7,14 +7,14 @@ #include "ui/base/cursor/cursor.h" #include "ui/gfx/native_widget_types.h" -#include "ui/wm/core/wm_core_export.h" +#include "ui/wm/wm_export.h" namespace wm { // The non-public interface that CursorManager exposes to its users. This // gives accessors to all the current state, and mutators to all the current // state. -class WM_CORE_EXPORT NativeCursorManagerDelegate { +class WM_EXPORT NativeCursorManagerDelegate { public: virtual ~NativeCursorManagerDelegate() {} diff --git a/ui/wm/core/shadow.h b/ui/wm/core/shadow.h index fa42976..c153ecf1 100644 --- a/ui/wm/core/shadow.h +++ b/ui/wm/core/shadow.h @@ -9,7 +9,7 @@ #include "base/memory/scoped_ptr.h" #include "ui/compositor/layer_animation_observer.h" #include "ui/gfx/rect.h" -#include "ui/wm/core/wm_core_export.h" +#include "ui/wm/wm_export.h" namespace ui { class Layer; @@ -20,7 +20,7 @@ namespace wm { class ImageGrid; // Simple class that draws a drop shadow around content at given bounds. -class WM_CORE_EXPORT Shadow : public ui::ImplicitAnimationObserver { +class WM_EXPORT Shadow : public ui::ImplicitAnimationObserver { public: enum Style { // Active windows have more opaque shadows, shifted down to make the window diff --git a/ui/wm/core/shadow_controller.h b/ui/wm/core/shadow_controller.h index 47aa743..c846894 100644 --- a/ui/wm/core/shadow_controller.h +++ b/ui/wm/core/shadow_controller.h @@ -10,8 +10,8 @@ #include "base/basictypes.h" #include "base/compiler_specific.h" #include "base/memory/ref_counted.h" -#include "ui/wm/core/wm_core_export.h" #include "ui/wm/public/activation_change_observer.h" +#include "ui/wm/wm_export.h" namespace aura { class Window; @@ -31,10 +31,10 @@ class Shadow; // shadows as needed. ShadowController itself is light weight and per // ActivationClient. ShadowController delegates to its implementation class, // which observes all window creation. -class WM_CORE_EXPORT ShadowController : +class WM_EXPORT ShadowController : public aura::client::ActivationChangeObserver { public: - class WM_CORE_EXPORT TestApi { + class WM_EXPORT TestApi { public: explicit TestApi(ShadowController* controller) : controller_(controller) {} ~TestApi() {} diff --git a/ui/wm/core/shadow_types.h b/ui/wm/core/shadow_types.h index 49c92fd..1198a43 100644 --- a/ui/wm/core/shadow_types.h +++ b/ui/wm/core/shadow_types.h @@ -6,7 +6,7 @@ #define UI_WM_CORE_SHADOW_TYPES_H_ #include "ui/aura/window.h" -#include "ui/wm/core/wm_core_export.h" +#include "ui/wm/wm_export.h" namespace aura { class Window; @@ -22,8 +22,8 @@ enum ShadowType { SHADOW_TYPE_RECTANGULAR, }; -WM_CORE_EXPORT void SetShadowType(aura::Window* window, ShadowType shadow_type); -WM_CORE_EXPORT ShadowType GetShadowType(aura::Window* window); +WM_EXPORT void SetShadowType(aura::Window* window, ShadowType shadow_type); +WM_EXPORT ShadowType GetShadowType(aura::Window* window); // A property key describing the drop shadow that should be displayed under the // window. If unset, no shadow is displayed. diff --git a/ui/wm/core/transient_window_controller.h b/ui/wm/core/transient_window_controller.h index 125cd28..8638824 100644 --- a/ui/wm/core/transient_window_controller.h +++ b/ui/wm/core/transient_window_controller.h @@ -5,14 +5,14 @@ #ifndef UI_WM_CORE_TRANSIENT_WINDOW_CONTROLLER_H_ #define UI_WM_CORE_TRANSIENT_WINDOW_CONTROLLER_H_ -#include "ui/wm/core/wm_core_export.h" #include "ui/wm/public/transient_window_client.h" +#include "ui/wm/wm_export.h" namespace wm { // TransientWindowClient implementation. Uses TransientWindowManager to handle // tracking transient per window. -class WM_CORE_EXPORT TransientWindowController +class WM_EXPORT TransientWindowController : public aura::client::TransientWindowClient { public: TransientWindowController(); diff --git a/ui/wm/core/transient_window_manager.h b/ui/wm/core/transient_window_manager.h index 0f84ba3..d247b34 100644 --- a/ui/wm/core/transient_window_manager.h +++ b/ui/wm/core/transient_window_manager.h @@ -9,7 +9,7 @@ #include "base/observer_list.h" #include "ui/aura/window_observer.h" -#include "ui/wm/core/wm_core_export.h" +#include "ui/wm/wm_export.h" namespace wm { @@ -26,7 +26,7 @@ class TransientWindowObserver; // Transient windows are typically used for popups and menus. // TODO(sky): when we nuke TransientWindowClient rename this to // TransientWindowController. -class WM_CORE_EXPORT TransientWindowManager : public aura::WindowObserver { +class WM_EXPORT TransientWindowManager : public aura::WindowObserver { public: typedef std::vector<aura::Window*> Windows; diff --git a/ui/wm/core/transient_window_observer.h b/ui/wm/core/transient_window_observer.h index 6a7a2e2..aff5af5 100644 --- a/ui/wm/core/transient_window_observer.h +++ b/ui/wm/core/transient_window_observer.h @@ -5,7 +5,7 @@ #ifndef UI_WM_CORE_TRANSIENT_WINDOW_OBSERVER_H_ #define UI_WM_CORE_TRANSIENT_WINDOW_OBSERVER_H_ -#include "ui/wm/core/wm_core_export.h" +#include "ui/wm/wm_export.h" namespace aura { class Window; @@ -13,7 +13,7 @@ class Window; namespace wm { -class WM_CORE_EXPORT TransientWindowObserver { +class WM_EXPORT TransientWindowObserver { public: // Called when a transient child is added to |window|. virtual void OnTransientChildAdded(aura::Window* window, diff --git a/ui/wm/core/transient_window_stacking_client.h b/ui/wm/core/transient_window_stacking_client.h index 5641a22..4ab4aea 100644 --- a/ui/wm/core/transient_window_stacking_client.h +++ b/ui/wm/core/transient_window_stacking_client.h @@ -6,13 +6,13 @@ #define UI_WM_CORE_TRANSIENT_WINDOW_STACKING_CLIENT_H_ #include "ui/aura/client/window_stacking_client.h" -#include "ui/wm/core/wm_core_export.h" +#include "ui/wm/wm_export.h" namespace wm { class TransientWindowManager; -class WM_CORE_EXPORT TransientWindowStackingClient +class WM_EXPORT TransientWindowStackingClient : public aura::client::WindowStackingClient { public: TransientWindowStackingClient(); diff --git a/ui/wm/core/visibility_controller.h b/ui/wm/core/visibility_controller.h index 912e974..47ae991 100644 --- a/ui/wm/core/visibility_controller.h +++ b/ui/wm/core/visibility_controller.h @@ -8,11 +8,11 @@ #include "base/compiler_specific.h" #include "base/logging.h" #include "ui/aura/client/visibility_client.h" -#include "ui/wm/core/wm_core_export.h" +#include "ui/wm/wm_export.h" namespace wm { -class WM_CORE_EXPORT VisibilityController +class WM_EXPORT VisibilityController : public aura::client::VisibilityClient { public: VisibilityController(); @@ -47,7 +47,7 @@ class WM_CORE_EXPORT VisibilityController // // previous state. // } // -class WM_CORE_EXPORT SuspendChildWindowVisibilityAnimations { +class WM_EXPORT SuspendChildWindowVisibilityAnimations { public: // Suspend visibility animations of child windows. explicit SuspendChildWindowVisibilityAnimations(aura::Window* window); @@ -66,7 +66,7 @@ class WM_CORE_EXPORT SuspendChildWindowVisibilityAnimations { }; // Tells |window| to animate visibility changes to its children. -void WM_CORE_EXPORT SetChildWindowVisibilityChangesAnimated( +void WM_EXPORT SetChildWindowVisibilityChangesAnimated( aura::Window* window); } // namespace wm diff --git a/ui/wm/core/window_animations.cc b/ui/wm/core/window_animations.cc index c7b9c63..3169627e 100644 --- a/ui/wm/core/window_animations.cc +++ b/ui/wm/core/window_animations.cc @@ -41,7 +41,7 @@ DECLARE_WINDOW_PROPERTY_TYPE(int) DECLARE_WINDOW_PROPERTY_TYPE(wm::WindowVisibilityAnimationType) DECLARE_WINDOW_PROPERTY_TYPE(wm::WindowVisibilityAnimationTransition) DECLARE_WINDOW_PROPERTY_TYPE(float) -DECLARE_EXPORTED_WINDOW_PROPERTY_TYPE(WM_CORE_EXPORT, bool) +DECLARE_EXPORTED_WINDOW_PROPERTY_TYPE(WM_EXPORT, bool) namespace wm { namespace { diff --git a/ui/wm/core/window_animations.h b/ui/wm/core/window_animations.h index b2ab4de..27c4c67 100644 --- a/ui/wm/core/window_animations.h +++ b/ui/wm/core/window_animations.h @@ -8,7 +8,7 @@ #include <vector> #include "ui/compositor/scoped_layer_animation_settings.h" -#include "ui/wm/core/wm_core_export.h" +#include "ui/wm/wm_export.h" namespace aura { class Window; @@ -58,26 +58,26 @@ enum WindowVisibilityAnimationTransition { // These two methods use int for type rather than WindowVisibilityAnimationType // since downstream libraries can extend the set of animations. -WM_CORE_EXPORT void SetWindowVisibilityAnimationType(aura::Window* window, - int type); -WM_CORE_EXPORT int GetWindowVisibilityAnimationType(aura::Window* window); +WM_EXPORT void SetWindowVisibilityAnimationType(aura::Window* window, + int type); +WM_EXPORT int GetWindowVisibilityAnimationType(aura::Window* window); -WM_CORE_EXPORT void SetWindowVisibilityAnimationTransition( +WM_EXPORT void SetWindowVisibilityAnimationTransition( aura::Window* window, WindowVisibilityAnimationTransition transition); -WM_CORE_EXPORT bool HasWindowVisibilityAnimationTransition( +WM_EXPORT bool HasWindowVisibilityAnimationTransition( aura::Window* window, WindowVisibilityAnimationTransition transition); -WM_CORE_EXPORT void SetWindowVisibilityAnimationDuration( +WM_EXPORT void SetWindowVisibilityAnimationDuration( aura::Window* window, const base::TimeDelta& duration); -WM_CORE_EXPORT base::TimeDelta GetWindowVisibilityAnimationDuration( +WM_EXPORT base::TimeDelta GetWindowVisibilityAnimationDuration( const aura::Window& window); -WM_CORE_EXPORT void SetWindowVisibilityAnimationVerticalPosition( +WM_EXPORT void SetWindowVisibilityAnimationVerticalPosition( aura::Window* window, float position); @@ -86,7 +86,7 @@ class HidingWindowAnimationObserver; // Use this to ensure that the hiding animation is visible even after // the window is deleted or deactivated, instead of using // ui::ScopedLayerAnimationSettings directly. -class WM_CORE_EXPORT ScopedHidingAnimationSettings { +class WM_EXPORT ScopedHidingAnimationSettings { public: explicit ScopedHidingAnimationSettings(aura::Window* window); ~ScopedHidingAnimationSettings(); @@ -104,15 +104,14 @@ class WM_CORE_EXPORT ScopedHidingAnimationSettings { }; // Returns false if the |window| didn't animate. -WM_CORE_EXPORT bool AnimateOnChildWindowVisibilityChanged(aura::Window* window, - bool visible); -WM_CORE_EXPORT bool AnimateWindow(aura::Window* window, - WindowAnimationType type); +WM_EXPORT bool AnimateOnChildWindowVisibilityChanged(aura::Window* window, + bool visible); +WM_EXPORT bool AnimateWindow(aura::Window* window, WindowAnimationType type); // Returns true if window animations are disabled for |window|. Window // animations are enabled by default. If |window| is NULL, this just checks // if the global flag disabling window animations is present. -WM_CORE_EXPORT bool WindowAnimationsDisabled(aura::Window* window); +WM_EXPORT bool WindowAnimationsDisabled(aura::Window* window); } // namespace wm diff --git a/ui/wm/core/window_modality_controller.h b/ui/wm/core/window_modality_controller.h index d098d57..4d52c21 100644 --- a/ui/wm/core/window_modality_controller.h +++ b/ui/wm/core/window_modality_controller.h @@ -11,7 +11,7 @@ #include "ui/aura/env_observer.h" #include "ui/aura/window_observer.h" #include "ui/events/event_handler.h" -#include "ui/wm/core/wm_core_export.h" +#include "ui/wm/wm_export.h" namespace ui { class EventTarget; @@ -21,18 +21,18 @@ class LocatedEvent; namespace wm { // Sets the modal parent for the child. -WM_CORE_EXPORT void SetModalParent(aura::Window* child, aura::Window* parent); +WM_EXPORT void SetModalParent(aura::Window* child, aura::Window* parent); // Returns the modal transient child of |window|, or NULL if |window| does not // have any modal transient children. -WM_CORE_EXPORT aura::Window* GetModalTransient(aura::Window* window); +WM_EXPORT aura::Window* GetModalTransient(aura::Window* window); // WindowModalityController is an event filter that consumes events sent to // windows that are the transient parents of window-modal windows. This filter // must be added to the CompoundEventFilter so that activation works properly. -class WM_CORE_EXPORT WindowModalityController : public ui::EventHandler, - public aura::EnvObserver, - public aura::WindowObserver { +class WM_EXPORT WindowModalityController : public ui::EventHandler, + public aura::EnvObserver, + public aura::WindowObserver { public: explicit WindowModalityController(ui::EventTarget* event_target); virtual ~WindowModalityController(); diff --git a/ui/wm/core/window_util.h b/ui/wm/core/window_util.h index 81989f9..78f2ffb 100644 --- a/ui/wm/core/window_util.h +++ b/ui/wm/core/window_util.h @@ -10,7 +10,7 @@ #include "base/basictypes.h" #include "base/compiler_specific.h" #include "base/memory/scoped_ptr.h" -#include "ui/wm/core/wm_core_export.h" +#include "ui/wm/wm_export.h" namespace aura { class Window; @@ -24,18 +24,18 @@ class LayerTreeOwner; namespace wm { -WM_CORE_EXPORT void ActivateWindow(aura::Window* window); -WM_CORE_EXPORT void DeactivateWindow(aura::Window* window); -WM_CORE_EXPORT bool IsActiveWindow(aura::Window* window); -WM_CORE_EXPORT bool CanActivateWindow(aura::Window* window); +WM_EXPORT void ActivateWindow(aura::Window* window); +WM_EXPORT void DeactivateWindow(aura::Window* window); +WM_EXPORT bool IsActiveWindow(aura::Window* window); +WM_EXPORT bool CanActivateWindow(aura::Window* window); // Retrieves the activatable window for |window|. The ActivationClient makes // this determination. -WM_CORE_EXPORT aura::Window* GetActivatableWindow(aura::Window* window); +WM_EXPORT aura::Window* GetActivatableWindow(aura::Window* window); // Retrieves the toplevel window for |window|. The ActivationClient makes this // determination. -WM_CORE_EXPORT aura::Window* GetToplevelWindow(aura::Window* window); +WM_EXPORT aura::Window* GetToplevelWindow(aura::Window* window); // Returns the existing Layer for |root| (and all its descendants) and creates // a new layer for |root| and all its descendants. This is intended for @@ -43,26 +43,24 @@ WM_CORE_EXPORT aura::Window* GetToplevelWindow(aura::Window* window); // // As a result of this |root| has freshly created layers, meaning the layers // have not yet been painted to. -WM_CORE_EXPORT scoped_ptr<ui::LayerTreeOwner> RecreateLayers( +WM_EXPORT scoped_ptr<ui::LayerTreeOwner> RecreateLayers( ui::LayerOwner* root); // Convenience functions that get the TransientWindowManager for the window and // redirect appropriately. These are preferable to calling functions on // TransientWindowManager as they handle the appropriate NULL checks. -WM_CORE_EXPORT aura::Window* GetTransientParent(aura::Window* window); -WM_CORE_EXPORT const aura::Window* GetTransientParent( +WM_EXPORT aura::Window* GetTransientParent(aura::Window* window); +WM_EXPORT const aura::Window* GetTransientParent( const aura::Window* window); -WM_CORE_EXPORT const std::vector<aura::Window*>& GetTransientChildren( +WM_EXPORT const std::vector<aura::Window*>& GetTransientChildren( const aura::Window* window); -WM_CORE_EXPORT void AddTransientChild(aura::Window* parent, - aura::Window* child); -WM_CORE_EXPORT void RemoveTransientChild(aura::Window* parent, - aura::Window* child); +WM_EXPORT void AddTransientChild(aura::Window* parent, aura::Window* child); +WM_EXPORT void RemoveTransientChild(aura::Window* parent, aura::Window* child); // Returns true if |window| has |ancestor| as a transient ancestor. A transient // ancestor is found by following the transient parent chain of the window. -WM_CORE_EXPORT bool HasTransientAncestor(const aura::Window* window, - const aura::Window* ancestor); +WM_EXPORT bool HasTransientAncestor(const aura::Window* window, + const aura::Window* ancestor); } // namespace wm diff --git a/ui/wm/core/wm_core_export.h b/ui/wm/core/wm_core_export.h deleted file mode 100644 index 2056ccc..0000000 --- a/ui/wm/core/wm_core_export.h +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright 2014 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. - -#ifndef UI_WM_CORE_WM_CORE_EXPORT_H_ -#define UI_WM_CORE_WM_CORE_EXPORT_H_ - -// Defines WM_CORE_EXPORT so that functionality implemented by the Views module -// can be exported to consumers. - -#if defined(COMPONENT_BUILD) -#if defined(WIN32) - -#if defined(WM_CORE_IMPLEMENTATION) -#define WM_CORE_EXPORT __declspec(dllexport) -#else -#define WM_CORE_EXPORT __declspec(dllimport) -#endif // defined(WM_CORE_IMPLEMENTATION) - -#else // defined(WIN32) -#if defined(WM_CORE_IMPLEMENTATION) -#define WM_CORE_EXPORT __attribute__((visibility("default"))) -#else -#define WM_CORE_EXPORT -#endif -#endif - -#else // defined(COMPONENT_BUILD) -#define WM_CORE_EXPORT -#endif - -#endif // UI_WM_CORE_WM_CORE_EXPORT_H_ diff --git a/ui/wm/core/wm_core_switches.h b/ui/wm/core/wm_core_switches.h index dd48025..05658d6 100644 --- a/ui/wm/core/wm_core_switches.h +++ b/ui/wm/core/wm_core_switches.h @@ -6,7 +6,7 @@ #define UI_WM_CORE_WM_CORE_SWITCHES_H_ #include "build/build_config.h" -#include "ui/wm/core/wm_core_export.h" +#include "ui/wm/wm_export.h" namespace wm { namespace switches { @@ -16,7 +16,7 @@ namespace switches { // see chromeos::LoginUtil::GetOffTheRecordCommandLine().) // Please keep alphabetized. -WM_CORE_EXPORT extern const char kWindowAnimationsDisabled[]; +WM_EXPORT extern const char kWindowAnimationsDisabled[]; } // namespace switches } // namespace wm diff --git a/ui/wm/core/wm_state.h b/ui/wm/core/wm_state.h index b846f70..289c9da 100644 --- a/ui/wm/core/wm_state.h +++ b/ui/wm/core/wm_state.h @@ -6,7 +6,7 @@ #define UI_WM_CORE_WM_STATE_H_ #include "base/memory/scoped_ptr.h" -#include "ui/wm/core/wm_core_export.h" +#include "ui/wm/wm_export.h" namespace wm { @@ -14,7 +14,7 @@ class TransientWindowController; class TransientWindowStackingClient; // Installs state needed by the window manager. -class WM_CORE_EXPORT WMState { +class WM_EXPORT WMState { public: WMState(); ~WMState(); diff --git a/ui/wm/public/activation_change_observer.h b/ui/wm/public/activation_change_observer.h index 68d5b8a..6a4fe3b 100644 --- a/ui/wm/public/activation_change_observer.h +++ b/ui/wm/public/activation_change_observer.h @@ -5,14 +5,14 @@ #ifndef UI_WM_PUBLIC_ACTIVATION_CHANGE_OBSERVER_H_ #define UI_WM_PUBLIC_ACTIVATION_CHANGE_OBSERVER_H_ -#include "ui/aura/aura_export.h" +#include "ui/wm/wm_export.h" namespace aura { class Window; namespace client { -class AURA_EXPORT ActivationChangeObserver { +class WM_EXPORT ActivationChangeObserver { public: // Called when |active| gains focus, or there is no active window // (|active| is NULL in this case.) |old_active| refers to the @@ -33,11 +33,10 @@ class AURA_EXPORT ActivationChangeObserver { // Gets/Sets the ActivationChangeObserver for a specific window. This observer // is notified after the ActivationClient notifies all registered observers. -AURA_EXPORT void SetActivationChangeObserver( +WM_EXPORT void SetActivationChangeObserver( Window* window, ActivationChangeObserver* observer); -AURA_EXPORT ActivationChangeObserver* GetActivationChangeObserver( - Window* window); +WM_EXPORT ActivationChangeObserver* GetActivationChangeObserver(Window* window); } // namespace client } // namespace aura diff --git a/ui/wm/public/activation_client.cc b/ui/wm/public/activation_client.cc index 6a47554..f22ac9c 100644 --- a/ui/wm/public/activation_client.cc +++ b/ui/wm/public/activation_client.cc @@ -7,7 +7,7 @@ #include "ui/aura/window.h" #include "ui/aura/window_property.h" -DECLARE_EXPORTED_WINDOW_PROPERTY_TYPE(AURA_EXPORT, aura::Window*) +DECLARE_EXPORTED_WINDOW_PROPERTY_TYPE(WM_EXPORT, aura::Window*) DECLARE_WINDOW_PROPERTY_TYPE(aura::client::ActivationClient*) namespace aura { diff --git a/ui/wm/public/activation_client.h b/ui/wm/public/activation_client.h index fc35131..decd26d 100644 --- a/ui/wm/public/activation_client.h +++ b/ui/wm/public/activation_client.h @@ -5,7 +5,7 @@ #ifndef UI_WM_PUBLIC_ACTIVATION_CLIENT_H_ #define UI_WM_PUBLIC_ACTIVATION_CLIENT_H_ -#include "ui/aura/aura_export.h" +#include "ui/wm/wm_export.h" namespace ui { class Event; @@ -18,7 +18,7 @@ namespace client { class ActivationChangeObserver; // An interface implemented by an object that manages window activation. -class AURA_EXPORT ActivationClient { +class WM_EXPORT ActivationClient { public: // Adds/Removes ActivationChangeObservers. virtual void AddObserver(ActivationChangeObserver* observer) = 0; @@ -57,9 +57,9 @@ class AURA_EXPORT ActivationClient { }; // Sets/Gets the activation client on the root Window. -AURA_EXPORT void SetActivationClient(Window* root_window, - ActivationClient* client); -AURA_EXPORT ActivationClient* GetActivationClient(Window* root_window); +WM_EXPORT void SetActivationClient(Window* root_window, + ActivationClient* client); +WM_EXPORT ActivationClient* GetActivationClient(Window* root_window); // Some types of transient window are only visible when active. // The transient parents of these windows may have visual appearance properties @@ -68,8 +68,8 @@ AURA_EXPORT ActivationClient* GetActivationClient(Window* root_window); // TODO(beng): currently the UI framework (views) implements the actual // close-on-deactivate component of this feature but it should be // possible to implement in the aura client. -AURA_EXPORT void SetHideOnDeactivate(Window* window, bool hide_on_deactivate); -AURA_EXPORT bool GetHideOnDeactivate(Window* window); +WM_EXPORT void SetHideOnDeactivate(Window* window, bool hide_on_deactivate); +WM_EXPORT bool GetHideOnDeactivate(Window* window); } // namespace clients } // namespace aura diff --git a/ui/wm/public/activation_delegate.h b/ui/wm/public/activation_delegate.h index 3c5b3ae..5fe5d53 100644 --- a/ui/wm/public/activation_delegate.h +++ b/ui/wm/public/activation_delegate.h @@ -5,7 +5,7 @@ #ifndef UI_WM_PUBLIC_ACTIVATION_DELEGATE_H_ #define UI_WM_PUBLIC_ACTIVATION_DELEGATE_H_ -#include "ui/aura/aura_export.h" +#include "ui/wm/wm_export.h" namespace ui { class Event; @@ -17,7 +17,7 @@ namespace client { // An interface implemented by an object that configures and responds to changes // to a window's activation state. -class AURA_EXPORT ActivationDelegate { +class WM_EXPORT ActivationDelegate { public: // Returns true if the window should be activated. virtual bool ShouldActivate() const = 0; @@ -27,9 +27,9 @@ class AURA_EXPORT ActivationDelegate { }; // Sets/Gets the ActivationDelegate on the Window. No ownership changes. -AURA_EXPORT void SetActivationDelegate(Window* window, - ActivationDelegate* delegate); -AURA_EXPORT ActivationDelegate* GetActivationDelegate(Window* window); +WM_EXPORT void SetActivationDelegate(Window* window, + ActivationDelegate* delegate); +WM_EXPORT ActivationDelegate* GetActivationDelegate(Window* window); } // namespace client } // namespace aura diff --git a/ui/wm/public/animation_host.h b/ui/wm/public/animation_host.h index 71f9f4d..5352e62 100644 --- a/ui/wm/public/animation_host.h +++ b/ui/wm/public/animation_host.h @@ -6,7 +6,7 @@ #define UI_WM_PUBLIC_ANIMATION_HOST_H_ #include "base/compiler_specific.h" -#include "ui/aura/aura_export.h" +#include "ui/wm/wm_export.h" namespace gfx { class Vector2d; @@ -19,7 +19,7 @@ namespace client { // Interface for top level window host of animation. Communicates additional // bounds required for animation as well as animation completion for deferring // window closes on hide. -class AURA_EXPORT AnimationHost { +class WM_EXPORT AnimationHost { public: // Ensure the host window is at least this large so that transitions have // sufficient space. @@ -38,9 +38,8 @@ class AURA_EXPORT AnimationHost { virtual ~AnimationHost() {} }; -AURA_EXPORT void SetAnimationHost(Window* window, - AnimationHost* animation_host); -AURA_EXPORT AnimationHost* GetAnimationHost(Window* window); +WM_EXPORT void SetAnimationHost(Window* window, AnimationHost* animation_host); +WM_EXPORT AnimationHost* GetAnimationHost(Window* window); } // namespace client } // namespace aura diff --git a/ui/wm/public/dispatcher_client.h b/ui/wm/public/dispatcher_client.h index 9fd9c94..03376c5 100644 --- a/ui/wm/public/dispatcher_client.h +++ b/ui/wm/public/dispatcher_client.h @@ -6,23 +6,23 @@ #define UI_WM_PUBLIC_DISPATCHER_CLIENT_H_ #include "base/message_loop/message_pump_dispatcher.h" -#include "ui/aura/aura_export.h" +#include "ui/wm/wm_export.h" namespace aura { class Window; namespace client { // An interface implemented by an object which handles nested dispatchers. -class AURA_EXPORT DispatcherClient { +class WM_EXPORT DispatcherClient { public: virtual void RunWithDispatcher(base::MessagePumpDispatcher* dispatcher) = 0; virtual void QuitNestedMessageLoop() = 0; }; -AURA_EXPORT void SetDispatcherClient(Window* root_window, - DispatcherClient* client); -AURA_EXPORT DispatcherClient* GetDispatcherClient(Window* root_window); +WM_EXPORT void SetDispatcherClient(Window* root_window, + DispatcherClient* client); +WM_EXPORT DispatcherClient* GetDispatcherClient(Window* root_window); } // namespace client } // namespace aura diff --git a/ui/wm/public/drag_drop_client.h b/ui/wm/public/drag_drop_client.h index 62a2355..d0dcbe2 100644 --- a/ui/wm/public/drag_drop_client.h +++ b/ui/wm/public/drag_drop_client.h @@ -5,9 +5,9 @@ #ifndef UI_WM_PUBLIC_DRAG_DROP_CLIENT_H_ #define UI_WM_PUBLIC_DRAG_DROP_CLIENT_H_ -#include "ui/aura/aura_export.h" #include "ui/base/dragdrop/drag_drop_types.h" #include "ui/gfx/native_widget_types.h" +#include "ui/wm/wm_export.h" namespace gfx { class Point; @@ -23,7 +23,7 @@ class Window; namespace client { // An interface implemented by an object that controls a drag and drop session. -class AURA_EXPORT DragDropClient { +class WM_EXPORT DragDropClient { public: virtual ~DragDropClient() {} @@ -52,9 +52,8 @@ class AURA_EXPORT DragDropClient { virtual bool IsDragDropInProgress() = 0; }; -AURA_EXPORT void SetDragDropClient(Window* root_window, - DragDropClient* client); -AURA_EXPORT DragDropClient* GetDragDropClient(Window* root_window); +WM_EXPORT void SetDragDropClient(Window* root_window, DragDropClient* client); +WM_EXPORT DragDropClient* GetDragDropClient(Window* root_window); } // namespace client } // namespace aura diff --git a/ui/wm/public/drag_drop_delegate.h b/ui/wm/public/drag_drop_delegate.h index 50f6c26..bf52b93 100644 --- a/ui/wm/public/drag_drop_delegate.h +++ b/ui/wm/public/drag_drop_delegate.h @@ -5,7 +5,7 @@ #ifndef UI_WM_PUBLIC_DRAG_DROP_DELEGATE_H_ #define UI_WM_PUBLIC_DRAG_DROP_DELEGATE_H_ -#include "ui/aura/aura_export.h" +#include "ui/wm/wm_export.h" namespace ui { class DropTargetEvent; @@ -16,7 +16,7 @@ class Window; namespace client { // Delegate interface for drag and drop actions on aura::Window. -class AURA_EXPORT DragDropDelegate { +class WM_EXPORT DragDropDelegate { public: // OnDragEntered is invoked when the mouse enters this window during a drag & // drop session. This is immediately followed by an invocation of @@ -41,9 +41,8 @@ class AURA_EXPORT DragDropDelegate { virtual ~DragDropDelegate() {} }; -AURA_EXPORT void SetDragDropDelegate(Window* window, - DragDropDelegate* delegate); -AURA_EXPORT DragDropDelegate* GetDragDropDelegate(Window* window); +WM_EXPORT void SetDragDropDelegate(Window* window, DragDropDelegate* delegate); +WM_EXPORT DragDropDelegate* GetDragDropDelegate(Window* window); } // namespace client } // namespace aura diff --git a/ui/wm/public/scoped_tooltip_disabler.h b/ui/wm/public/scoped_tooltip_disabler.h index 0fd3e11..8371c02 100644 --- a/ui/wm/public/scoped_tooltip_disabler.h +++ b/ui/wm/public/scoped_tooltip_disabler.h @@ -6,12 +6,13 @@ #define UI_WM_PUBLIC_SCOPED_TOOLTIP_DISABLER_H_ #include "ui/aura/window_observer.h" +#include "ui/wm/wm_export.h" namespace aura { namespace client { // Use to temporarily disable tooltips. -class AURA_EXPORT ScopedTooltipDisabler : aura::WindowObserver { +class WM_EXPORT ScopedTooltipDisabler : aura::WindowObserver { public: // Disables tooltips on |window| (does nothing if |window| is NULL). Tooltips // are reenabled from the destructor when there are no most outstanding diff --git a/ui/wm/public/tooltip_client.h b/ui/wm/public/tooltip_client.h index f592b21..477b239 100644 --- a/ui/wm/public/tooltip_client.h +++ b/ui/wm/public/tooltip_client.h @@ -5,8 +5,8 @@ #ifndef UI_WM_PUBLIC_TOOLTIP_CLIENT_H_ #define UI_WM_PUBLIC_TOOLTIP_CLIENT_H_ -#include "ui/aura/aura_export.h" #include "ui/gfx/font.h" +#include "ui/wm/wm_export.h" namespace aura { class Window; @@ -14,7 +14,7 @@ namespace client { class ScopedTooltipDisabler; -class AURA_EXPORT TooltipClient { +class WM_EXPORT TooltipClient { public: // Informs the shell tooltip manager of change in tooltip for window |target|. virtual void UpdateTooltip(Window* target) = 0; @@ -32,12 +32,11 @@ class AURA_EXPORT TooltipClient { friend class ScopedTooltipDisabler; }; -AURA_EXPORT void SetTooltipClient(Window* root_window, - TooltipClient* client); -AURA_EXPORT TooltipClient* GetTooltipClient(Window* root_window); +WM_EXPORT void SetTooltipClient(Window* root_window, TooltipClient* client); +WM_EXPORT TooltipClient* GetTooltipClient(Window* root_window); -AURA_EXPORT void SetTooltipText(Window* window, base::string16* tooltip_text); -AURA_EXPORT const base::string16 GetTooltipText(Window* window); +WM_EXPORT void SetTooltipText(Window* window, base::string16* tooltip_text); +WM_EXPORT const base::string16 GetTooltipText(Window* window); } // namespace client } // namespace aura diff --git a/ui/wm/public/transient_window_client.h b/ui/wm/public/transient_window_client.h index 2086100..66aa33f 100644 --- a/ui/wm/public/transient_window_client.h +++ b/ui/wm/public/transient_window_client.h @@ -6,7 +6,7 @@ #define UI_WM_PUBLIC_TRANSIENT_WINDOW_CLIENT_H_ #include "base/basictypes.h" -#include "ui/aura/aura_export.h" +#include "ui/wm/wm_export.h" namespace aura { @@ -24,7 +24,7 @@ namespace client { // Transient windows are typically used for popups and menus. // TODO(sky): nuke this class and replace with calls to TransientWindowManager. // This is temporary until we start moving to ui/wm. -class AURA_EXPORT TransientWindowClient { +class WM_EXPORT TransientWindowClient { public: virtual void AddTransientChild(Window* parent, Window* child) = 0; virtual void RemoveTransientChild(Window* parent, Window* child) = 0; @@ -38,8 +38,8 @@ class AURA_EXPORT TransientWindowClient { // Sets/gets the TransientWindowClient. This does *not* take ownership of // |client|. It is assumed the caller will invoke SetTransientWindowClient(NULL) // before deleting |client|. -AURA_EXPORT void SetTransientWindowClient(TransientWindowClient* client); -AURA_EXPORT TransientWindowClient* GetTransientWindowClient(); +WM_EXPORT void SetTransientWindowClient(TransientWindowClient* client); +WM_EXPORT TransientWindowClient* GetTransientWindowClient(); } // namespace client } // namespace aura diff --git a/ui/wm/public/window_move_client.h b/ui/wm/public/window_move_client.h index b8943d3..d8e5794 100644 --- a/ui/wm/public/window_move_client.h +++ b/ui/wm/public/window_move_client.h @@ -5,8 +5,8 @@ #ifndef UI_WM_PUBLIC_WINDOW_MOVE_CLIENT_H_ #define UI_WM_PUBLIC_WINDOW_MOVE_CLIENT_H_ -#include "ui/aura/aura_export.h" #include "ui/gfx/vector2d.h" +#include "ui/wm/wm_export.h" namespace gfx { class Point; @@ -28,7 +28,7 @@ enum WindowMoveSource { // An interface implemented by an object that manages programatically keyed // window moving. -class AURA_EXPORT WindowMoveClient { +class WM_EXPORT WindowMoveClient { public: // Starts a nested message loop for moving the window. |drag_offset| is the // offset from the window origin to the cursor when the drag was started. @@ -46,9 +46,8 @@ class AURA_EXPORT WindowMoveClient { }; // Sets/Gets the activation client for the specified window. -AURA_EXPORT void SetWindowMoveClient(Window* window, - WindowMoveClient* client); -AURA_EXPORT WindowMoveClient* GetWindowMoveClient(Window* window); +WM_EXPORT void SetWindowMoveClient(Window* window, WindowMoveClient* client); +WM_EXPORT WindowMoveClient* GetWindowMoveClient(Window* window); } // namespace client } // namespace aura diff --git a/ui/wm/test/wm_test_helper.cc b/ui/wm/test/wm_test_helper.cc index 160923c8..b47de06 100644 --- a/ui/wm/test/wm_test_helper.cc +++ b/ui/wm/test/wm_test_helper.cc @@ -4,49 +4,37 @@ #include "ui/wm/test/wm_test_helper.h" -#include "ui/aura/client/default_activation_client.h" -#include "ui/aura/client/default_capture_client.h" -#include "ui/aura/env.h" -#include "ui/aura/test/test_focus_client.h" +#include "base/message_loop/message_loop.h" #include "ui/aura/window.h" -#include "ui/wm/core/compound_event_filter.h" -#include "ui/wm/core/input_method_event_filter.h" +#include "ui/wm/core/default_activation_client.h" namespace wm { -WMTestHelper::WMTestHelper(const gfx::Size& default_window_size) { - aura::Env::CreateInstance(); - host_.reset(aura::WindowTreeHost::Create(gfx::Rect(default_window_size))); - host_->InitHost(); - aura::client::SetWindowTreeClient(host_->window(), this); +WMTestHelper::WMTestHelper(const gfx::Size& default_window_size) + : aura::test::AuraTestHelper(base::MessageLoopForUI::current()) { + default_window_size_ = default_window_size; +} - focus_client_.reset(new aura::test::TestFocusClient); - aura::client::SetFocusClient(host_->window(), focus_client_.get()); +WMTestHelper::WMTestHelper() + : aura::test::AuraTestHelper(base::MessageLoopForUI::current()) { +} - root_window_event_filter_ = new wm::CompoundEventFilter; - // Pass ownership of the filter to the root_window. - host_->window()->SetEventFilter(root_window_event_filter_); +WMTestHelper::~WMTestHelper() { +} - input_method_filter_.reset(new wm::InputMethodEventFilter( - host_->GetAcceleratedWidget())); - input_method_filter_->SetInputMethodPropertyInRootWindow(host_->window()); - root_window_event_filter_->AddHandler(input_method_filter_.get()); +//////////////////////////////////////////////////////////////////////////////// +// WMTestHelper, AuraTestHelper overrides: +void WMTestHelper::SetUp() { + aura::test::AuraTestHelper::SetUp(); activation_client_.reset( - new aura::client::DefaultActivationClient(host_->window())); - - capture_client_.reset( - new aura::client::DefaultCaptureClient(host_->window())); + new aura::client::DefaultActivationClient(root_window())); } -WMTestHelper::~WMTestHelper() { - root_window_event_filter_->RemoveHandler(input_method_filter_.get()); +void WMTestHelper::TearDown() { + activation_client_.reset(); + aura::test::AuraTestHelper::TearDown(); } -aura::Window* WMTestHelper::GetDefaultParent(aura::Window* context, - aura::Window* window, - const gfx::Rect& bounds) { - return host_->window(); -} } // namespace wm diff --git a/ui/wm/test/wm_test_helper.h b/ui/wm/test/wm_test_helper.h index e01486b..b63012e 100644 --- a/ui/wm/test/wm_test_helper.h +++ b/ui/wm/test/wm_test_helper.h @@ -7,56 +7,35 @@ #include "base/compiler_specific.h" #include "base/memory/scoped_ptr.h" -#include "ui/aura/client/window_tree_client.h" -#include "ui/aura/window_tree_host.h" +#include "ui/aura/test/aura_test_helper.h" namespace aura { -class Window; -class WindowTreeHost; namespace client { class DefaultActivationClient; -class DefaultCaptureClient; -class FocusClient; } } namespace gfx { -class Rect; class Size; } namespace wm { -class CompoundEventFilter; -class InputMethodEventFilter; -} - -namespace wm { // Creates a minimal environment for running the shell. We can't pull in all of // ash here, but we can create attach several of the same things we'd find in // the ash parts of the code. -class WMTestHelper : public aura::client::WindowTreeClient { +class WMTestHelper : public aura::test::AuraTestHelper { public: explicit WMTestHelper(const gfx::Size& default_window_size); + WMTestHelper(); virtual ~WMTestHelper(); - aura::WindowTreeHost* host() { return host_.get(); } - - // Overridden from client::WindowTreeClient: - virtual aura::Window* GetDefaultParent(aura::Window* context, - aura::Window* window, - const gfx::Rect& bounds) OVERRIDE; + // Overridden from aura::test::AuraTestHelper: + virtual void SetUp() OVERRIDE; + virtual void TearDown() OVERRIDE; private: - scoped_ptr<aura::WindowTreeHost> host_; - - // Owned by the root Window. - wm::CompoundEventFilter* root_window_event_filter_; - - scoped_ptr<aura::client::DefaultCaptureClient> capture_client_; - scoped_ptr<wm::InputMethodEventFilter> input_method_filter_; scoped_ptr<aura::client::DefaultActivationClient> activation_client_; - scoped_ptr<aura::client::FocusClient> focus_client_; DISALLOW_COPY_AND_ASSIGN(WMTestHelper); }; diff --git a/ui/wm/wm.gyp b/ui/wm/wm.gyp index a1960ec..2b438eb 100644 --- a/ui/wm/wm.gyp +++ b/ui/wm/wm.gyp @@ -8,19 +8,7 @@ }, 'targets': [ { - 'target_name': 'wm_public', - 'type': 'static_library', - 'dependencies': [ - '../../skia/skia.gyp:skia', - '../aura/aura.gyp:aura', - '../gfx/gfx.gyp:gfx_geometry', - ], - 'sources': [ - 'public/window_types.h', - ], - }, - { - 'target_name': 'wm_core', + 'target_name': 'wm', 'type': '<(component)', 'dependencies': [ '../../base/base.gyp:base', @@ -35,7 +23,7 @@ '../base/ui_base.gyp:ui_base', ], 'defines': [ - 'WM_CORE_IMPLEMENTATION', + 'WM_IMPLEMENTATION', ], 'sources': [ 'core/base_focus_rules.cc', @@ -46,6 +34,8 @@ 'core/compound_event_filter.h', 'core/cursor_manager.cc', 'core/cursor_manager.h', + 'core/default_activation_client.cc', + 'core/default_activation_client.h', 'core/easy_resize_window_targeter.cc', 'core/easy_resize_window_targeter.h', 'core/focus_controller.cc', @@ -80,11 +70,34 @@ 'core/window_modality_controller.h', 'core/window_util.cc', 'core/window_util.h', - 'core/wm_core_export.h', 'core/wm_core_switches.cc', 'core/wm_core_switches.h', 'core/wm_state.cc', 'core/wm_state.h', + 'public/activation_change_observer.h', + 'public/activation_change_observer.cc', + 'public/activation_client.cc', + 'public/activation_client.h', + 'public/activation_delegate.cc', + 'public/activation_delegate.h', + 'public/animation_host.cc', + 'public/animation_host.h', + 'public/dispatcher_client.cc', + 'public/dispatcher_client.h', + 'public/drag_drop_client.cc', + 'public/drag_drop_client.h', + 'public/drag_drop_delegate.cc', + 'public/drag_drop_delegate.h', + 'public/scoped_tooltip_disabler.cc', + 'public/scoped_tooltip_disabler.h', + 'public/tooltip_client.cc', + 'public/tooltip_client.h', + 'public/transient_window_client.cc', + 'public/transient_window_client.h', + 'public/window_move_client.cc', + 'public/window_move_client.h', + 'public/window_types.h', + 'wm_export.h', ], }, { @@ -93,6 +106,7 @@ 'dependencies': [ '../../skia/skia.gyp:skia', '../aura/aura.gyp:aura', + 'wm', ], 'sources': [ 'test/wm_test_helper.cc', @@ -115,7 +129,7 @@ '../gfx/gfx.gyp:gfx_geometry', '../gfx/gfx.gyp:gfx', '../base/ui_base.gyp:ui_base', - 'wm_core', + 'wm', 'wm_test_support', ], 'sources': [ diff --git a/ui/wm/wm_export.h b/ui/wm/wm_export.h new file mode 100644 index 0000000..0dc0f04 --- /dev/null +++ b/ui/wm/wm_export.h @@ -0,0 +1,32 @@ +// Copyright 2014 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. + +#ifndef UI_WM_WM_EXPORT_H_ +#define UI_WM_WM_EXPORT_H_ + +// Defines WM_CORE_EXPORT so that functionality implemented by the Views module +// can be exported to consumers. + +#if defined(COMPONENT_BUILD) +#if defined(WIN32) + +#if defined(WM_IMPLEMENTATION) +#define WM_EXPORT __declspec(dllexport) +#else +#define WM_EXPORT __declspec(dllimport) +#endif // defined(WM_IMPLEMENTATION) + +#else // defined(WIN32) +#if defined(WM_IMPLEMENTATION) +#define WM_EXPORT __attribute__((visibility("default"))) +#else +#define WM_EXPORT +#endif +#endif + +#else // defined(COMPONENT_BUILD) +#define WM_EXPORT +#endif + +#endif // UI_WM_WM_EXPORT_H_ |