summaryrefslogtreecommitdiffstats
path: root/ash
diff options
context:
space:
mode:
authorben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-12-23 23:35:31 +0000
committerben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-12-23 23:35:31 +0000
commitb65bdda36c548cd680eecbbfcfbd482b740e2eb3 (patch)
treef904be7f7f8db20269dbe2c76b28e325ec04bd28 /ash
parentff00968f75fd1a82532b0009f535310db5a9556c (diff)
downloadchromium_src-b65bdda36c548cd680eecbbfcfbd482b740e2eb3.zip
chromium_src-b65bdda36c548cd680eecbbfcfbd482b740e2eb3.tar.gz
chromium_src-b65bdda36c548cd680eecbbfcfbd482b740e2eb3.tar.bz2
Move last few files -> ash
http://crbug.com/108457 TEST=none TBR=sky Review URL: http://codereview.chromium.org/9036011 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@115743 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ash')
-rw-r--r--ash/accelerators/accelerator_controller.cc6
-rw-r--r--ash/accelerators/accelerator_controller.h4
-rw-r--r--ash/accelerators/accelerator_controller_unittest.cc4
-rw-r--r--ash/accelerators/accelerator_filter.cc2
-rw-r--r--ash/accelerators/accelerator_filter.h4
-rw-r--r--ash/app_list/app_list.cc8
-rw-r--r--ash/app_list/app_list_groups_view.h4
-rw-r--r--ash/app_list/app_list_item_group_model.h4
-rw-r--r--ash/app_list/app_list_item_group_view.h4
-rw-r--r--ash/app_list/app_list_item_model.h4
-rw-r--r--ash/app_list/app_list_item_model_observer.h4
-rw-r--r--ash/app_list/app_list_item_view.h4
-rw-r--r--ash/app_list/app_list_item_view_listener.h4
-rw-r--r--ash/app_list/app_list_model.h4
-rw-r--r--ash/app_list/app_list_view.cc2
-rw-r--r--ash/app_list/app_list_view.h6
-rw-r--r--ash/app_list/app_list_view_delegate.h4
-rw-r--r--ash/ash_export.h29
-rw-r--r--ash/ash_switches.cc44
-rw-r--r--ash/ash_switches.h29
-rw-r--r--ash/desktop_background/desktop_background_view.cc6
-rw-r--r--ash/drag_drop/drag_drop_controller.cc2
-rw-r--r--ash/drag_drop/drag_drop_controller.h4
-rw-r--r--ash/launcher/launcher.cc6
-rw-r--r--ash/launcher/launcher.h4
-rw-r--r--ash/launcher/launcher_model.h4
-rw-r--r--ash/launcher/launcher_model_observer.h4
-rw-r--r--ash/launcher/launcher_types.h8
-rw-r--r--ash/launcher/launcher_unittest.cc2
-rw-r--r--ash/launcher/launcher_view.cc4
-rw-r--r--ash/launcher/view_model.h4
-rw-r--r--ash/launcher/view_model_utils.h4
-rw-r--r--ash/screenshot_delegate.h22
-rw-r--r--ash/shell.cc369
-rw-r--r--ash/shell.h149
-rw-r--r--ash/shell/example_factory.h2
-rw-r--r--ash/shell/lock_view.cc4
-rw-r--r--ash/shell/shell_main.cc6
-rw-r--r--ash/shell/window_type_launcher.cc2
-rw-r--r--ash/shell_delegate.h67
-rw-r--r--ash/shell_factory.h27
-rw-r--r--ash/shell_unittest.cc292
-rw-r--r--ash/shell_window_ids.h47
-rw-r--r--ash/status_area/status_area_view.cc8
-rw-r--r--ash/test/ash_unittests.cc9
-rw-r--r--ash/test/aura_shell_test_base.cc2
-rw-r--r--ash/test/test_shell_delegate.h2
-rw-r--r--ash/tooltips/tooltip_controller.cc4
-rw-r--r--ash/tooltips/tooltip_controller.h4
-rw-r--r--ash/wm/activation_controller.cc4
-rw-r--r--ash/wm/activation_controller.h4
-rw-r--r--ash/wm/compact_layout_manager.h4
-rw-r--r--ash/wm/default_container_layout_manager.h4
-rw-r--r--ash/wm/image_grid.h4
-rw-r--r--ash/wm/modal_container_layout_manager.cc2
-rw-r--r--ash/wm/modal_container_layout_manager.h4
-rw-r--r--ash/wm/modal_container_layout_manager_unittest.cc4
-rw-r--r--ash/wm/modality_event_filter.h4
-rw-r--r--ash/wm/modality_event_filter_delegate.h4
-rw-r--r--ash/wm/root_window_event_filter.cc2
-rw-r--r--ash/wm/root_window_event_filter.h4
-rw-r--r--ash/wm/root_window_event_filter_unittest.cc2
-rw-r--r--ash/wm/shadow.h4
-rw-r--r--ash/wm/shadow_controller.cc2
-rw-r--r--ash/wm/shadow_controller.h4
-rw-r--r--ash/wm/shadow_controller_unittest.cc2
-rw-r--r--ash/wm/shadow_types.h6
-rw-r--r--ash/wm/shelf_layout_manager.cc2
-rw-r--r--ash/wm/shelf_layout_manager.h4
-rw-r--r--ash/wm/shelf_layout_manager_unittest.cc4
-rw-r--r--ash/wm/stacking_controller.cc4
-rw-r--r--ash/wm/toplevel_frame_view.h4
-rw-r--r--ash/wm/toplevel_layout_manager.h4
-rw-r--r--ash/wm/toplevel_window_event_filter.h4
-rw-r--r--ash/wm/window_frame.h6
-rw-r--r--ash/wm/window_util.h18
-rw-r--r--ash/wm/workspace/workspace.h4
-rw-r--r--ash/wm/workspace/workspace_manager.h4
-rw-r--r--ash/wm/workspace/workspace_manager_unittest.cc2
-rw-r--r--ash/wm/workspace/workspace_observer.h4
-rw-r--r--ash/wm/workspace_controller.cc2
-rw-r--r--ash/wm/workspace_controller.h4
-rw-r--r--ash/wm/workspace_controller_unittest.cc2
83 files changed, 1231 insertions, 147 deletions
diff --git a/ash/accelerators/accelerator_controller.cc b/ash/accelerators/accelerator_controller.cc
index e2aaeda..30a6d98 100644
--- a/ash/accelerators/accelerator_controller.cc
+++ b/ash/accelerators/accelerator_controller.cc
@@ -6,12 +6,12 @@
#include "ash/launcher/launcher.h"
#include "ash/launcher/launcher_model.h"
+#include "ash/screenshot_delegate.h"
+#include "ash/shell.h"
+#include "ash/shell_window_ids.h"
#include "ash/wm/window_util.h"
#include "ui/aura/event.h"
#include "ui/aura/root_window.h"
-#include "ui/aura_shell/screenshot_delegate.h"
-#include "ui/aura_shell/shell.h"
-#include "ui/aura_shell/shell_window_ids.h"
#include "ui/base/accelerators/accelerator.h"
#include "ui/base/accelerators/accelerator_manager.h"
#include "ui/gfx/compositor/debug_utils.h"
diff --git a/ash/accelerators/accelerator_controller.h b/ash/accelerators/accelerator_controller.h
index e6a0946..9670e3d 100644
--- a/ash/accelerators/accelerator_controller.h
+++ b/ash/accelerators/accelerator_controller.h
@@ -11,7 +11,7 @@
#include "base/basictypes.h"
#include "base/compiler_specific.h"
#include "base/memory/scoped_ptr.h"
-#include "ui/aura_shell/aura_shell_export.h"
+#include "ash/ash_export.h"
#include "ui/base/accelerators/accelerator.h"
namespace ui {
@@ -25,7 +25,7 @@ class ScreenshotDelegate;
// AcceleratorController provides functions for registering or unregistering
// global keyboard accelerators, which are handled earlier than any windows. It
// also implements several handlers as an accelerator target.
-class AURA_SHELL_EXPORT AcceleratorController : public ui::AcceleratorTarget {
+class ASH_EXPORT AcceleratorController : public ui::AcceleratorTarget {
public:
AcceleratorController();
virtual ~AcceleratorController();
diff --git a/ash/accelerators/accelerator_controller_unittest.cc b/ash/accelerators/accelerator_controller_unittest.cc
index f4de2e2..6bcfd47 100644
--- a/ash/accelerators/accelerator_controller_unittest.cc
+++ b/ash/accelerators/accelerator_controller_unittest.cc
@@ -3,6 +3,8 @@
// found in the LICENSE file.
#include "ash/accelerators/accelerator_controller.h"
+#include "ash/shell.h"
+#include "ash/shell_window_ids.h"
#include "ash/test/aura_shell_test_base.h"
#include "ash/wm/window_util.h"
#include "ui/aura/event.h"
@@ -10,8 +12,6 @@
#include "ui/aura/test/test_window_delegate.h"
#include "ui/aura/test/test_windows.h"
#include "ui/aura/window.h"
-#include "ui/aura_shell/shell.h"
-#include "ui/aura_shell/shell_window_ids.h"
#if defined(USE_X11)
#include <X11/Xlib.h>
diff --git a/ash/accelerators/accelerator_filter.cc b/ash/accelerators/accelerator_filter.cc
index fbeaaa0..f5ed955 100644
--- a/ash/accelerators/accelerator_filter.cc
+++ b/ash/accelerators/accelerator_filter.cc
@@ -5,9 +5,9 @@
#include "ash/accelerators/accelerator_filter.h"
#include "ash/accelerators/accelerator_controller.h"
+#include "ash/shell.h"
#include "ui/aura/event.h"
#include "ui/aura/root_window.h"
-#include "ui/aura_shell/shell.h"
#include "ui/base/accelerators/accelerator.h"
#include "ui/base/accelerators/accelerator_manager.h"
diff --git a/ash/accelerators/accelerator_filter.h b/ash/accelerators/accelerator_filter.h
index 11c2fdd..bd8eff5 100644
--- a/ash/accelerators/accelerator_filter.h
+++ b/ash/accelerators/accelerator_filter.h
@@ -9,14 +9,14 @@
#include "base/basictypes.h"
#include "base/compiler_specific.h"
#include "ui/aura/event_filter.h"
-#include "ui/aura_shell/aura_shell_export.h"
+#include "ash/ash_export.h"
namespace aura_shell {
namespace internal {
// AcceleratorFilter filters key events for AcceleratorControler handling global
// keyboard accelerators.
-class AURA_SHELL_EXPORT AcceleratorFilter : public aura::EventFilter {
+class ASH_EXPORT AcceleratorFilter : public aura::EventFilter {
public:
AcceleratorFilter();
virtual ~AcceleratorFilter();
diff --git a/ash/app_list/app_list.cc b/ash/app_list/app_list.cc
index 4c8de88..f38ec97 100644
--- a/ash/app_list/app_list.cc
+++ b/ash/app_list/app_list.cc
@@ -6,14 +6,14 @@
#include "ash/app_list/app_list_model.h"
#include "ash/app_list/app_list_view.h"
+#include "ash/ash_switches.h"
+#include "ash/shell_delegate.h"
+#include "ash/shell.h"
+#include "ash/shell_window_ids.h"
#include "base/bind.h"
#include "base/command_line.h"
#include "ui/aura/event.h"
#include "ui/aura/window.h"
-#include "ui/aura_shell/aura_shell_switches.h"
-#include "ui/aura_shell/shell_delegate.h"
-#include "ui/aura_shell/shell.h"
-#include "ui/aura_shell/shell_window_ids.h"
#include "ui/gfx/screen.h"
namespace aura_shell {
diff --git a/ash/app_list/app_list_groups_view.h b/ash/app_list/app_list_groups_view.h
index 4cca797..c7d7ef2 100644
--- a/ash/app_list/app_list_groups_view.h
+++ b/ash/app_list/app_list_groups_view.h
@@ -9,7 +9,7 @@
#include <string>
#include <vector>
-#include "ui/aura_shell/aura_shell_export.h"
+#include "ash/ash_export.h"
#include "ui/base/models/list_model_observer.h"
#include "ui/views/controls/button/button.h"
#include "ui/views/view.h"
@@ -27,7 +27,7 @@ class AppListModel;
// AppListGroupsView displays the UI for an AppListModel. If there are more than
// one group in the model , a button strip is displayed to allow user to switch
// between pages.
-class AURA_SHELL_EXPORT AppListGroupsView : public views::View,
+class ASH_EXPORT AppListGroupsView : public views::View,
public views::ButtonListener,
public ui::ListModelObserver {
public:
diff --git a/ash/app_list/app_list_item_group_model.h b/ash/app_list/app_list_item_group_model.h
index 985016c..f7b9818 100644
--- a/ash/app_list/app_list_item_group_model.h
+++ b/ash/app_list/app_list_item_group_model.h
@@ -10,13 +10,13 @@
#include "ash/app_list/app_list_item_model.h"
#include "base/basictypes.h"
-#include "ui/aura_shell/aura_shell_export.h"
+#include "ash/ash_export.h"
#include "ui/base/models/list_model.h"
namespace aura_shell {
// AppListItemGroupModel holds a list of AppListItemModels.
-class AURA_SHELL_EXPORT AppListItemGroupModel {
+class ASH_EXPORT AppListItemGroupModel {
public:
typedef ui::ListModel<AppListItemModel> Items;
diff --git a/ash/app_list/app_list_item_group_view.h b/ash/app_list/app_list_item_group_view.h
index f2b5d19..154273b 100644
--- a/ash/app_list/app_list_item_group_view.h
+++ b/ash/app_list/app_list_item_group_view.h
@@ -6,7 +6,7 @@
#define ASH_APP_LIST_APP_LIST_ITEM_GROUP_VIEW_H_
#pragma once
-#include "ui/aura_shell/aura_shell_export.h"
+#include "ash/ash_export.h"
#include "ui/base/models/list_model_observer.h"
#include "ui/views/view.h"
@@ -16,7 +16,7 @@ class AppListItemGroupModel;
class AppListItemViewListener;
// AppListItemGroupView displays its children tiles in a grid.
-class AURA_SHELL_EXPORT AppListItemGroupView
+class ASH_EXPORT AppListItemGroupView
: public views::View,
public ui::ListModelObserver {
public:
diff --git a/ash/app_list/app_list_item_model.h b/ash/app_list/app_list_item_model.h
index 60a835f..21eb312 100644
--- a/ash/app_list/app_list_item_model.h
+++ b/ash/app_list/app_list_item_model.h
@@ -11,7 +11,7 @@
#include "base/basictypes.h"
#include "base/observer_list.h"
#include "third_party/skia/include/core/SkBitmap.h"
-#include "ui/aura_shell/aura_shell_export.h"
+#include "ash/ash_export.h"
namespace aura_shell {
@@ -20,7 +20,7 @@ class AppListItemModelObserver;
// AppListItemModel provides icon and title to be shown in a TileView and
// action to be executed when the TileView is activated (clicked or enter
// key it hit).
-class AURA_SHELL_EXPORT AppListItemModel {
+class ASH_EXPORT AppListItemModel {
public:
AppListItemModel();
virtual ~AppListItemModel();
diff --git a/ash/app_list/app_list_item_model_observer.h b/ash/app_list/app_list_item_model_observer.h
index d44b02c8..c80b440 100644
--- a/ash/app_list/app_list_item_model_observer.h
+++ b/ash/app_list/app_list_item_model_observer.h
@@ -6,11 +6,11 @@
#define ASH_APP_LIST_APP_LIST_ITEM_MODEL_OBSERVER_H_
#pragma once
-#include "ui/aura_shell/aura_shell_export.h"
+#include "ash/ash_export.h"
namespace aura_shell {
-class AURA_SHELL_EXPORT AppListItemModelObserver {
+class ASH_EXPORT AppListItemModelObserver {
public:
// Invoked after app list item's icon is changed.
virtual void ItemIconChanged() = 0;
diff --git a/ash/app_list/app_list_item_view.h b/ash/app_list/app_list_item_view.h
index 2a9ef68..2c01d6b 100644
--- a/ash/app_list/app_list_item_view.h
+++ b/ash/app_list/app_list_item_view.h
@@ -7,7 +7,7 @@
#pragma once
#include "ash/app_list/app_list_item_model_observer.h"
-#include "ui/aura_shell/aura_shell_export.h"
+#include "ash/ash_export.h"
#include "ui/views/view.h"
class SkBitmap;
@@ -22,7 +22,7 @@ namespace aura_shell {
class AppListItemModel;
class AppListItemViewListener;
-class AURA_SHELL_EXPORT AppListItemView : public views::View,
+class ASH_EXPORT AppListItemView : public views::View,
public AppListItemModelObserver {
public:
AppListItemView(AppListItemModel* model,
diff --git a/ash/app_list/app_list_item_view_listener.h b/ash/app_list/app_list_item_view_listener.h
index 06dfde0..57e56a4 100644
--- a/ash/app_list/app_list_item_view_listener.h
+++ b/ash/app_list/app_list_item_view_listener.h
@@ -6,13 +6,13 @@
#define ASH_APP_LIST_APP_LIST_ITEM_VIEW_LISTENER_H_
#pragma once
-#include "ui/aura_shell/aura_shell_export.h"
+#include "ash/ash_export.h"
namespace aura_shell {
class AppListItemView;
-class AURA_SHELL_EXPORT AppListItemViewListener {
+class ASH_EXPORT AppListItemViewListener {
public:
// Invoked when an AppListeItemModelView is activated by click or enter key.
virtual void AppListItemActivated(AppListItemView* sender,
diff --git a/ash/app_list/app_list_model.h b/ash/app_list/app_list_model.h
index dae1235..028ced7 100644
--- a/ash/app_list/app_list_model.h
+++ b/ash/app_list/app_list_model.h
@@ -8,14 +8,14 @@
#include "ash/app_list/app_list_item_group_model.h"
#include "base/basictypes.h"
-#include "ui/aura_shell/aura_shell_export.h"
+#include "ash/ash_export.h"
#include "ui/base/models/list_model.h"
namespace aura_shell {
// Model for AppListView. It is consisted of a list of AppListItemGroupModels,
// which in turn owns a list of AppListItemModels.
-class AURA_SHELL_EXPORT AppListModel {
+class ASH_EXPORT AppListModel {
public:
AppListModel();
virtual ~AppListModel();
diff --git a/ash/app_list/app_list_view.cc b/ash/app_list/app_list_view.cc
index 52c78bf..1d7d790 100644
--- a/ash/app_list/app_list_view.cc
+++ b/ash/app_list/app_list_view.cc
@@ -8,7 +8,7 @@
#include "ash/app_list/app_list_item_view.h"
#include "ash/app_list/app_list_model.h"
#include "ash/app_list/app_list_view_delegate.h"
-#include "ui/aura_shell/shell.h"
+#include "ash/shell.h"
#include "ui/views/layout/fill_layout.h"
#include "ui/views/widget/widget.h"
diff --git a/ash/app_list/app_list_view.h b/ash/app_list/app_list_view.h
index 1e39a24..27fc8a2 100644
--- a/ash/app_list/app_list_view.h
+++ b/ash/app_list/app_list_view.h
@@ -7,9 +7,9 @@
#pragma once
#include "ash/app_list/app_list_item_view_listener.h"
+#include "ash/ash_export.h"
+#include "ash/shell_delegate.h"
#include "base/memory/scoped_ptr.h"
-#include "ui/aura_shell/aura_shell_export.h"
-#include "ui/aura_shell/shell_delegate.h"
#include "ui/views/widget/widget_delegate.h"
namespace views {
@@ -23,7 +23,7 @@ class AppListViewDelegate;
// AppListView is the top-level view and controller of app list UI. It creates
// and hosts a AppListModelView and passes AppListModel to it for display.
-class AURA_SHELL_EXPORT AppListView : public views::WidgetDelegateView,
+class ASH_EXPORT AppListView : public views::WidgetDelegateView,
public AppListItemViewListener {
public:
// Takes ownership of |model| and |delegate|.
diff --git a/ash/app_list/app_list_view_delegate.h b/ash/app_list/app_list_view_delegate.h
index 7e0937a..ab55d56 100644
--- a/ash/app_list/app_list_view_delegate.h
+++ b/ash/app_list/app_list_view_delegate.h
@@ -6,13 +6,13 @@
#define ASH_APP_LIST_APP_LIST_VIEW_DELEGATE_H_
#pragma once
-#include "ui/aura_shell/aura_shell_export.h"
+#include "ash/ash_export.h"
namespace aura_shell {
class AppListItemModel;
-class AURA_SHELL_EXPORT AppListViewDelegate {
+class ASH_EXPORT AppListViewDelegate {
public:
// AppListView owns the delegate.
virtual ~AppListViewDelegate() {}
diff --git a/ash/ash_export.h b/ash/ash_export.h
new file mode 100644
index 0000000..3a3978f
--- /dev/null
+++ b/ash/ash_export.h
@@ -0,0 +1,29 @@
+// Copyright (c) 2011 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 ASH_ASH_EXPORT_H_
+#define ASH_ASH_EXPORT_H_
+#pragma once
+
+// Defines ASH_EXPORT so that functionality implemented by the aura_shell
+// module can be exported to consumers.
+
+#if defined(COMPONENT_BUILD)
+#if defined(WIN32)
+
+#if defined(ASH_IMPLEMENTATION)
+#define ASH_EXPORT __declspec(dllexport)
+#else
+#define ASH_EXPORT __declspec(dllimport)
+#endif // defined(ASH_IMPLEMENTATION)
+
+#else // defined(WIN32)
+#define ASH_EXPORT __attribute__((visibility("default")))
+#endif
+
+#else // defined(COMPONENT_BUILD)
+#define ASH_EXPORT
+#endif
+
+#endif // ASH_ASH_EXPORT_H_
diff --git a/ash/ash_switches.cc b/ash/ash_switches.cc
new file mode 100644
index 0000000..21afae7
--- /dev/null
+++ b/ash/ash_switches.cc
@@ -0,0 +1,44 @@
+// Copyright (c) 2011 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/ash_switches.h"
+
+#include <string>
+
+#include "base/command_line.h"
+
+namespace aura_shell {
+namespace switches {
+
+// Avoid drawing drop shadows under windows.
+const char kAuraNoShadows[] = "aura-no-shadows";
+
+// Use Aura-style translucent window frame.
+const char kAuraTranslucentFrames[] = "aura-translucent-frames";
+
+// Use views-based app list.
+const char kAuraViewsAppList[] = "aura-views-applist";
+
+// Use a custom window style, e.g. --aura-window-mode=compact.
+// When this flag is not passed we default to "normal" mode.
+const char kAuraWindowMode[] = "aura-window-mode";
+
+// Show only a single maximized window, like traditional non-Aura builds.
+// Useful for low-resolution screens, such as on laptops.
+const char kAuraWindowModeCompact[] = "compact";
+
+// Default window management with multiple draggable windows.
+const char kAuraWindowModeNormal[] = "normal";
+
+// Use Aura-style workspace window dragging and sizing.
+const char kAuraWorkspaceManager[] = "aura-workspace-manager";
+
+bool IsAuraWindowModeCompact() {
+ std::string mode = CommandLine::ForCurrentProcess()->GetSwitchValueASCII(
+ switches::kAuraWindowMode);
+ return mode == switches::kAuraWindowModeCompact;
+}
+
+} // namespace switches
+} // namespace aura_shell
diff --git a/ash/ash_switches.h b/ash/ash_switches.h
new file mode 100644
index 0000000..559f1cf
--- /dev/null
+++ b/ash/ash_switches.h
@@ -0,0 +1,29 @@
+// Copyright (c) 2011 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 ASH_ASH_SWITCHES_H_
+#define ASH_ASH_SWITCHES_H_
+#pragma once
+
+#include "ash/ash_export.h"
+
+namespace aura_shell {
+namespace switches {
+
+// Please keep alphabetized.
+ASH_EXPORT extern const char kAuraNoShadows[];
+ASH_EXPORT extern const char kAuraTranslucentFrames[];
+ASH_EXPORT extern const char kAuraViewsAppList[];
+ASH_EXPORT extern const char kAuraWindowMode[];
+ASH_EXPORT extern const char kAuraWindowModeCompact[];
+ASH_EXPORT extern const char kAuraWindowModeNormal[];
+ASH_EXPORT extern const char kAuraWorkspaceManager[];
+
+// Utilities for testing multi-valued switches.
+ASH_EXPORT bool IsAuraWindowModeCompact();
+
+} // namespace switches
+} // namespace aura_shell
+
+#endif // ASH_ASH_SWITCHES_H_
diff --git a/ash/desktop_background/desktop_background_view.cc b/ash/desktop_background/desktop_background_view.cc
index e046a8b..25764ed 100644
--- a/ash/desktop_background/desktop_background_view.cc
+++ b/ash/desktop_background/desktop_background_view.cc
@@ -4,12 +4,12 @@
#include "ash/desktop_background/desktop_background_view.h"
+#include "ash/ash_export.h"
+#include "ash/shell.h"
+#include "ash/shell_window_ids.h"
#include "base/utf_string_conversions.h"
#include "grit/ui_resources.h"
#include "ui/aura/root_window.h"
-#include "ui/aura_shell/aura_shell_export.h"
-#include "ui/aura_shell/shell.h"
-#include "ui/aura_shell/shell_window_ids.h"
#include "ui/base/resource/resource_bundle.h"
#include "ui/gfx/canvas.h"
#include "ui/views/widget/widget.h"
diff --git a/ash/drag_drop/drag_drop_controller.cc b/ash/drag_drop/drag_drop_controller.cc
index b316d14..ef0cf6c 100644
--- a/ash/drag_drop/drag_drop_controller.cc
+++ b/ash/drag_drop/drag_drop_controller.cc
@@ -5,11 +5,11 @@
#include "ash/drag_drop/drag_drop_controller.h"
#include "ash/drag_drop/drag_image_view.h"
+#include "ash/shell.h"
#include "base/message_loop.h"
#include "ui/aura/client/drag_drop_delegate.h"
#include "ui/aura/root_window.h"
#include "ui/aura/window.h"
-#include "ui/aura_shell/shell.h"
#include "ui/base/dragdrop/drag_drop_types.h"
#include "ui/base/dragdrop/os_exchange_data_provider_aura.h"
#include "ui/gfx/point.h"
diff --git a/ash/drag_drop/drag_drop_controller.h b/ash/drag_drop/drag_drop_controller.h
index b1aabf8..3c830cb 100644
--- a/ash/drag_drop/drag_drop_controller.h
+++ b/ash/drag_drop/drag_drop_controller.h
@@ -6,7 +6,7 @@
#define ASH_DRAG_DROP_DRAG_DROP_CONTROLLER_H_
#pragma once
-#include "ui/aura_shell/aura_shell_export.h"
+#include "ash/ash_export.h"
#include "ui/aura/client/drag_drop_client.h"
#include "ui/aura/event.h"
#include "ui/aura/event_filter.h"
@@ -28,7 +28,7 @@ namespace internal {
class DragImageView;
-class AURA_SHELL_EXPORT DragDropController
+class ASH_EXPORT DragDropController
: public aura::client::DragDropClient,
public aura::EventFilter {
public:
diff --git a/ash/launcher/launcher.cc b/ash/launcher/launcher.cc
index e275552..cd91f0a 100644
--- a/ash/launcher/launcher.cc
+++ b/ash/launcher/launcher.cc
@@ -6,11 +6,11 @@
#include "ash/launcher/launcher_model.h"
#include "ash/launcher/launcher_view.h"
+#include "ash/shell.h"
+#include "ash/shell_delegate.h"
+#include "ash/shell_window_ids.h"
#include "grit/ui_resources.h"
#include "ui/aura/window.h"
-#include "ui/aura_shell/shell.h"
-#include "ui/aura_shell/shell_delegate.h"
-#include "ui/aura_shell/shell_window_ids.h"
#include "ui/base/resource/resource_bundle.h"
#include "ui/gfx/canvas.h"
#include "ui/gfx/compositor/layer.h"
diff --git a/ash/launcher/launcher.h b/ash/launcher/launcher.h
index e2f223c..0e7c97b 100644
--- a/ash/launcher/launcher.h
+++ b/ash/launcher/launcher.h
@@ -11,7 +11,7 @@
#include "base/basictypes.h"
#include "base/memory/scoped_ptr.h"
#include "ui/aura/window_observer.h"
-#include "ui/aura_shell/aura_shell_export.h"
+#include "ash/ash_export.h"
namespace aura {
class Window;
@@ -25,7 +25,7 @@ namespace aura_shell {
class LauncherModel;
-class AURA_SHELL_EXPORT Launcher : public aura::WindowObserver {
+class ASH_EXPORT Launcher : public aura::WindowObserver {
public:
explicit Launcher(aura::Window* window_container);
~Launcher();
diff --git a/ash/launcher/launcher_model.h b/ash/launcher/launcher_model.h
index a28cd31..7692843 100644
--- a/ash/launcher/launcher_model.h
+++ b/ash/launcher/launcher_model.h
@@ -10,7 +10,7 @@
#include "ash/launcher/launcher_types.h"
#include "base/observer_list.h"
-#include "ui/aura_shell/aura_shell_export.h"
+#include "ash/ash_export.h"
namespace aura {
class Window;
@@ -21,7 +21,7 @@ namespace aura_shell {
class LauncherModelObserver;
// Model used by LauncherView.
-class AURA_SHELL_EXPORT LauncherModel {
+class ASH_EXPORT LauncherModel {
public:
LauncherModel();
~LauncherModel();
diff --git a/ash/launcher/launcher_model_observer.h b/ash/launcher/launcher_model_observer.h
index 4f9b7ee..e3979c6 100644
--- a/ash/launcher/launcher_model_observer.h
+++ b/ash/launcher/launcher_model_observer.h
@@ -6,11 +6,11 @@
#define ASH_LAUNCHER_LAUNCHER_MODEL_OBSERVER_H_
#pragma once
-#include "ui/aura_shell/aura_shell_export.h"
+#include "ash/ash_export.h"
namespace aura_shell {
-class AURA_SHELL_EXPORT LauncherModelObserver {
+class ASH_EXPORT LauncherModelObserver {
public:
// Invoked after an item has been added to the model.
virtual void LauncherItemAdded(int index) = 0;
diff --git a/ash/launcher/launcher_types.h b/ash/launcher/launcher_types.h
index 35150b2..a6ac51f 100644
--- a/ash/launcher/launcher_types.h
+++ b/ash/launcher/launcher_types.h
@@ -9,7 +9,7 @@
#include <vector>
#include "third_party/skia/include/core/SkBitmap.h"
-#include "ui/aura_shell/aura_shell_export.h"
+#include "ash/ash_export.h"
namespace aura {
class Window;
@@ -18,13 +18,13 @@ class Window;
namespace aura_shell {
// Type the LauncherItem represents.
-enum AURA_SHELL_EXPORT LauncherItemType {
+enum ASH_EXPORT LauncherItemType {
TYPE_TABBED,
TYPE_APP
};
// Represents an image in a launcher item of type TYPE_APP.
-struct AURA_SHELL_EXPORT LauncherTabbedImage {
+struct ASH_EXPORT LauncherTabbedImage {
LauncherTabbedImage() : user_data(NULL) {}
LauncherTabbedImage(const SkBitmap& image, void* user_data)
: image(image),
@@ -40,7 +40,7 @@ struct AURA_SHELL_EXPORT LauncherTabbedImage {
typedef std::vector<LauncherTabbedImage> LauncherTabbedImages;
-struct AURA_SHELL_EXPORT LauncherItem {
+struct ASH_EXPORT LauncherItem {
LauncherItem() : type(TYPE_TABBED), window(NULL), user_data(NULL) {}
LauncherItem(LauncherItemType type,
aura::Window* window,
diff --git a/ash/launcher/launcher_unittest.cc b/ash/launcher/launcher_unittest.cc
index 69ac021..60aa2f0 100644
--- a/ash/launcher/launcher_unittest.cc
+++ b/ash/launcher/launcher_unittest.cc
@@ -4,8 +4,8 @@
#include "ash/launcher/launcher.h"
+#include "ash/shell.h"
#include "ash/test/aura_shell_test_base.h"
-#include "ui/aura_shell/shell.h"
#include "ui/views/view.h"
#include "ui/views/widget/widget.h"
diff --git a/ash/launcher/launcher_view.cc b/ash/launcher/launcher_view.cc
index 01b69e2..7b5d2ea 100644
--- a/ash/launcher/launcher_view.cc
+++ b/ash/launcher/launcher_view.cc
@@ -9,11 +9,11 @@
#include "ash/launcher/tabbed_launcher_button.h"
#include "ash/launcher/view_model.h"
#include "ash/launcher/view_model_utils.h"
+#include "ash/shell.h"
+#include "ash/shell_delegate.h"
#include "base/utf_string_conversions.h"
#include "grit/ui_resources.h"
#include "ui/aura/window.h"
-#include "ui/aura_shell/shell.h"
-#include "ui/aura_shell/shell_delegate.h"
#include "ui/base/animation/animation.h"
#include "ui/base/animation/throb_animation.h"
#include "ui/base/models/simple_menu_model.h"
diff --git a/ash/launcher/view_model.h b/ash/launcher/view_model.h
index 0e81c99..67388c7 100644
--- a/ash/launcher/view_model.h
+++ b/ash/launcher/view_model.h
@@ -9,7 +9,7 @@
#include <vector>
#include "base/basictypes.h"
-#include "ui/aura_shell/aura_shell_export.h"
+#include "ash/ash_export.h"
#include "ui/gfx/rect.h"
namespace views {
@@ -23,7 +23,7 @@ namespace aura_shell {
// coordinate conversion as you have to account for the possibility of the
// indices from the model not lining up with those you expect. This class lets
// you define the 'interesting' views and operate on those views.
-class AURA_SHELL_EXPORT ViewModel {
+class ASH_EXPORT ViewModel {
public:
ViewModel();
~ViewModel();
diff --git a/ash/launcher/view_model_utils.h b/ash/launcher/view_model_utils.h
index d6d9a9b..89c748c 100644
--- a/ash/launcher/view_model_utils.h
+++ b/ash/launcher/view_model_utils.h
@@ -7,7 +7,7 @@
#pragma once
#include "base/basictypes.h"
-#include "ui/aura_shell/aura_shell_export.h"
+#include "ash/ash_export.h"
namespace views {
class View;
@@ -17,7 +17,7 @@ namespace aura_shell {
class ViewModel;
-class AURA_SHELL_EXPORT ViewModelUtils {
+class ASH_EXPORT ViewModelUtils {
public:
// Sets the bounds of each view to its ideal bounds.
static void SetViewBoundsToIdealBounds(const ViewModel& model);
diff --git a/ash/screenshot_delegate.h b/ash/screenshot_delegate.h
new file mode 100644
index 0000000..56b29c9
--- /dev/null
+++ b/ash/screenshot_delegate.h
@@ -0,0 +1,22 @@
+// Copyright (c) 2011 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 ASH_SCREENSHOT_DELEGATE_H_
+#define ASH_SCREENSHOT_DELEGATE_H_
+#pragma once
+
+namespace aura_shell {
+
+// Delegate for taking screenshots.
+class ScreenshotDelegate {
+ public:
+ virtual ~ScreenshotDelegate() {}
+
+ // The actual task of taking a screenshot. This method is called
+ // when the user wants to take a screenshot manually.
+ virtual void HandleTakeScreenshot() = 0;
+};
+} // namespace aura_shell
+
+#endif // ASH_SCREENSHOT_DELEGATE_H_
diff --git a/ash/shell.cc b/ash/shell.cc
new file mode 100644
index 0000000..405887e
--- /dev/null
+++ b/ash/shell.cc
@@ -0,0 +1,369 @@
+// Copyright (c) 2011 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 <algorithm>
+
+#include "ash/accelerators/accelerator_controller.h"
+#include "ash/accelerators/accelerator_filter.h"
+#include "ash/app_list/app_list.h"
+#include "ash/ash_switches.h"
+#include "ash/drag_drop/drag_drop_controller.h"
+#include "ash/launcher/launcher.h"
+#include "ash/shell_delegate.h"
+#include "ash/shell_factory.h"
+#include "ash/shell_window_ids.h"
+#include "ash/tooltips/tooltip_controller.h"
+#include "ash/wm/activation_controller.h"
+#include "ash/wm/compact_layout_manager.h"
+#include "ash/wm/compact_status_area_layout_manager.h"
+#include "ash/wm/default_container_event_filter.h"
+#include "ash/wm/default_container_layout_manager.h"
+#include "ash/wm/modal_container_layout_manager.h"
+#include "ash/wm/root_window_event_filter.h"
+#include "ash/wm/root_window_layout_manager.h"
+#include "ash/wm/shadow_controller.h"
+#include "ash/wm/shelf_layout_manager.h"
+#include "ash/wm/stacking_controller.h"
+#include "ash/wm/status_area_layout_manager.h"
+#include "ash/wm/toplevel_layout_manager.h"
+#include "ash/wm/toplevel_window_event_filter.h"
+#include "ash/wm/workspace_controller.h"
+#include "base/bind.h"
+#include "base/command_line.h"
+#include "ui/aura/root_window.h"
+#include "ui/aura/layout_manager.h"
+#include "ui/aura/window.h"
+#include "ui/gfx/compositor/layer.h"
+#include "ui/gfx/compositor/layer_animator.h"
+#include "ui/gfx/screen.h"
+#include "ui/gfx/size.h"
+#include "ui/views/widget/native_widget_aura.h"
+#include "ui/views/widget/widget.h"
+
+namespace aura_shell {
+
+namespace {
+
+using views::Widget;
+
+// Screen width at or below which we automatically start in compact window mode,
+// in pixels. Should be at least 1366 pixels, the resolution of ChromeOS ZGB
+// device displays, as we traditionally used a single window on those devices.
+const int kCompactWindowModeWidthThreshold = 1366;
+
+// Creates each of the special window containers that holds windows of various
+// types in the shell UI. They are added to |containers| from back to front in
+// the z-index.
+void CreateSpecialContainers(aura::Window::Windows* containers) {
+ aura::Window* background_container = new aura::Window(NULL);
+ background_container->set_id(
+ internal::kShellWindowId_DesktopBackgroundContainer);
+ containers->push_back(background_container);
+
+ aura::Window* default_container = new aura::Window(NULL);
+ // Primary windows in compact mode don't allow drag, so don't use the filter.
+ if (!switches::IsAuraWindowModeCompact()) {
+ default_container->SetEventFilter(
+ new ToplevelWindowEventFilter(default_container));
+ }
+ default_container->set_id(internal::kShellWindowId_DefaultContainer);
+ containers->push_back(default_container);
+
+ aura::Window* always_on_top_container = new aura::Window(NULL);
+ always_on_top_container->SetEventFilter(
+ new ToplevelWindowEventFilter(always_on_top_container));
+ always_on_top_container->set_id(
+ internal::kShellWindowId_AlwaysOnTopContainer);
+ containers->push_back(always_on_top_container);
+
+ aura::Window* launcher_container = new aura::Window(NULL);
+ launcher_container->set_id(internal::kShellWindowId_LauncherContainer);
+ containers->push_back(launcher_container);
+
+ aura::Window* modal_container = new aura::Window(NULL);
+ modal_container->SetEventFilter(
+ new ToplevelWindowEventFilter(modal_container));
+ modal_container->SetLayoutManager(
+ new internal::ModalContainerLayoutManager(modal_container));
+ modal_container->set_id(internal::kShellWindowId_ModalContainer);
+ containers->push_back(modal_container);
+
+ // TODO(beng): Figure out if we can make this use ModalityEventFilter instead
+ // of stops_event_propagation.
+ aura::Window* lock_container = new aura::Window(NULL);
+ lock_container->set_stops_event_propagation(true);
+ lock_container->set_id(internal::kShellWindowId_LockScreenContainer);
+ containers->push_back(lock_container);
+
+ aura::Window* lock_modal_container = new aura::Window(NULL);
+ lock_modal_container->SetEventFilter(
+ new ToplevelWindowEventFilter(lock_modal_container));
+ lock_modal_container->SetLayoutManager(
+ new internal::ModalContainerLayoutManager(lock_modal_container));
+ lock_modal_container->set_id(internal::kShellWindowId_LockModalContainer);
+ containers->push_back(lock_modal_container);
+
+ aura::Window* status_container = new aura::Window(NULL);
+ status_container->set_id(internal::kShellWindowId_StatusContainer);
+ containers->push_back(status_container);
+
+ aura::Window* menu_container = new aura::Window(NULL);
+ menu_container->set_id(internal::kShellWindowId_MenusAndTooltipsContainer);
+ containers->push_back(menu_container);
+}
+
+} // namespace
+
+// static
+Shell* Shell::instance_ = NULL;
+
+////////////////////////////////////////////////////////////////////////////////
+// Shell, public:
+
+Shell::Shell(ShellDelegate* delegate)
+ : ALLOW_THIS_IN_INITIALIZER_LIST(method_factory_(this)),
+ accelerator_controller_(new AcceleratorController),
+ delegate_(delegate) {
+ aura::RootWindow::GetInstance()->SetEventFilter(
+ new internal::RootWindowEventFilter);
+}
+
+Shell::~Shell() {
+ RemoveRootWindowEventFilter(accelerator_filter_.get());
+
+ // TooltipController needs a valid shell instance. We delete it before
+ // deleting the shell |instance_|.
+ RemoveRootWindowEventFilter(tooltip_controller_.get());
+ aura::client::SetTooltipClient(NULL);
+
+ // Make sure we delete WorkspaceController before launcher is
+ // deleted as it has a reference to launcher model.
+ workspace_controller_.reset();
+ launcher_.reset();
+
+ // Delete containers now so that child windows does not access
+ // observers when they are destructed. This has to be after launcher
+ // is destructed because launcher closes the widget in its destructor.
+ aura::RootWindow* root_window = aura::RootWindow::GetInstance();
+ while (!root_window->children().empty()) {
+ aura::Window* child = root_window->children()[0];
+ delete child;
+ }
+
+ tooltip_controller_.reset();
+
+ // Drag drop controller needs a valid shell instance. We destroy it first.
+ drag_drop_controller_.reset();
+
+ DCHECK(instance_ == this);
+ instance_ = NULL;
+}
+
+// static
+Shell* Shell::CreateInstance(ShellDelegate* delegate) {
+ CHECK(!instance_);
+ instance_ = new Shell(delegate);
+ instance_->Init();
+ return instance_;
+}
+
+// static
+Shell* Shell::GetInstance() {
+ DCHECK(instance_);
+ return instance_;
+}
+
+// static
+void Shell::DeleteInstance() {
+ delete instance_;
+ instance_ = NULL;
+}
+
+void Shell::Init() {
+ // On small screens we automatically enable --aura-window-mode=compact if the
+ // user has not explicitly set a window mode flag. This must happen before
+ // we create containers or layout managers.
+ gfx::Size monitor_size = gfx::Screen::GetPrimaryMonitorSize();
+ CommandLine* command_line = CommandLine::ForCurrentProcess();
+ if (DefaultToCompactWindowMode(monitor_size, command_line)) {
+ command_line->AppendSwitchASCII(switches::kAuraWindowMode,
+ switches::kAuraWindowModeCompact);
+ }
+
+ aura::RootWindow* root_window = aura::RootWindow::GetInstance();
+ root_window->SetCursor(aura::kCursorPointer);
+
+ activation_controller_.reset(new internal::ActivationController);
+
+ aura::Window::Windows containers;
+ CreateSpecialContainers(&containers);
+ aura::Window::Windows::const_iterator i;
+ for (i = containers.begin(); i != containers.end(); ++i) {
+ (*i)->Init(ui::Layer::LAYER_HAS_NO_TEXTURE);
+ root_window->AddChild(*i);
+ (*i)->Show();
+ }
+
+ stacking_controller_.reset(new internal::StackingController);
+
+ InitLayoutManagers(root_window);
+
+ if (!command_line->HasSwitch(switches::kAuraNoShadows))
+ shadow_controller_.reset(new internal::ShadowController());
+
+ // Force a layout.
+ root_window->layout_manager()->OnWindowResized();
+
+ // Initialize AcceleratorFilter.
+ accelerator_filter_.reset(new internal::AcceleratorFilter);
+ AddRootWindowEventFilter(accelerator_filter_.get());
+
+ // Initialize TooltipController.
+ tooltip_controller_.reset(new internal::TooltipController);
+ AddRootWindowEventFilter(tooltip_controller_.get());
+ aura::client::SetTooltipClient(tooltip_controller_.get());
+
+ // Initialize drag drop controller.
+ drag_drop_controller_.reset(new internal::DragDropController);
+}
+
+bool Shell::DefaultToCompactWindowMode(const gfx::Size& monitor_size,
+ CommandLine* command_line) const {
+ // Developers often run the Aura shell in a window on their desktop.
+ // Don't mess with their window mode.
+ if (!aura::RootWindow::use_fullscreen_host_window())
+ return false;
+
+ // If user set the flag, don't override their desired behavior.
+ if (command_line->HasSwitch(switches::kAuraWindowMode))
+ return false;
+
+ // If the screen is wide enough, we prefer multiple draggable windows.
+ // We explicitly don't care about height, since users don't generally stack
+ // browser windows vertically.
+ if (monitor_size.width() > kCompactWindowModeWidthThreshold)
+ return false;
+
+ return true;
+}
+
+void Shell::InitLayoutManagers(aura::RootWindow* root_window) {
+ internal::RootWindowLayoutManager* root_window_layout =
+ new internal::RootWindowLayoutManager(root_window);
+ root_window->SetLayoutManager(root_window_layout);
+
+ views::Widget* status_widget = NULL;
+ if (delegate_.get())
+ status_widget = delegate_->CreateStatusArea();
+ if (!status_widget)
+ status_widget = internal::CreateStatusArea();
+
+ aura::Window* default_container =
+ GetContainer(internal::kShellWindowId_DefaultContainer);
+
+ // Compact mode has a simplified layout manager and doesn't use the launcher,
+ // desktop background, shelf, etc.
+ if (switches::IsAuraWindowModeCompact()) {
+ default_container->SetLayoutManager(
+ new internal::CompactLayoutManager(status_widget));
+ internal::CompactStatusAreaLayoutManager* status_area_layout_manager =
+ new internal::CompactStatusAreaLayoutManager(status_widget);
+ GetContainer(internal::kShellWindowId_StatusContainer)->
+ SetLayoutManager(status_area_layout_manager);
+ return;
+ }
+
+ root_window_layout->set_background_widget(
+ internal::CreateDesktopBackground());
+ launcher_.reset(new Launcher(default_container));
+
+ internal::ShelfLayoutManager* shelf_layout_manager =
+ new internal::ShelfLayoutManager(launcher_->widget(), status_widget);
+ GetContainer(internal::kShellWindowId_LauncherContainer)->
+ SetLayoutManager(shelf_layout_manager);
+
+ internal::StatusAreaLayoutManager* status_area_layout_manager =
+ new internal::StatusAreaLayoutManager(shelf_layout_manager);
+ GetContainer(internal::kShellWindowId_StatusContainer)->
+ SetLayoutManager(status_area_layout_manager);
+
+ // Workspace manager has its own layout managers.
+ if (CommandLine::ForCurrentProcess()->
+ HasSwitch(switches::kAuraWorkspaceManager)) {
+ EnableWorkspaceManager();
+ return;
+ }
+
+ // Default layout manager.
+ internal::ToplevelLayoutManager* toplevel_layout_manager =
+ new internal::ToplevelLayoutManager();
+ default_container->SetLayoutManager(toplevel_layout_manager);
+ toplevel_layout_manager->set_shelf(shelf_layout_manager);
+}
+
+aura::Window* Shell::GetContainer(int container_id) {
+ return const_cast<aura::Window*>(
+ const_cast<const Shell*>(this)->GetContainer(container_id));
+}
+
+const aura::Window* Shell::GetContainer(int container_id) const {
+ return aura::RootWindow::GetInstance()->GetChildById(container_id);
+}
+
+void Shell::AddRootWindowEventFilter(aura::EventFilter* filter) {
+ static_cast<internal::RootWindowEventFilter*>(
+ aura::RootWindow::GetInstance()->event_filter())->AddFilter(filter);
+}
+
+void Shell::RemoveRootWindowEventFilter(aura::EventFilter* filter) {
+ static_cast<internal::RootWindowEventFilter*>(
+ aura::RootWindow::GetInstance()->event_filter())->RemoveFilter(filter);
+}
+
+void Shell::ToggleOverview() {
+ if (workspace_controller_.get())
+ workspace_controller_->ToggleOverview();
+}
+
+void Shell::ToggleAppList() {
+ if (!app_list_.get())
+ app_list_.reset(new internal::AppList);
+ app_list_->SetVisible(!app_list_->IsVisible());
+}
+
+// Returns true if the screen is locked.
+bool Shell::IsScreenLocked() const {
+ const aura::Window* lock_screen_container = GetContainer(
+ internal::kShellWindowId_LockScreenContainer);
+ const aura::Window::Windows& lock_screen_windows =
+ lock_screen_container->children();
+ aura::Window::Windows::const_iterator lock_screen_it =
+ std::find_if(lock_screen_windows.begin(), lock_screen_windows.end(),
+ std::mem_fun(&aura::Window::IsVisible));
+ if (lock_screen_it != lock_screen_windows.end())
+ return true;
+
+ return false;
+}
+
+////////////////////////////////////////////////////////////////////////////////
+// Shell, private:
+
+void Shell::EnableWorkspaceManager() {
+ aura::Window* default_container =
+ GetContainer(internal::kShellWindowId_DefaultContainer);
+
+ workspace_controller_.reset(
+ new internal::WorkspaceController(default_container));
+ workspace_controller_->SetLauncherModel(launcher_->model());
+ default_container->SetEventFilter(
+ new internal::DefaultContainerEventFilter(default_container));
+ default_container->SetLayoutManager(
+ new internal::DefaultContainerLayoutManager(
+ workspace_controller_->workspace_manager()));
+}
+
+} // namespace aura_shell
diff --git a/ash/shell.h b/ash/shell.h
new file mode 100644
index 0000000..7b0470a
--- /dev/null
+++ b/ash/shell.h
@@ -0,0 +1,149 @@
+// Copyright (c) 2011 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 ASH_SHELL_H_
+#define ASH_SHELL_H_
+#pragma once
+
+#include <utility>
+#include <vector>
+
+#include "ash/ash_export.h"
+#include "base/basictypes.h"
+#include "base/gtest_prod_util.h"
+#include "base/memory/scoped_ptr.h"
+#include "base/task.h"
+#include "base/compiler_specific.h"
+#include "base/memory/weak_ptr.h"
+
+class CommandLine;
+
+namespace aura {
+class EventFilter;
+class RootWindow;
+class Window;
+}
+namespace gfx {
+class Rect;
+class Size;
+}
+
+namespace aura_shell {
+
+class AcceleratorController;
+class Launcher;
+class ShellDelegate;
+
+namespace internal {
+class ActivationController;
+class AcceleratorFilter;
+class AppList;
+class DragDropController;
+class ShadowController;
+class StackingController;
+class TooltipController;
+class WorkspaceController;
+}
+
+// Shell is a singleton object that presents the Shell API and implements the
+// RootWindow's delegate interface.
+class ASH_EXPORT Shell {
+ public:
+ // Upon creation, the Shell sets itself as the RootWindow's delegate, which
+ // takes ownership of the Shell.
+
+ // A shell must be explicitly created so that it can call |Init()| with the
+ // delegate set. |delegate| can be NULL (if not required for initialization).
+ static Shell* CreateInstance(ShellDelegate* delegate);
+
+ // Should never be called before |CreateInstance()|.
+ static Shell* GetInstance();
+
+ static void DeleteInstance();
+
+ aura::Window* GetContainer(int container_id);
+ const aura::Window* GetContainer(int container_id) const;
+
+ // Adds or removes |filter| from the RootWindowEventFilter.
+ void AddRootWindowEventFilter(aura::EventFilter* filter);
+ void RemoveRootWindowEventFilter(aura::EventFilter* filter);
+
+ // Toggles between overview mode and normal mode.
+ void ToggleOverview();
+
+ // Toggles app list.
+ void ToggleAppList();
+
+ // Returns true if the screen is locked.
+ bool IsScreenLocked() const;
+
+ AcceleratorController* accelerator_controller() {
+ return accelerator_controller_.get();
+ }
+
+ internal::TooltipController* tooltip_controller() {
+ return tooltip_controller_.get();
+ }
+
+ ShellDelegate* delegate() { return delegate_.get(); }
+
+ // May return NULL if we're not using a launcher (e.g. laptop-mode).
+ Launcher* launcher() { return launcher_.get(); }
+
+ // Made available for tests.
+ internal::ShadowController* shadow_controller() {
+ return shadow_controller_.get();
+ }
+
+ private:
+ FRIEND_TEST_ALL_PREFIXES(ShellTest, DefaultToCompactWindowMode);
+
+ typedef std::pair<aura::Window*, gfx::Rect> WindowAndBoundsPair;
+
+ explicit Shell(ShellDelegate* delegate);
+ virtual ~Shell();
+
+ void Init();
+
+ // Returns true if the |monitor_size| is narrow and the user has not set
+ // an explicit window mode flag on the |command_line|.
+ bool DefaultToCompactWindowMode(const gfx::Size& monitor_size,
+ CommandLine* command_line) const;
+
+ void InitLayoutManagers(aura::RootWindow* root_window);
+
+ // Enables WorkspaceManager.
+ void EnableWorkspaceManager();
+
+ static Shell* instance_;
+
+ std::vector<WindowAndBoundsPair> to_restore_;
+
+ base::WeakPtrFactory<Shell> method_factory_;
+
+ scoped_ptr<AcceleratorController> accelerator_controller_;
+
+ scoped_ptr<ShellDelegate> delegate_;
+
+ scoped_ptr<Launcher> launcher_;
+
+ scoped_ptr<internal::AppList> app_list_;
+
+ scoped_ptr<internal::StackingController> stacking_controller_;
+ scoped_ptr<internal::ActivationController> activation_controller_;
+ scoped_ptr<internal::DragDropController> drag_drop_controller_;
+ scoped_ptr<internal::WorkspaceController> workspace_controller_;
+ scoped_ptr<internal::ShadowController> shadow_controller_;
+ scoped_ptr<internal::TooltipController> tooltip_controller_;
+
+ // An event filter that pre-handles global accelerators.
+ scoped_ptr<internal::AcceleratorFilter> accelerator_filter_;
+
+
+ DISALLOW_COPY_AND_ASSIGN(Shell);
+};
+
+} // namespace aura_shell
+
+#endif // ASH_SHELL_H_
diff --git a/ash/shell/example_factory.h b/ash/shell/example_factory.h
index 76e1f6e..eaea874 100644
--- a/ash/shell/example_factory.h
+++ b/ash/shell/example_factory.h
@@ -6,7 +6,7 @@
#define ASH_SHELL_EXAMPLE_FACTORY_H_
#pragma once
-#include "ui/aura_shell/shell_delegate.h"
+#include "ash/shell_delegate.h"
namespace aura_shell {
class AppListModel;
diff --git a/ash/shell/lock_view.cc b/ash/shell/lock_view.cc
index 641734f..739649a 100644
--- a/ash/shell/lock_view.cc
+++ b/ash/shell/lock_view.cc
@@ -2,12 +2,12 @@
// 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_window_ids.h"
#include "ash/shell/example_factory.h"
#include "base/utf_string_conversions.h"
#include "ui/aura/root_window.h"
#include "ui/aura/window.h"
-#include "ui/aura_shell/shell.h"
-#include "ui/aura_shell/shell_window_ids.h"
#include "ui/gfx/canvas.h"
#include "ui/gfx/font.h"
#include "ui/views/widget/widget.h"
diff --git a/ash/shell/shell_main.cc b/ash/shell/shell_main.cc
index 7142406..0e5d961 100644
--- a/ash/shell/shell_main.cc
+++ b/ash/shell/shell_main.cc
@@ -3,6 +3,9 @@
// found in the LICENSE file.
#include "ash/launcher/launcher_types.h"
+#include "ash/shell.h"
+#include "ash/shell_delegate.h"
+#include "ash/shell_factory.h"
#include "ash/shell/example_factory.h"
#include "ash/shell/toplevel_window.h"
#include "ash/wm/window_util.h"
@@ -12,9 +15,6 @@
#include "base/memory/scoped_ptr.h"
#include "base/message_loop.h"
#include "ui/aura/root_window.h"
-#include "ui/aura_shell/shell.h"
-#include "ui/aura_shell/shell_delegate.h"
-#include "ui/aura_shell/shell_factory.h"
#include "ui/base/resource/resource_bundle.h"
#include "ui/base/ui_base_paths.h"
#include "ui/gfx/canvas.h"
diff --git a/ash/shell/window_type_launcher.cc b/ash/shell/window_type_launcher.cc
index 04c4667..85028ca 100644
--- a/ash/shell/window_type_launcher.cc
+++ b/ash/shell/window_type_launcher.cc
@@ -4,6 +4,7 @@
#include "ash/shell/window_type_launcher.h"
+#include "ash/shell_window_ids.h"
#include "ash/shell/example_factory.h"
#include "ash/shell/toplevel_window.h"
#include "ash/wm/shadow_types.h"
@@ -11,7 +12,6 @@
#include "base/utf_string_conversions.h"
#include "ui/aura/root_window.h"
#include "ui/aura/window.h"
-#include "ui/aura_shell/shell_window_ids.h"
#include "ui/gfx/canvas.h"
#include "ui/gfx/compositor/layer.h"
#include "ui/views/controls/button/text_button.h"
diff --git a/ash/shell_delegate.h b/ash/shell_delegate.h
new file mode 100644
index 0000000..bf73c5e
--- /dev/null
+++ b/ash/shell_delegate.h
@@ -0,0 +1,67 @@
+// Copyright (c) 2011 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 ASH_SHELL_DELEGATE_H_
+#define ASH_SHELL_DELEGATE_H_
+#pragma once
+
+#include "base/callback.h"
+#include "ash/ash_export.h"
+
+namespace gfx {
+class Rect;
+}
+
+namespace views {
+class Widget;
+}
+
+namespace aura_shell {
+
+class AppListModel;
+class AppListViewDelegate;
+struct LauncherItem;
+
+// Delegate of the Shell.
+class ASH_EXPORT ShellDelegate {
+ public:
+ // Callback to pass back a widget used by RequestAppListWidget.
+ typedef base::Callback<void(views::Widget*)> SetWidgetCallback;
+
+ // The Shell owns the delegate.
+ virtual ~ShellDelegate() {}
+
+ // Invoked when the user clicks on button in the launcher to create a new
+ // window.
+ virtual void CreateNewWindow() = 0;
+
+ // Invoked to create a new status area. Can return NULL.
+ virtual views::Widget* CreateStatusArea() = 0;
+
+ // Invoked to create app list widget. The Delegate calls the callback
+ // when the widget is ready to show.
+ // Deprecated.
+ // TODO(xiyuan): Clean this up when switching to views app list.
+ virtual void RequestAppListWidget(
+ const gfx::Rect& bounds,
+ const SetWidgetCallback& callback) = 0;
+
+ // Invoked to ask the delegate to populate the |model|.
+ virtual void BuildAppListModel(AppListModel* model) = 0;
+
+ // Invoked to create an AppListViewDelegate. Shell takes the ownership of
+ // the created delegate.
+ virtual AppListViewDelegate* CreateAppListViewDelegate() = 0;
+
+ // Invoked when the user clicks on a window entry in the launcher.
+ virtual void LauncherItemClicked(const LauncherItem& item) = 0;
+
+ // Invoked when a window is added. If the delegate wants the launcher to show
+ // an entry for |item->window| it should configure |item| appropriately and
+ // return true.
+ virtual bool ConfigureLauncherItem(LauncherItem* item) = 0;
+};
+} // namespace aura_shell
+
+#endif // ASH_SHELL_DELEGATE_H_
diff --git a/ash/shell_factory.h b/ash/shell_factory.h
new file mode 100644
index 0000000..639de9f
--- /dev/null
+++ b/ash/shell_factory.h
@@ -0,0 +1,27 @@
+// Copyright (c) 2011 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 ASH_SHELL_FACTORY_H_
+#define ASH_SHELL_FACTORY_H_
+#pragma once
+
+#include "ash/ash_export.h"
+
+namespace views {
+class Widget;
+}
+
+// Declarations of shell component factory functions.
+
+namespace aura_shell {
+
+namespace internal {
+views::Widget* CreateDesktopBackground();
+ASH_EXPORT views::Widget* CreateStatusArea();
+} // namespace internal
+
+} // namespace aura_shell
+
+
+#endif // ASH_SHELL_FACTORY_H_
diff --git a/ash/shell_unittest.cc b/ash/shell_unittest.cc
new file mode 100644
index 0000000..1a6c6dc
--- /dev/null
+++ b/ash/shell_unittest.cc
@@ -0,0 +1,292 @@
+// Copyright (c) 2011 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/ash_switches.h"
+#include "ash/shell.h"
+#include "ash/shell_window_ids.h"
+#include "ash/test/aura_shell_test_base.h"
+#include "base/command_line.h"
+#include "base/utf_string_conversions.h"
+#include "ui/aura/test/aura_test_base.h"
+#include "ui/aura/root_window.h"
+#include "ui/aura/window.h"
+#include "ui/gfx/size.h"
+#include "ui/views/widget/widget.h"
+#include "ui/views/widget/widget_delegate.h"
+
+namespace aura_shell {
+
+namespace {
+
+views::Widget* CreateTestWindow(const views::Widget::InitParams& params) {
+ views::Widget* widget = new views::Widget;
+ widget->Init(params);
+ return widget;
+}
+
+aura::Window* GetDefaultContainer() {
+ return Shell::GetInstance()->GetContainer(
+ aura_shell::internal::kShellWindowId_DefaultContainer);
+}
+
+aura::Window* GetAlwaysOnTopContainer() {
+ return Shell::GetInstance()->GetContainer(
+ aura_shell::internal::kShellWindowId_AlwaysOnTopContainer);
+}
+
+void TestCreateWindow(views::Widget::InitParams::Type type,
+ bool always_on_top,
+ aura::Window* expected_container) {
+ views::Widget::InitParams widget_params(type);
+ widget_params.keep_on_top = always_on_top;
+
+ views::Widget* widget = CreateTestWindow(widget_params);
+ widget->Show();
+
+ EXPECT_EQ(expected_container, widget->GetNativeWindow()->parent()) <<
+ "TestCreateWindow: type=" << type << ", always_on_top=" << always_on_top;
+
+ widget->Close();
+}
+
+class ModalWindow : public views::WidgetDelegateView {
+ public:
+ ModalWindow() {}
+ virtual ~ModalWindow() {}
+
+ // Overridden from views::WidgetDelegate:
+ virtual views::View* GetContentsView() OVERRIDE {
+ return this;
+ }
+ virtual bool CanResize() const OVERRIDE {
+ return true;
+ }
+ virtual string16 GetWindowTitle() const OVERRIDE {
+ return ASCIIToUTF16("Modal Window");
+ }
+ virtual bool IsModal() const OVERRIDE {
+ return true;
+ }
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(ModalWindow);
+};
+
+// After base::AutoReset<> but via setter and getter.
+class AutoResetUseFullscreenHostWindow {
+ public:
+ AutoResetUseFullscreenHostWindow(bool new_value) {
+ old_value_ = aura::RootWindow::use_fullscreen_host_window();
+ aura::RootWindow::set_use_fullscreen_host_window(new_value);
+ }
+ ~AutoResetUseFullscreenHostWindow() {
+ aura::RootWindow::set_use_fullscreen_host_window(old_value_);
+ }
+ private:
+ bool old_value_;
+};
+
+} // namespace
+
+class ShellTest : public test::AuraShellTestBase {
+ public:
+ ShellTest() {}
+ virtual ~ShellTest() {}
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(ShellTest);
+};
+
+TEST_F(ShellTest, CreateWindow) {
+ // Normal window should be created in default container.
+ TestCreateWindow(views::Widget::InitParams::TYPE_WINDOW,
+ false, // always_on_top
+ GetDefaultContainer());
+ TestCreateWindow(views::Widget::InitParams::TYPE_POPUP,
+ false, // always_on_top
+ GetDefaultContainer());
+
+ // Always-on-top window and popup are created in always-on-top container.
+ TestCreateWindow(views::Widget::InitParams::TYPE_WINDOW,
+ true, // always_on_top
+ GetAlwaysOnTopContainer());
+ TestCreateWindow(views::Widget::InitParams::TYPE_POPUP,
+ true, // always_on_top
+ GetAlwaysOnTopContainer());
+}
+
+TEST_F(ShellTest, ChangeAlwaysOnTop) {
+ views::Widget::InitParams widget_params(
+ views::Widget::InitParams::TYPE_WINDOW);
+
+ // Creates a normal window
+ views::Widget* widget = CreateTestWindow(widget_params);
+ widget->Show();
+
+ // It should be in default container.
+ EXPECT_EQ(GetDefaultContainer(), widget->GetNativeWindow()->parent());
+
+ // Flip always-on-top flag.
+ widget->SetAlwaysOnTop(true);
+ // And it should in always on top container now.
+ EXPECT_EQ(GetAlwaysOnTopContainer(), widget->GetNativeWindow()->parent());
+
+ // Flip always-on-top flag.
+ widget->SetAlwaysOnTop(false);
+ // It should go back to default container.
+ EXPECT_EQ(GetDefaultContainer(), widget->GetNativeWindow()->parent());
+
+ // Set the same always-on-top flag again.
+ widget->SetAlwaysOnTop(false);
+ // Should have no effect and we are still in the default container.
+ EXPECT_EQ(GetDefaultContainer(), widget->GetNativeWindow()->parent());
+
+ widget->Close();
+}
+
+TEST_F(ShellTest, CreateModalWindow) {
+ views::Widget::InitParams widget_params(
+ views::Widget::InitParams::TYPE_WINDOW);
+
+ // Create a normal window.
+ views::Widget* widget = CreateTestWindow(widget_params);
+ widget->Show();
+
+ // It should be in default container.
+ EXPECT_EQ(GetDefaultContainer(), widget->GetNativeWindow()->parent());
+
+ // Create a modal window.
+ views::Widget* modal_widget = views::Widget::CreateWindowWithParent(
+ new ModalWindow(), widget->GetNativeView());
+ modal_widget->Show();
+
+ // It should be in modal container.
+ aura::Window* modal_container = Shell::GetInstance()->GetContainer(
+ aura_shell::internal::kShellWindowId_ModalContainer);
+ EXPECT_EQ(modal_container, modal_widget->GetNativeWindow()->parent());
+
+ modal_widget->Close();
+ widget->Close();
+}
+
+TEST_F(ShellTest, CreateLockScreenModalWindow) {
+ views::Widget::InitParams widget_params(
+ views::Widget::InitParams::TYPE_WINDOW);
+
+ // Create a normal window.
+ views::Widget* widget = CreateTestWindow(widget_params);
+ widget->Show();
+
+ // It should be in default container.
+ EXPECT_EQ(GetDefaultContainer(), widget->GetNativeWindow()->parent());
+
+ // Create a LockScreen window.
+ views::Widget* lock_widget = CreateTestWindow(widget_params);
+ aura_shell::Shell::GetInstance()->GetContainer(
+ aura_shell::internal::kShellWindowId_LockScreenContainer)->
+ AddChild(lock_widget->GetNativeView());
+ lock_widget->Show();
+
+ // It should be in LockScreen container.
+ aura::Window* lock_screen = Shell::GetInstance()->GetContainer(
+ aura_shell::internal::kShellWindowId_LockScreenContainer);
+ EXPECT_EQ(lock_screen, lock_widget->GetNativeWindow()->parent());
+
+ // Create a modal window with a lock window as parent.
+ views::Widget* lock_modal_widget = views::Widget::CreateWindowWithParent(
+ new ModalWindow(), lock_widget->GetNativeView());
+ lock_modal_widget->Show();
+
+ // It should be in LockScreen modal container.
+ aura::Window* lock_modal_container = Shell::GetInstance()->GetContainer(
+ aura_shell::internal::kShellWindowId_LockModalContainer);
+ EXPECT_EQ(lock_modal_container,
+ lock_modal_widget->GetNativeWindow()->parent());
+
+ // Create a modal window with a normal window as parent.
+ views::Widget* modal_widget = views::Widget::CreateWindowWithParent(
+ new ModalWindow(), widget->GetNativeView());
+ modal_widget->Show();
+
+ // It should be in non-LockScreen modal container.
+ aura::Window* modal_container = Shell::GetInstance()->GetContainer(
+ aura_shell::internal::kShellWindowId_ModalContainer);
+ EXPECT_EQ(modal_container, modal_widget->GetNativeWindow()->parent());
+
+ modal_widget->Close();
+ lock_modal_widget->Close();
+ lock_widget->Close();
+ widget->Close();
+}
+
+TEST_F(ShellTest, IsScreenLocked) {
+ views::Widget::InitParams widget_params(
+ views::Widget::InitParams::TYPE_WINDOW);
+
+ // A normal window does not lock the screen.
+ views::Widget* widget = CreateTestWindow(widget_params);
+ widget->Show();
+ EXPECT_FALSE(Shell::GetInstance()->IsScreenLocked());
+ widget->Hide();
+ EXPECT_FALSE(Shell::GetInstance()->IsScreenLocked());
+
+ // A modal window with a normal window as parent does not locks the screen.
+ views::Widget* modal_widget = views::Widget::CreateWindowWithParent(
+ new ModalWindow(), widget->GetNativeView());
+ modal_widget->Show();
+ EXPECT_FALSE(Shell::GetInstance()->IsScreenLocked());
+ modal_widget->Close();
+ EXPECT_FALSE(Shell::GetInstance()->IsScreenLocked());
+ widget->Close();
+
+ // A lock screen window locks the screen.
+ views::Widget* lock_widget = CreateTestWindow(widget_params);
+ aura_shell::Shell::GetInstance()->GetContainer(
+ aura_shell::internal::kShellWindowId_LockScreenContainer)->
+ AddChild(lock_widget->GetNativeView());
+ lock_widget->Show();
+ EXPECT_TRUE(Shell::GetInstance()->IsScreenLocked());
+ lock_widget->Hide();
+ EXPECT_FALSE(Shell::GetInstance()->IsScreenLocked());
+
+ // A modal window with a lock window as parent does not lock the screen. The
+ // screen is locked only when a lock windown is visible.
+ views::Widget* lock_modal_widget = views::Widget::CreateWindowWithParent(
+ new ModalWindow(), lock_widget->GetNativeView());
+ lock_modal_widget->Show();
+ EXPECT_FALSE(Shell::GetInstance()->IsScreenLocked());
+ lock_widget->Show();
+ EXPECT_TRUE(Shell::GetInstance()->IsScreenLocked());
+ lock_modal_widget->Close();
+ EXPECT_TRUE(Shell::GetInstance()->IsScreenLocked());
+ lock_widget->Close();
+ EXPECT_FALSE(Shell::GetInstance()->IsScreenLocked());
+}
+
+TEST_F(ShellTest, DefaultToCompactWindowMode) {
+ // We only change default window mode with full-screen host windows.
+ AutoResetUseFullscreenHostWindow use_fullscreen_host_window(true);
+
+ // Wide screens use normal window mode.
+ Shell* shell = Shell::GetInstance();
+ gfx::Size monitor_size(1440, 900);
+ CommandLine command_line(CommandLine::NO_PROGRAM);
+ EXPECT_FALSE(shell->DefaultToCompactWindowMode(monitor_size, &command_line));
+
+ // Alex-sized screens need compact mode.
+ monitor_size.SetSize(1280, 800);
+ EXPECT_TRUE(shell->DefaultToCompactWindowMode(monitor_size, &command_line));
+
+ // ZGB-sized screens need compact mode.
+ monitor_size.SetSize(1366, 768);
+ EXPECT_TRUE(shell->DefaultToCompactWindowMode(monitor_size, &command_line));
+
+ // Even for a small screen, the user can force normal mode.
+ monitor_size.SetSize(800, 600);
+ command_line.AppendSwitchASCII(aura_shell::switches::kAuraWindowMode,
+ aura_shell::switches::kAuraWindowModeNormal);
+ EXPECT_FALSE(shell->DefaultToCompactWindowMode(monitor_size, &command_line));
+}
+
+} // namespace aura_shell
diff --git a/ash/shell_window_ids.h b/ash/shell_window_ids.h
new file mode 100644
index 0000000..746d178
--- /dev/null
+++ b/ash/shell_window_ids.h
@@ -0,0 +1,47 @@
+// Copyright (c) 2011 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 ASH_SHELL_WINDOW_IDS_H_
+#define ASH_SHELL_WINDOW_IDS_H_
+#pragma once
+
+// Declarations of ids of special shell windows.
+
+namespace aura_shell {
+
+namespace internal {
+
+// The desktop background window.
+const int kShellWindowId_DesktopBackgroundContainer = 0;
+
+// The container for standard top-level windows.
+const int kShellWindowId_DefaultContainer = 1;
+
+// The container for top-level windows with the 'always-on-top' flag set.
+const int kShellWindowId_AlwaysOnTopContainer = 2;
+
+// The container for the launcher.
+const int kShellWindowId_LauncherContainer = 3;
+
+// The container for user-specific modal windows.
+const int kShellWindowId_ModalContainer = 4;
+
+// The container for the lock screen.
+const int kShellWindowId_LockScreenContainer = 5;
+
+// The container for the lock screen modal windows.
+const int kShellWindowId_LockModalContainer = 6;
+
+// The container for the status area.
+const int kShellWindowId_StatusContainer = 7;
+
+// The container for menus and tooltips.
+const int kShellWindowId_MenusAndTooltipsContainer = 8;
+
+} // namespace internal
+
+} // namespace aura_shell
+
+
+#endif // ASH_SHELL_WINDOW_IDS_H_
diff --git a/ash/status_area/status_area_view.cc b/ash/status_area/status_area_view.cc
index 5f9fb01..937ac58 100644
--- a/ash/status_area/status_area_view.cc
+++ b/ash/status_area/status_area_view.cc
@@ -4,12 +4,12 @@
#include "ash/status_area/status_area_view.h"
+#include "ash/ash_export.h"
+#include "ash/shell.h"
+#include "ash/shell_window_ids.h"
#include "base/utf_string_conversions.h"
#include "grit/ui_resources.h"
#include "ui/aura/root_window.h"
-#include "ui/aura_shell/aura_shell_export.h"
-#include "ui/aura_shell/shell.h"
-#include "ui/aura_shell/shell_window_ids.h"
#include "ui/base/resource/resource_bundle.h"
#include "ui/gfx/canvas.h"
#include "ui/views/widget/widget.h"
@@ -32,7 +32,7 @@ void StatusAreaView::OnPaint(gfx::Canvas* canvas) {
canvas->DrawBitmapInt(status_mock_, 0, 0);
}
-AURA_SHELL_EXPORT views::Widget* CreateStatusArea() {
+ASH_EXPORT views::Widget* CreateStatusArea() {
StatusAreaView* status_area_view = new StatusAreaView;
views::Widget* widget = new views::Widget;
views::Widget::InitParams params(views::Widget::InitParams::TYPE_CONTROL);
diff --git a/ash/test/ash_unittests.cc b/ash/test/ash_unittests.cc
new file mode 100644
index 0000000..ad39e19
--- /dev/null
+++ b/ash/test/ash_unittests.cc
@@ -0,0 +1,9 @@
+// Copyright (c) 2011 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/test/test_suite.h"
+
+int main(int argc, char** argv) {
+ return aura_shell::test::AuraShellTestSuite(argc, argv).Run();
+}
diff --git a/ash/test/aura_shell_test_base.cc b/ash/test/aura_shell_test_base.cc
index 608f76a..6b99331 100644
--- a/ash/test/aura_shell_test_base.cc
+++ b/ash/test/aura_shell_test_base.cc
@@ -4,8 +4,8 @@
#include "ash/test/aura_shell_test_base.h"
+#include "ash/shell.h"
#include "ash/test/test_shell_delegate.h"
-#include "ui/aura_shell/shell.h"
namespace aura_shell {
namespace test {
diff --git a/ash/test/test_shell_delegate.h b/ash/test/test_shell_delegate.h
index 6d922ca..1acc6a0 100644
--- a/ash/test/test_shell_delegate.h
+++ b/ash/test/test_shell_delegate.h
@@ -6,8 +6,8 @@
#define ASH_TEST_TEST_SHELL_DELEGATE_H_
#pragma once
+#include "ash/shell_delegate.h"
#include "base/compiler_specific.h"
-#include "ui/aura_shell/shell_delegate.h"
namespace aura_shell {
namespace test {
diff --git a/ash/tooltips/tooltip_controller.cc b/ash/tooltips/tooltip_controller.cc
index 20e1097..661d04c 100644
--- a/ash/tooltips/tooltip_controller.cc
+++ b/ash/tooltips/tooltip_controller.cc
@@ -6,14 +6,14 @@
#include <vector>
+#include "ash/ash_switches.h"
+#include "ash/shell.h"
#include "base/command_line.h"
#include "base/location.h"
#include "base/string_split.h"
#include "base/time.h"
-#include "ui/aura_shell/aura_shell_switches.h"
#include "ui/aura/event.h"
#include "ui/aura/window.h"
-#include "ui/aura_shell/shell.h"
#include "ui/base/resource/resource_bundle.h"
#include "ui/base/text/text_elider.h"
#include "ui/gfx/font.h"
diff --git a/ash/tooltips/tooltip_controller.h b/ash/tooltips/tooltip_controller.h
index 41daaa22..5ab55d64 100644
--- a/ash/tooltips/tooltip_controller.h
+++ b/ash/tooltips/tooltip_controller.h
@@ -12,7 +12,7 @@
#include "ui/aura/client/tooltip_client.h"
#include "ui/aura/event_filter.h"
#include "ui/aura/window_observer.h"
-#include "ui/aura_shell/aura_shell_export.h"
+#include "ash/ash_export.h"
#include "ui/gfx/point.h"
namespace aura {
@@ -31,7 +31,7 @@ class TooltipControllerTest;
namespace internal {
// TooltipController provides tooltip functionality for aura shell.
-class AURA_SHELL_EXPORT TooltipController : public aura::client::TooltipClient,
+class ASH_EXPORT TooltipController : public aura::client::TooltipClient,
public aura::EventFilter,
public aura::WindowObserver {
public:
diff --git a/ash/wm/activation_controller.cc b/ash/wm/activation_controller.cc
index e6c4d82..faa9d92 100644
--- a/ash/wm/activation_controller.cc
+++ b/ash/wm/activation_controller.cc
@@ -4,14 +4,14 @@
#include "ash/wm/activation_controller.h"
+#include "ash/shell.h"
+#include "ash/shell_window_ids.h"
#include "ash/wm/window_util.h"
#include "base/auto_reset.h"
#include "ui/aura/client/activation_delegate.h"
#include "ui/aura/root_window.h"
#include "ui/aura/window.h"
#include "ui/aura/window_delegate.h"
-#include "ui/aura_shell/shell.h"
-#include "ui/aura_shell/shell_window_ids.h"
namespace aura_shell {
namespace internal {
diff --git a/ash/wm/activation_controller.h b/ash/wm/activation_controller.h
index 6a17489..911db82 100644
--- a/ash/wm/activation_controller.h
+++ b/ash/wm/activation_controller.h
@@ -12,13 +12,13 @@
#include "ui/aura/client/activation_client.h"
#include "ui/aura/root_window_observer.h"
#include "ui/aura/window_observer.h"
-#include "ui/aura_shell/aura_shell_export.h"
+#include "ash/ash_export.h"
namespace aura_shell {
namespace internal {
// Exported for unit tests.
-class AURA_SHELL_EXPORT ActivationController
+class ASH_EXPORT ActivationController
: public aura::client::ActivationClient,
public aura::WindowObserver,
public aura::RootWindowObserver {
diff --git a/ash/wm/compact_layout_manager.h b/ash/wm/compact_layout_manager.h
index 1e713e8..0497b20 100644
--- a/ash/wm/compact_layout_manager.h
+++ b/ash/wm/compact_layout_manager.h
@@ -12,7 +12,7 @@
#include "base/compiler_specific.h"
#include "ui/aura/layout_manager.h"
#include "ui/aura/window_observer.h"
-#include "ui/aura_shell/aura_shell_export.h"
+#include "ash/ash_export.h"
namespace views {
class Widget;
@@ -25,7 +25,7 @@ namespace internal {
// hosts what the shell considers to be top-level windows. It is used for low
// resolution screens and keeps the main browser window maximized.
// It listens for changes to kShowStateKey and resizes the window appropriately.
-class AURA_SHELL_EXPORT CompactLayoutManager : public aura::LayoutManager,
+class ASH_EXPORT CompactLayoutManager : public aura::LayoutManager,
public aura::WindowObserver {
public:
explicit CompactLayoutManager(views::Widget* status_area_widget);
diff --git a/ash/wm/default_container_layout_manager.h b/ash/wm/default_container_layout_manager.h
index ae52ab9..51b7bbdf 100644
--- a/ash/wm/default_container_layout_manager.h
+++ b/ash/wm/default_container_layout_manager.h
@@ -10,7 +10,7 @@
#include "base/compiler_specific.h"
#include "base/memory/scoped_ptr.h"
#include "ui/aura/layout_manager.h"
-#include "ui/aura_shell/aura_shell_export.h"
+#include "ash/ash_export.h"
namespace aura {
class MouseEvent;
@@ -28,7 +28,7 @@ class ShowStateController;
class WorkspaceManager;
// LayoutManager for the default window container.
-class AURA_SHELL_EXPORT DefaultContainerLayoutManager
+class ASH_EXPORT DefaultContainerLayoutManager
: public aura::LayoutManager {
public:
explicit DefaultContainerLayoutManager(WorkspaceManager* workspace_manager);
diff --git a/ash/wm/image_grid.h b/ash/wm/image_grid.h
index a8a5686..38ff5a8 100644
--- a/ash/wm/image_grid.h
+++ b/ash/wm/image_grid.h
@@ -9,7 +9,7 @@
#include "base/basictypes.h"
#include "base/gtest_prod_util.h"
#include "base/memory/scoped_ptr.h"
-#include "ui/aura_shell/aura_shell_export.h"
+#include "ash/ash_export.h"
#include "ui/gfx/compositor/layer.h"
#include "ui/gfx/compositor/layer_delegate.h"
#include "ui/gfx/rect.h"
@@ -58,7 +58,7 @@ namespace internal {
// | xXX|
// ...
//
-class AURA_SHELL_EXPORT ImageGrid {
+class ASH_EXPORT ImageGrid {
public:
// Helper class for use by tests.
class TestAPI {
diff --git a/ash/wm/modal_container_layout_manager.cc b/ash/wm/modal_container_layout_manager.cc
index 8619e89..7255a5e 100644
--- a/ash/wm/modal_container_layout_manager.cc
+++ b/ash/wm/modal_container_layout_manager.cc
@@ -4,6 +4,7 @@
#include "ash/wm/modal_container_layout_manager.h"
+#include "ash/shell.h"
#include "ash/wm/modality_event_filter.h"
#include "ash/wm/window_util.h"
#include "base/bind.h"
@@ -11,7 +12,6 @@
#include "ui/aura/event.h"
#include "ui/aura/root_window.h"
#include "ui/aura/window.h"
-#include "ui/aura_shell/shell.h"
#include "ui/gfx/canvas.h"
#include "ui/gfx/compositor/layer.h"
#include "ui/gfx/compositor/layer_animator.h"
diff --git a/ash/wm/modal_container_layout_manager.h b/ash/wm/modal_container_layout_manager.h
index 471430b..6a67362 100644
--- a/ash/wm/modal_container_layout_manager.h
+++ b/ash/wm/modal_container_layout_manager.h
@@ -14,7 +14,7 @@
#include "base/memory/scoped_ptr.h"
#include "ui/aura/layout_manager.h"
#include "ui/aura/window_observer.h"
-#include "ui/aura_shell/aura_shell_export.h"
+#include "ash/ash_export.h"
#include "ui/gfx/compositor/layer_animation_observer.h"
namespace aura {
@@ -32,7 +32,7 @@ namespace aura_shell {
namespace internal {
// LayoutManager for the modal window container.
-class AURA_SHELL_EXPORT ModalContainerLayoutManager
+class ASH_EXPORT ModalContainerLayoutManager
: public aura::LayoutManager,
public aura::WindowObserver,
public ui::LayerAnimationObserver,
diff --git a/ash/wm/modal_container_layout_manager_unittest.cc b/ash/wm/modal_container_layout_manager_unittest.cc
index 4264a86..7953004 100644
--- a/ash/wm/modal_container_layout_manager_unittest.cc
+++ b/ash/wm/modal_container_layout_manager_unittest.cc
@@ -4,14 +4,14 @@
#include "ash/wm/modal_container_layout_manager.h"
+#include "ash/shell.h"
+#include "ash/shell_window_ids.h"
#include "ash/test/aura_shell_test_base.h"
#include "ash/wm/window_util.h"
#include "base/compiler_specific.h"
#include "ui/aura/root_window.h"
#include "ui/aura/test/event_generator.h"
#include "ui/aura/window.h"
-#include "ui/aura_shell/shell.h"
-#include "ui/aura_shell/shell_window_ids.h"
#include "ui/views/widget/widget.h"
#include "ui/views/widget/widget_delegate.h"
diff --git a/ash/wm/modality_event_filter.h b/ash/wm/modality_event_filter.h
index b3f1b7c..73d55f9 100644
--- a/ash/wm/modality_event_filter.h
+++ b/ash/wm/modality_event_filter.h
@@ -8,14 +8,14 @@
#include "base/compiler_specific.h"
#include "ui/aura/event_filter.h"
-#include "ui/aura_shell/aura_shell_export.h"
+#include "ash/ash_export.h"
namespace aura_shell {
namespace internal {
class ModalityEventFilterDelegate;
-class AURA_SHELL_EXPORT ModalityEventFilter : public aura::EventFilter {
+class ASH_EXPORT ModalityEventFilter : public aura::EventFilter {
public:
ModalityEventFilter(aura::Window* container,
ModalityEventFilterDelegate* delegate);
diff --git a/ash/wm/modality_event_filter_delegate.h b/ash/wm/modality_event_filter_delegate.h
index 88cacba..57d9420 100644
--- a/ash/wm/modality_event_filter_delegate.h
+++ b/ash/wm/modality_event_filter_delegate.h
@@ -6,7 +6,7 @@
#define ASH_WM_MODALITY_EVENT_FILTER_DELEGATE_H_
#pragma once
-#include "ui/aura_shell/aura_shell_export.h"
+#include "ash/ash_export.h"
namespace aura {
class Window;
@@ -15,7 +15,7 @@ class Window;
namespace aura_shell {
namespace internal {
-class AURA_SHELL_EXPORT ModalityEventFilterDelegate {
+class ASH_EXPORT ModalityEventFilterDelegate {
public:
// Returns true if |window| can receive the specified event.
virtual bool CanWindowReceiveEvents(aura::Window* window) = 0;
diff --git a/ash/wm/root_window_event_filter.cc b/ash/wm/root_window_event_filter.cc
index 07b37f0..7e6bdaf 100644
--- a/ash/wm/root_window_event_filter.cc
+++ b/ash/wm/root_window_event_filter.cc
@@ -4,13 +4,13 @@
#include "ash/wm/root_window_event_filter.h"
+#include "ash/shell.h"
#include "ash/wm/activation_controller.h"
#include "ash/wm/window_util.h"
#include "ui/aura/event.h"
#include "ui/aura/focus_manager.h"
#include "ui/aura/root_window.h"
#include "ui/aura/window_delegate.h"
-#include "ui/aura_shell/shell.h"
#include "ui/base/hit_test.h"
namespace aura_shell {
diff --git a/ash/wm/root_window_event_filter.h b/ash/wm/root_window_event_filter.h
index 294ad1f..97bbe68 100644
--- a/ash/wm/root_window_event_filter.h
+++ b/ash/wm/root_window_event_filter.h
@@ -10,7 +10,7 @@
#include "base/observer_list.h"
#include "ui/aura/event.h"
#include "ui/aura/event_filter.h"
-#include "ui/aura_shell/aura_shell_export.h"
+#include "ash/ash_export.h"
namespace aura_shell {
namespace internal {
@@ -23,7 +23,7 @@ namespace internal {
// consumed by any of those filters. If an event is consumed by a filter, the
// rest of the filter(s) and RootWindowEventFilter will not see the consumed
// event.
-class AURA_SHELL_EXPORT RootWindowEventFilter : public aura::EventFilter {
+class ASH_EXPORT RootWindowEventFilter : public aura::EventFilter {
public:
RootWindowEventFilter();
virtual ~RootWindowEventFilter();
diff --git a/ash/wm/root_window_event_filter_unittest.cc b/ash/wm/root_window_event_filter_unittest.cc
index 7b1a2b4..708a9b8 100644
--- a/ash/wm/root_window_event_filter_unittest.cc
+++ b/ash/wm/root_window_event_filter_unittest.cc
@@ -4,6 +4,7 @@
#include "ash/wm/root_window_event_filter.h"
+#include "ash/shell_window_ids.h"
#include "ash/test/test_activation_delegate.h"
#include "ash/wm/activation_controller.h"
#include "ash/wm/window_util.h"
@@ -16,7 +17,6 @@
#include "ui/aura/test/test_windows.h"
#include "ui/aura/test/test_event_filter.h"
#include "ui/aura/test/test_window_delegate.h"
-#include "ui/aura_shell/shell_window_ids.h"
#include "ui/base/hit_test.h"
#include "ui/gfx/screen.h"
diff --git a/ash/wm/shadow.h b/ash/wm/shadow.h
index ed5f393..4f82b82 100644
--- a/ash/wm/shadow.h
+++ b/ash/wm/shadow.h
@@ -8,7 +8,7 @@
#include "base/basictypes.h"
#include "base/memory/scoped_ptr.h"
-#include "ui/aura_shell/aura_shell_export.h"
+#include "ash/ash_export.h"
#include "ui/gfx/rect.h"
namespace ui {
@@ -21,7 +21,7 @@ namespace internal {
class ImageGrid;
// Simple class that draws a drop shadow around content at given bounds.
-class AURA_SHELL_EXPORT Shadow {
+class ASH_EXPORT Shadow {
public:
Shadow();
~Shadow();
diff --git a/ash/wm/shadow_controller.cc b/ash/wm/shadow_controller.cc
index 0193a94..b39d619 100644
--- a/ash/wm/shadow_controller.cc
+++ b/ash/wm/shadow_controller.cc
@@ -6,6 +6,7 @@
#include <utility>
+#include "ash/ash_switches.h"
#include "ash/wm/shadow.h"
#include "ash/wm/shadow_types.h"
#include "ash/wm/window_properties.h"
@@ -13,7 +14,6 @@
#include "base/logging.h"
#include "ui/aura/root_window.h"
#include "ui/aura/window.h"
-#include "ui/aura_shell/aura_shell_switches.h"
using std::make_pair;
diff --git a/ash/wm/shadow_controller.h b/ash/wm/shadow_controller.h
index 82f2e45..403a658 100644
--- a/ash/wm/shadow_controller.h
+++ b/ash/wm/shadow_controller.h
@@ -13,7 +13,7 @@
#include "base/memory/linked_ptr.h"
#include "ui/aura/root_window_observer.h"
#include "ui/aura/window_observer.h"
-#include "ui/aura_shell/aura_shell_export.h"
+#include "ash/ash_export.h"
namespace aura {
class Window;
@@ -29,7 +29,7 @@ class Shadow;
// ShadowController observes changes to windows and creates and updates drop
// shadows as needed.
-class AURA_SHELL_EXPORT ShadowController : public aura::RootWindowObserver,
+class ASH_EXPORT ShadowController : public aura::RootWindowObserver,
public aura::WindowObserver {
public:
class TestApi {
diff --git a/ash/wm/shadow_controller_unittest.cc b/ash/wm/shadow_controller_unittest.cc
index 6f8efe4..9bc581c 100644
--- a/ash/wm/shadow_controller_unittest.cc
+++ b/ash/wm/shadow_controller_unittest.cc
@@ -7,6 +7,7 @@
#include <algorithm>
#include <vector>
+#include "ash/shell.h"
#include "ash/test/aura_shell_test_base.h"
#include "ash/wm/shadow.h"
#include "ash/wm/shadow_types.h"
@@ -14,7 +15,6 @@
#include "base/memory/scoped_ptr.h"
#include "ui/aura/root_window.h"
#include "ui/aura/window.h"
-#include "ui/aura_shell/shell.h"
#include "ui/gfx/compositor/layer.h"
namespace aura_shell {
diff --git a/ash/wm/shadow_types.h b/ash/wm/shadow_types.h
index 29b85e5..59d7252 100644
--- a/ash/wm/shadow_types.h
+++ b/ash/wm/shadow_types.h
@@ -6,7 +6,7 @@
#define ASH_WM_SHADOW_TYPES_H_
#pragma once
-#include "ui/aura_shell/aura_shell_export.h"
+#include "ash/ash_export.h"
namespace aura {
class Window;
@@ -23,9 +23,9 @@ enum ShadowType {
SHADOW_TYPE_RECTANGULAR,
};
-AURA_SHELL_EXPORT void SetShadowType(aura::Window* window,
+ASH_EXPORT void SetShadowType(aura::Window* window,
ShadowType shadow_type);
-AURA_SHELL_EXPORT ShadowType GetShadowType(aura::Window* window);
+ASH_EXPORT ShadowType GetShadowType(aura::Window* window);
} // namespace internal
} // namespace aura_shell
diff --git a/ash/wm/shelf_layout_manager.cc b/ash/wm/shelf_layout_manager.cc
index 05661ec..5c2f349 100644
--- a/ash/wm/shelf_layout_manager.cc
+++ b/ash/wm/shelf_layout_manager.cc
@@ -5,10 +5,10 @@
#include "ash/wm/shelf_layout_manager.h"
#include "ash/launcher/launcher.h"
+#include "ash/shell.h"
#include "base/auto_reset.h"
#include "ui/aura/root_window.h"
#include "ui/aura/screen_aura.h"
-#include "ui/aura_shell/shell.h"
#include "ui/gfx/compositor/layer.h"
#include "ui/gfx/compositor/layer_animator.h"
#include "ui/views/widget/widget.h"
diff --git a/ash/wm/shelf_layout_manager.h b/ash/wm/shelf_layout_manager.h
index 6beed27..0480313 100644
--- a/ash/wm/shelf_layout_manager.h
+++ b/ash/wm/shelf_layout_manager.h
@@ -9,7 +9,7 @@
#include "base/basictypes.h"
#include "base/compiler_specific.h"
#include "ui/aura/layout_manager.h"
-#include "ui/aura_shell/aura_shell_export.h"
+#include "ash/ash_export.h"
#include "ui/gfx/compositor/layer_animation_observer.h"
#include "ui/gfx/insets.h"
#include "ui/gfx/rect.h"
@@ -27,7 +27,7 @@ namespace internal {
// layout to the status area.
// To respond to bounds changes in the status area StatusAreaLayoutManager works
// closely with ShelfLayoutManager.
-class AURA_SHELL_EXPORT ShelfLayoutManager : public aura::LayoutManager,
+class ASH_EXPORT ShelfLayoutManager : public aura::LayoutManager,
public ui::LayerAnimationObserver {
public:
ShelfLayoutManager(views::Widget* launcher, views::Widget* status);
diff --git a/ash/wm/shelf_layout_manager_unittest.cc b/ash/wm/shelf_layout_manager_unittest.cc
index c1daf9a..01239c8 100644
--- a/ash/wm/shelf_layout_manager_unittest.cc
+++ b/ash/wm/shelf_layout_manager_unittest.cc
@@ -5,12 +5,12 @@
#include "ash/wm/shelf_layout_manager.h"
#include "ash/launcher/launcher.h"
+#include "ash/shell.h"
+#include "ash/shell_window_ids.h"
#include "ash/test/aura_shell_test_base.h"
#include "ui/aura/root_window.h"
#include "ui/aura/screen_aura.h"
#include "ui/aura/window.h"
-#include "ui/aura_shell/shell.h"
-#include "ui/aura_shell/shell_window_ids.h"
#include "ui/base/animation/animation_container_element.h"
#include "ui/gfx/compositor/layer_animator.h"
#include "ui/gfx/compositor/layer.h"
diff --git a/ash/wm/stacking_controller.cc b/ash/wm/stacking_controller.cc
index 73b91fe..40d8f84 100644
--- a/ash/wm/stacking_controller.cc
+++ b/ash/wm/stacking_controller.cc
@@ -4,12 +4,12 @@
#include "ash/wm/stacking_controller.h"
+#include "ash/shell.h"
+#include "ash/shell_window_ids.h"
#include "ash/wm/always_on_top_controller.h"
#include "ui/aura/client/aura_constants.h"
#include "ui/aura/root_window.h"
#include "ui/aura/window.h"
-#include "ui/aura_shell/shell.h"
-#include "ui/aura_shell/shell_window_ids.h"
namespace aura_shell {
namespace internal {
diff --git a/ash/wm/toplevel_frame_view.h b/ash/wm/toplevel_frame_view.h
index b76a238..2a304cb 100644
--- a/ash/wm/toplevel_frame_view.h
+++ b/ash/wm/toplevel_frame_view.h
@@ -6,7 +6,7 @@
#define ASH_WM_TOPLEVEL_FRAME_VIEW_H_
#pragma once
-#include "ui/aura_shell/aura_shell_export.h"
+#include "ash/ash_export.h"
#include "ui/views/controls/button/button.h"
#include "ui/views/window/non_client_view.h"
@@ -21,7 +21,7 @@ class WindowCaption;
// TODO(beng): Find a way to automatically this for all top-level windows in
// Aura. Right now windows have to override CreateNonClientFrameView
// on WidgetDelegate to specify this.
-class AURA_SHELL_EXPORT ToplevelFrameView : public views::NonClientFrameView {
+class ASH_EXPORT ToplevelFrameView : public views::NonClientFrameView {
public:
ToplevelFrameView();
virtual ~ToplevelFrameView();
diff --git a/ash/wm/toplevel_layout_manager.h b/ash/wm/toplevel_layout_manager.h
index 7cb45ea..f7138ad 100644
--- a/ash/wm/toplevel_layout_manager.h
+++ b/ash/wm/toplevel_layout_manager.h
@@ -12,7 +12,7 @@
#include "base/compiler_specific.h"
#include "ui/aura/layout_manager.h"
#include "ui/aura/window_observer.h"
-#include "ui/aura_shell/aura_shell_export.h"
+#include "ash/ash_export.h"
namespace aura_shell {
namespace internal {
@@ -23,7 +23,7 @@ class ShelfLayoutManager;
// hosts what the shell considers to be top-level windows. It is used if the
// WorkspaceManager is not enabled. ToplevelLayoutManager listens for changes to
// kShowStateKey and resizes the window appropriately.
-class AURA_SHELL_EXPORT ToplevelLayoutManager : public aura::LayoutManager,
+class ASH_EXPORT ToplevelLayoutManager : public aura::LayoutManager,
public aura::WindowObserver {
public:
ToplevelLayoutManager();
diff --git a/ash/wm/toplevel_window_event_filter.h b/ash/wm/toplevel_window_event_filter.h
index 7eaeef7..1217d1b 100644
--- a/ash/wm/toplevel_window_event_filter.h
+++ b/ash/wm/toplevel_window_event_filter.h
@@ -10,7 +10,7 @@
#include "base/compiler_specific.h"
#include "ui/aura/event_filter.h"
-#include "ui/aura_shell/aura_shell_export.h"
+#include "ash/ash_export.h"
#include "ui/gfx/point.h"
#include "ui/gfx/rect.h"
@@ -22,7 +22,7 @@ class Window;
namespace aura_shell {
-class AURA_SHELL_EXPORT ToplevelWindowEventFilter : public aura::EventFilter {
+class ASH_EXPORT ToplevelWindowEventFilter : public aura::EventFilter {
public:
explicit ToplevelWindowEventFilter(aura::Window* owner);
virtual ~ToplevelWindowEventFilter();
diff --git a/ash/wm/window_frame.h b/ash/wm/window_frame.h
index e9f446f..e359145 100644
--- a/ash/wm/window_frame.h
+++ b/ash/wm/window_frame.h
@@ -6,16 +6,16 @@
#define ASH_WM_WINDOW_FRAME_H_
#pragma once
-#include "ui/aura_shell/aura_shell_export.h"
+#include "ash/ash_export.h"
namespace aura_shell {
// aura::Window property name for a pointer to the WindowFrame interface.
-AURA_SHELL_EXPORT extern const char* const kWindowFrameKey;
+ASH_EXPORT extern const char* const kWindowFrameKey;
// Interface for clients implementing a window frame. Implementors should
// add a pointer to this interface to each aura::Window, using the key above.
-class AURA_SHELL_EXPORT WindowFrame {
+class ASH_EXPORT WindowFrame {
public:
virtual ~WindowFrame() {}
diff --git a/ash/wm/window_util.h b/ash/wm/window_util.h
index 8838d89..bba1c26 100644
--- a/ash/wm/window_util.h
+++ b/ash/wm/window_util.h
@@ -8,7 +8,7 @@
#include <set>
-#include "ui/aura_shell/aura_shell_export.h"
+#include "ash/ash_export.h"
namespace aura {
class Window;
@@ -19,27 +19,27 @@ namespace aura_shell {
// TODO(jamescook): Put all these functions in namespace window_util.
// Returns true if |window| is in the maximized state.
-AURA_SHELL_EXPORT bool IsWindowMaximized(aura::Window* window);
+ASH_EXPORT bool IsWindowMaximized(aura::Window* window);
// Convenience setters/getters for |aura::client::kRootWindowActiveWindow|.
-AURA_SHELL_EXPORT void ActivateWindow(aura::Window* window);
-AURA_SHELL_EXPORT void DeactivateWindow(aura::Window* window);
-AURA_SHELL_EXPORT bool IsActiveWindow(aura::Window* window);
-AURA_SHELL_EXPORT aura::Window* GetActiveWindow();
+ASH_EXPORT void ActivateWindow(aura::Window* window);
+ASH_EXPORT void DeactivateWindow(aura::Window* window);
+ASH_EXPORT bool IsActiveWindow(aura::Window* window);
+ASH_EXPORT aura::Window* GetActiveWindow();
// Retrieves the activatable window for |window|. If |window| is activatable,
// this will just return it, otherwise it will climb the parent/transient parent
// chain looking for a window that is activatable, per the ActivationController.
// If you're looking for a function to get the activatable "top level" window,
// this is probably what you're looking for.
-AURA_SHELL_EXPORT aura::Window* GetActivatableWindow(aura::Window* window);
+ASH_EXPORT aura::Window* GetActivatableWindow(aura::Window* window);
// Update window bounds based on a change in show state.
-AURA_SHELL_EXPORT void UpdateBoundsFromShowState(aura::Window* window);
+ASH_EXPORT void UpdateBoundsFromShowState(aura::Window* window);
// Returns true if the set of |windows| contains a full-screen window.
typedef std::set<aura::Window*> WindowSet;
-AURA_SHELL_EXPORT bool HasFullscreenWindow(const WindowSet& windows);
+ASH_EXPORT bool HasFullscreenWindow(const WindowSet& windows);
} // namespace aura_shell
diff --git a/ash/wm/workspace/workspace.h b/ash/wm/workspace/workspace.h
index 822e677..4256fab 100644
--- a/ash/wm/workspace/workspace.h
+++ b/ash/wm/workspace/workspace.h
@@ -9,7 +9,7 @@
#include "base/basictypes.h"
#include "base/gtest_prod_util.h"
-#include "ui/aura_shell/aura_shell_export.h"
+#include "ash/ash_export.h"
#include "ui/gfx/rect.h"
namespace aura {
@@ -29,7 +29,7 @@ class WorkspaceTest;
// A workspace contains a limited number of windows and the workspace
// manager may create a new workspace if there is not enough room for
// a new window.
-class AURA_SHELL_EXPORT Workspace {
+class ASH_EXPORT Workspace {
public:
explicit Workspace(WorkspaceManager* manager);
virtual ~Workspace();
diff --git a/ash/wm/workspace/workspace_manager.h b/ash/wm/workspace/workspace_manager.h
index 6ad105c..69711c9 100644
--- a/ash/wm/workspace/workspace_manager.h
+++ b/ash/wm/workspace/workspace_manager.h
@@ -10,7 +10,7 @@
#include "base/basictypes.h"
#include "base/compiler_specific.h"
#include "base/observer_list.h"
-#include "ui/aura_shell/aura_shell_export.h"
+#include "ash/ash_export.h"
#include "ui/gfx/insets.h"
#include "ui/gfx/size.h"
@@ -29,7 +29,7 @@ class Workspace;
class WorkspaceObserver;
// WorkspaceManager manages multiple workspaces in the desktop.
-class AURA_SHELL_EXPORT WorkspaceManager {
+class ASH_EXPORT WorkspaceManager {
public:
explicit WorkspaceManager(aura::Window* viewport);
virtual ~WorkspaceManager();
diff --git a/ash/wm/workspace/workspace_manager_unittest.cc b/ash/wm/workspace/workspace_manager_unittest.cc
index 55123a8..92062ca 100644
--- a/ash/wm/workspace/workspace_manager_unittest.cc
+++ b/ash/wm/workspace/workspace_manager_unittest.cc
@@ -4,6 +4,7 @@
#include "ash/wm/workspace/workspace_manager.h"
+#include "ash/shell_window_ids.h"
#include "ash/wm/activation_controller.h"
#include "ash/wm/workspace/workspace.h"
#include "ash/wm/workspace/workspace_observer.h"
@@ -12,7 +13,6 @@
#include "ui/aura/screen_aura.h"
#include "ui/aura/test/aura_test_base.h"
#include "ui/aura/window.h"
-#include "ui/aura_shell/shell_window_ids.h"
#include "ui/base/ui_base_types.h"
namespace {
diff --git a/ash/wm/workspace/workspace_observer.h b/ash/wm/workspace/workspace_observer.h
index eb993b8..45439e3 100644
--- a/ash/wm/workspace/workspace_observer.h
+++ b/ash/wm/workspace/workspace_observer.h
@@ -6,7 +6,7 @@
#define ASH_WM_WORKSPACE_WORKSPACE_OBSERVER_H_
#pragma once
-#include "ui/aura_shell/aura_shell_export.h"
+#include "ash/ash_export.h"
namespace aura {
class Window;
@@ -18,7 +18,7 @@ class Workspace;
class WorkspaceManager;
// A class to observe changes in workspace state.
-class AURA_SHELL_EXPORT WorkspaceObserver {
+class ASH_EXPORT WorkspaceObserver {
public:
// Invoked when |start| window is moved and inserted
// at the |target| window's position by |WorkspaceManager::RotateWindow|.
diff --git a/ash/wm/workspace_controller.cc b/ash/wm/workspace_controller.cc
index c21383a..9faafd8 100644
--- a/ash/wm/workspace_controller.cc
+++ b/ash/wm/workspace_controller.cc
@@ -6,6 +6,7 @@
#include "ash/launcher/launcher.h"
#include "ash/launcher/launcher_model.h"
+#include "ash/shell.h"
#include "ash/wm/default_container_layout_manager.h"
#include "ash/wm/window_util.h"
#include "ash/wm/workspace/workspace.h"
@@ -14,7 +15,6 @@
#include "ui/aura/client/aura_constants.h"
#include "ui/aura/root_window.h"
#include "ui/aura/window.h"
-#include "ui/aura_shell/shell.h"
namespace aura_shell {
namespace internal {
diff --git a/ash/wm/workspace_controller.h b/ash/wm/workspace_controller.h
index a244e3e..771f5b9 100644
--- a/ash/wm/workspace_controller.h
+++ b/ash/wm/workspace_controller.h
@@ -12,7 +12,7 @@
#include "base/memory/scoped_ptr.h"
#include "ui/aura/root_window_observer.h"
#include "ui/aura/window_observer.h"
-#include "ui/aura_shell/aura_shell_export.h"
+#include "ash/ash_export.h"
namespace aura {
class Window;
@@ -32,7 +32,7 @@ class WorkspaceManager;
// WorkspaceControlls owns a WorkspaceManager. WorkspaceControlls bridges
// events From RootWindowObserver translating them to WorkspaceManager, and
// a move event between Laucher and Workspace.
-class AURA_SHELL_EXPORT WorkspaceController :
+class ASH_EXPORT WorkspaceController :
public aura::RootWindowObserver,
public aura::WindowObserver,
public aura_shell::internal::WorkspaceObserver,
diff --git a/ash/wm/workspace_controller_unittest.cc b/ash/wm/workspace_controller_unittest.cc
index 023368e..e470a0f 100644
--- a/ash/wm/workspace_controller_unittest.cc
+++ b/ash/wm/workspace_controller_unittest.cc
@@ -4,6 +4,7 @@
#include "ash/wm/workspace_controller.h"
+#include "ash/shell_window_ids.h"
#include "ash/wm/activation_controller.h"
#include "ash/wm/window_util.h"
#include "ash/wm/workspace/workspace.h"
@@ -11,7 +12,6 @@
#include "ui/aura/test/aura_test_base.h"
#include "ui/aura/root_window.h"
#include "ui/aura/window.h"
-#include "ui/aura_shell/shell_window_ids.h"
namespace aura_shell {
namespace internal {