diff options
author | oshima@chromium.org <oshima@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-10-12 18:42:28 +0000 |
---|---|---|
committer | oshima@chromium.org <oshima@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-10-12 18:42:28 +0000 |
commit | e74aaf0a48777b12034c1ececef2524657c82c44 (patch) | |
tree | 13d41592b4ba35a26fdacf7545c2b37cd0f2e4cb /ash | |
parent | 65fe8465f1e5a95645c13edcc24cd5c8992b0bf3 (diff) | |
download | chromium_src-e74aaf0a48777b12034c1ececef2524657c82c44.zip chromium_src-e74aaf0a48777b12034c1ececef2524657c82c44.tar.gz chromium_src-e74aaf0a48777b12034c1ececef2524657c82c44.tar.bz2 |
Move shelf/launcher/status_area_widget/panel_layout_manager to RootWindowController
This is just preparation to create launchers on all displays.
BUG=145978
TEST=none
Review URL: https://chromiumcodereview.appspot.com/11093050
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@161621 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ash')
-rw-r--r-- | ash/ash_switches.cc | 3 | ||||
-rw-r--r-- | ash/ash_switches.h | 1 | ||||
-rw-r--r-- | ash/display/display_controller.cc | 2 | ||||
-rw-r--r-- | ash/root_window_controller.cc | 126 | ||||
-rw-r--r-- | ash/root_window_controller.h | 62 | ||||
-rw-r--r-- | ash/shell.cc | 128 | ||||
-rw-r--r-- | ash/shell.h | 26 |
7 files changed, 222 insertions, 126 deletions
diff --git a/ash/ash_switches.cc b/ash/ash_switches.cc index 4fd6389..a61dab2 100644 --- a/ash/ash_switches.cc +++ b/ash/ash_switches.cc @@ -34,6 +34,9 @@ const char kAshEnableOak[] = "ash-enable-oak"; // Enables showing the tray bubble by dragging on the shelf. const char kAshEnableTrayDragging[] = "ash-enable-tray-dragging"; +// Enables creating a launcher per display. +const char kAshLauncherPerDisplay[] = "ash-launcher-per-display"; + // Specifies the layout mode and offsets for the secondary display for // testing. The format is "<t|r|b|l>,<offset>" where t=TOP, r=RIGHT, // b=BOTTOM and L=LEFT. For example, 'r,-100' means the secondary display diff --git a/ash/ash_switches.h b/ash/ash_switches.h index bca954c..c64af22 100644 --- a/ash/ash_switches.h +++ b/ash/ash_switches.h @@ -24,6 +24,7 @@ ASH_EXPORT extern const char kAshDisableBootAnimation2[]; ASH_EXPORT extern const char kAshEnableAdvancedGestures[]; ASH_EXPORT extern const char kAshEnableOak[]; ASH_EXPORT extern const char kAshEnableTrayDragging[]; +ASH_EXPORT extern const char kAshLauncherPerDisplay[]; ASH_EXPORT extern const char kAshSecondaryDisplayLayout[]; ASH_EXPORT extern const char kAshTouchHud[]; ASH_EXPORT extern const char kAshWindowAnimationsDisabled[]; diff --git a/ash/display/display_controller.cc b/ash/display/display_controller.cc index b12b4f2..660841f 100644 --- a/ash/display/display_controller.cc +++ b/ash/display/display_controller.cc @@ -469,7 +469,7 @@ void DisplayController::OnDisplayRemoved(const gfx::Display& display) { DCHECK(controller); controller->MoveWindowsTo(GetPrimaryRootWindow()); // Delete most of root window related objects, but don't delete - // root window itself yet because the stak may be using it. + // root window itself yet because the stack may be using it. controller->Shutdown(); MessageLoop::current()->DeleteSoon(FROM_HERE, controller); } diff --git a/ash/root_window_controller.cc b/ash/root_window_controller.cc index 9ea9344..b6e9919 100644 --- a/ash/root_window_controller.cc +++ b/ash/root_window_controller.cc @@ -9,13 +9,21 @@ #include "ash/desktop_background/desktop_background_widget_controller.h" #include "ash/display/display_controller.h" #include "ash/display/multi_display_manager.h" +#include "ash/focus_cycler.h" #include "ash/shell.h" +#include "ash/shell_delegate.h" #include "ash/shell_factory.h" #include "ash/shell_window_ids.h" +#include "ash/system/status_area_widget.h" #include "ash/wm/base_layout_manager.h" +#include "ash/wm/panel_layout_manager.h" +#include "ash/wm/panel_window_event_filter.h" #include "ash/wm/property_util.h" #include "ash/wm/root_window_layout_manager.h" #include "ash/wm/screen_dimmer.h" +#include "ash/wm/shelf_layout_manager.h" +#include "ash/wm/shelf_types.h" +#include "ash/wm/status_area_layout_manager.h" #include "ash/wm/system_modal_container_layout_manager.h" #include "ash/wm/toplevel_window_event_handler.h" #include "ash/wm/visibility_controller.h" @@ -141,7 +149,11 @@ void SetUsesScreenCoordinates(aura::Window* container) { namespace internal { RootWindowController::RootWindowController(aura::RootWindow* root_window) - : root_window_(root_window) { + : root_window_(root_window), + root_window_layout_(NULL), + status_area_widget_(NULL), + shelf_(NULL), + panel_layout_manager_(NULL) { SetRootWindowController(root_window, this); screen_dimmer_.reset(new ScreenDimmer(root_window)); } @@ -166,6 +178,13 @@ void RootWindowController::Shutdown() { root_window_->ClearProperty(kDisplayIdKey); // And this root window should no longer process events. root_window_->PrepareForShutdown(); + + // Launcher widget has an InputMethodBridge that references to + // |input_method_filter_|'s |input_method_|. So explicitly release + // |launcher_| before |input_method_filter_|. And this needs to be + // after we delete all containers in case there are still live + // browser windows which access LauncherModel during close. + launcher_.reset(); } SystemModalContainerLayoutManager* @@ -196,6 +215,49 @@ void RootWindowController::InitLayoutManagers() { always_on_top_container->GetRootWindow())); } +void RootWindowController::InitForPrimaryDisplay() { + DCHECK(!status_area_widget_); + ShellDelegate* delegate = Shell::GetInstance()->delegate(); + + // Initialize Primary RootWindow specific items. + status_area_widget_ = new internal::StatusAreaWidget(); + status_area_widget_->CreateTrayViews(delegate); + // Login screen manages status area visibility by itself. + if (delegate && delegate->IsSessionStarted()) + status_area_widget_->Show(); + + Shell::GetInstance()->focus_cycler()->AddWidget(status_area_widget_); + + internal::ShelfLayoutManager* shelf_layout_manager = + new internal::ShelfLayoutManager(status_area_widget_); + GetContainer(internal::kShellWindowId_LauncherContainer)-> + SetLayoutManager(shelf_layout_manager); + shelf_ = shelf_layout_manager; + + internal::StatusAreaLayoutManager* status_area_layout_manager = + new internal::StatusAreaLayoutManager(shelf_layout_manager); + GetContainer(internal::kShellWindowId_StatusContainer)-> + SetLayoutManager(status_area_layout_manager); + + shelf_layout_manager->set_workspace_controller( + workspace_controller()); + + workspace_controller()->SetShelf(shelf_); + + // Create Panel layout manager + aura::Window* panel_container = GetContainer( + internal::kShellWindowId_PanelContainer); + panel_layout_manager_ = + new internal::PanelLayoutManager(panel_container); + panel_container->SetEventFilter( + new internal::PanelWindowEventFilter( + panel_container, panel_layout_manager_)); + panel_container->SetLayoutManager(panel_layout_manager_); + + if (!delegate || delegate->IsUserLoggedIn()) + CreateLauncher(); +} + void RootWindowController::CreateContainers() { CreateContainersInRootWindow(root_window_.get()); } @@ -214,12 +276,46 @@ void RootWindowController::CreateSystemBackground( background_->GetWidget()->Show(); } +void RootWindowController::CreateLauncher() { + if (launcher_.get()) + return; + + aura::Window* default_container = + GetContainer(internal::kShellWindowId_DefaultContainer); + launcher_.reset(new Launcher(default_container, shelf_)); + + launcher_->SetFocusCycler(Shell::GetInstance()->focus_cycler()); + shelf_->SetLauncher(launcher_.get()); + + if (panel_layout_manager_) + panel_layout_manager_->SetLauncher(launcher_.get()); + + ShellDelegate* delegate = Shell::GetInstance()->delegate(); + if (delegate) + launcher_->SetVisible(delegate->IsSessionStarted()); + launcher_->widget()->Show(); +} + +void RootWindowController::ShowLauncher() { + if (!launcher_.get()) + return; + launcher_->SetVisible(true); +} + void RootWindowController::HandleDesktopBackgroundVisible() { if (background_.get()) background_->SetColor(SK_ColorBLACK); } void RootWindowController::CloseChildWindows() { + // The status area needs to be shut down before the windows are destroyed. + if (status_area_widget_) + status_area_widget_->Shutdown(); + + // Closing the windows frees the workspace controller. + if (shelf_) + shelf_->set_workspace_controller(NULL); + // Close background widget first as it depends on tooltip. root_window_->SetProperty(kDesktopController, static_cast<DesktopBackgroundWidgetController*>(NULL)); @@ -233,6 +329,13 @@ void RootWindowController::CloseChildWindows() { aura::Window* child = root_window_->children()[0]; delete child; } + // TODO(oshima): Closing window triggers access to status area widget + // in ShelfLayoutManager. We probably should disalb/remove shelf layout + // manager before destorying windows? + status_area_widget_ = NULL; + + // All containers are deleted, so reset shelf_. + shelf_ = NULL; } bool RootWindowController::IsInMaximizedMode() const { @@ -270,6 +373,27 @@ void RootWindowController::MoveWindowsTo(aura::RootWindow* dst) { } } +void RootWindowController::UpdateShelfVisibility() { + shelf_->UpdateVisibilityState(); +} + +void RootWindowController::SetShelfAutoHideBehavior( + ShelfAutoHideBehavior behavior) { + shelf_->SetAutoHideBehavior(behavior); +} + +ShelfAutoHideBehavior RootWindowController::GetShelfAutoHideBehavior() const { + return shelf_->auto_hide_behavior(); +} + +bool RootWindowController::SetShelfAlignment(ShelfAlignment alignment) { + return shelf_->SetAlignment(alignment); +} + +ShelfAlignment RootWindowController::GetShelfAlignment() { + return shelf_->alignment(); +} + //////////////////////////////////////////////////////////////////////////////// // RootWindowController, private: diff --git a/ash/root_window_controller.h b/ash/root_window_controller.h index f1a0926..70e2e6b 100644 --- a/ash/root_window_controller.h +++ b/ash/root_window_controller.h @@ -6,6 +6,7 @@ #define ASH_ROOT_WINDOW_CONTROLLER_H_ #include "ash/ash_export.h" +#include "ash/wm/shelf_types.h" #include "base/basictypes.h" #include "base/memory/scoped_ptr.h" @@ -22,12 +23,18 @@ class RootWindowEventFilter; } // namespace aura namespace ash { +class Launcher; class ToplevelWindowEventHandler; + namespace internal { class ColoredWindowController; +class PanelLayoutManager; class RootWindowLayoutManager; class ScreenDimmer; +class ShelfLayoutManager; +class StatusAreaWidget; +class SystemBackgroundController; class SystemModalContainerLayoutManager; class WorkspaceController; @@ -41,20 +48,23 @@ class ASH_EXPORT RootWindowController { explicit RootWindowController(aura::RootWindow* root_window); ~RootWindowController(); - aura::RootWindow* root_window() { - return root_window_.get(); - } + aura::RootWindow* root_window() { return root_window_.get(); } - RootWindowLayoutManager* root_window_layout() { - return root_window_layout_; - } + RootWindowLayoutManager* root_window_layout() { return root_window_layout_; } WorkspaceController* workspace_controller() { return workspace_controller_.get(); } - ScreenDimmer* screen_dimmer() { - return screen_dimmer_.get(); + ScreenDimmer* screen_dimmer() { return screen_dimmer_.get(); } + + Launcher* launcher() { return launcher_.get(); } + + // TODO(sky): don't expose this! + internal::ShelfLayoutManager* shelf() const { return shelf_; } + + internal::StatusAreaWidget* status_area_widget() const { + return status_area_widget_; } SystemModalContainerLayoutManager* GetSystemModalLayoutManager(); @@ -64,10 +74,20 @@ class ASH_EXPORT RootWindowController { void InitLayoutManagers(); void CreateContainers(); + // Initializs the RootWindowController for primary display. This + // creates + void InitForPrimaryDisplay(); + // Initializes |background_|. |is_first_run_after_boot| determines the // background's initial color. void CreateSystemBackground(bool is_first_run_after_boot); + // Initializes |launcher_|. Does nothing if it's already initialized. + void CreateLauncher(); + + // Show launcher view if it was created hidden (before session has started). + void ShowLauncher(); + // Updates |background_| to be black after the desktop background is visible. void HandleDesktopBackgroundVisible(); @@ -86,7 +106,18 @@ class ASH_EXPORT RootWindowController { // Moves child windows to |dest|. void MoveWindowsTo(aura::RootWindow* dest); - private: + // Force the shelf to query for it's current visibility state. + void UpdateShelfVisibility(); + + // Sets/gets the shelf auto-hide behavior. + void SetShelfAutoHideBehavior(ShelfAutoHideBehavior behavior); + ShelfAutoHideBehavior GetShelfAutoHideBehavior() const; + + // Sets/gets the shelf alignemnt. + bool SetShelfAlignment(ShelfAlignment alignment); + ShelfAlignment GetShelfAlignment(); + +private: // Creates each of the special window containers that holds windows of various // types in the shell UI. void CreateContainersInRootWindow(aura::RootWindow* root_window); @@ -94,6 +125,19 @@ class ASH_EXPORT RootWindowController { scoped_ptr<aura::RootWindow> root_window_; RootWindowLayoutManager* root_window_layout_; + // Widget containing system tray. + internal::StatusAreaWidget* status_area_widget_; + + // The shelf for managing the launcher and the status widget. + // RootWindowController does not own the shelf. Instead, it is owned + // by container of the status area. + internal::ShelfLayoutManager* shelf_; + + // Manages layout of panels. Owned by PanelContainer. + internal::PanelLayoutManager* panel_layout_manager_; + + scoped_ptr<Launcher> launcher_; + // A background layer that's displayed beneath all other layers. Without // this, portions of the root window that aren't covered by layers will be // painted white; this can show up if e.g. it takes a long time to decode the diff --git a/ash/shell.cc b/ash/shell.cc index 95b6f9d..d1cfb73 100644 --- a/ash/shell.cc +++ b/ash/shell.cc @@ -29,7 +29,6 @@ #include "ash/shell_factory.h" #include "ash/shell_window_ids.h" #include "ash/system/status_area_widget.h" -#include "ash/system/tray/system_tray.h" #include "ash/tooltips/tooltip_controller.h" #include "ash/touch/touch_observer_hud.h" #include "ash/wm/activation_controller.h" @@ -42,17 +41,13 @@ #include "ash/wm/event_client_impl.h" #include "ash/wm/event_rewriter_event_filter.h" #include "ash/wm/overlay_event_filter.h" -#include "ash/wm/panel_layout_manager.h" -#include "ash/wm/panel_window_event_filter.h" #include "ash/wm/power_button_controller.h" #include "ash/wm/property_util.h" #include "ash/wm/resize_shadow_controller.h" #include "ash/wm/root_window_layout_manager.h" #include "ash/wm/screen_dimmer.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/system_gesture_event_filter.h" #include "ash/wm/system_modal_container_event_filter.h" #include "ash/wm/system_modal_container_layout_manager.h" @@ -189,9 +184,6 @@ Shell::Shell(ShellDelegate* delegate) output_configurator_animation_( new internal::OutputConfiguratorAnimation()), #endif // defined(OS_CHROMEOS) - shelf_(NULL), - panel_layout_manager_(NULL), - status_area_widget_(NULL), browser_context_(NULL) { gfx::Screen::SetInstance(screen_); ui_controls::InstallUIControlsAura(internal::CreateUIControls()); @@ -231,18 +223,12 @@ Shell::~Shell() { // TooltipController is deleted with the Shell so removing its references. RemoveEnvEventFilter(tooltip_controller_.get()); - // The status area needs to be shut down before the windows are destroyed. - status_area_widget_->Shutdown(); - // AppList needs to be released before shelf layout manager, which is // destroyed with launcher container in the loop below. However, app list // container is now on top of launcher container and released after it. // TODO(xiyuan): Move it back when app list container is no longer needed. app_list_controller_.reset(); - - // Closing the windows frees the workspace controller. - shelf_->set_workspace_controller(NULL); // Destroy all child windows including widgets. display_controller_->CloseChildWindows(); @@ -266,13 +252,6 @@ Shell::~Shell() { display_controller_.reset(); screen_position_controller_.reset(); - // Launcher widget has a InputMethodBridge that references to - // input_method_filter_'s input_method_. So explicitly release launcher_ - // before input_method_filter_. And this needs to be after we delete all - // containers in case there are still live browser windows which access - // LauncherModel during close. - launcher_.reset(); - // Delete the activation controller after other controllers and launcher // because they might have registered ActivationChangeObserver. activation_controller_.reset(); @@ -362,6 +341,12 @@ std::vector<aura::Window*> Shell::GetAllContainers(int container_id) { return containers; } +// static +bool Shell::IsLauncherPerDisplayEnabled() { + CommandLine* command_line = CommandLine::ForCurrentProcess(); + return command_line->HasSwitch(switches::kAshLauncherPerDisplay); +} + void Shell::Init() { // Install the custom factory first so that views::FocusManagers for Tray, // Launcher, and WallPaper could be created by the factory. @@ -376,6 +361,8 @@ void Shell::Init() { activation_controller_.reset( new internal::ActivationController(focus_manager_.get())); + focus_cycler_.reset(new internal::FocusCycler()); + screen_position_controller_.reset(new internal::ScreenPositionController); display_controller_.reset(new DisplayController); display_controller_->InitPrimaryDisplay(); @@ -473,25 +460,12 @@ void Shell::Init() { else caps_lock_delegate_.reset(new CapsLockDelegateStub); - // Initialize Primary RootWindow specific items. - status_area_widget_ = new internal::StatusAreaWidget(); - status_area_widget_->CreateTrayViews(delegate_.get()); - // Login screen manages status area visibility by itself. - if (delegate_.get() && delegate_->IsSessionStarted()) - status_area_widget_->Show(); - - focus_cycler_.reset(new internal::FocusCycler()); - focus_cycler_->AddWidget(status_area_widget_); - - InitLayoutManagersForPrimaryDisplay(root_window_controller); - if (!command_line->HasSwitch(switches::kAuraNoShadows)) { resize_shadow_controller_.reset(new internal::ResizeShadowController()); shadow_controller_.reset(new internal::ShadowController()); } - if (!delegate_.get() || delegate_->IsUserLoggedIn()) - CreateLauncher(); + root_window_controller->InitForPrimaryDisplay(); // Force Layout root_window_controller->root_window_layout()->OnWindowResized(); @@ -602,28 +576,11 @@ void Shell::OnLockStateChanged(bool locked) { } void Shell::CreateLauncher() { - if (launcher_.get()) - return; - - aura::Window* default_container = - GetPrimaryRootWindowController()-> - GetContainer(internal::kShellWindowId_DefaultContainer); - launcher_.reset(new Launcher(default_container, shelf_)); - - launcher_->SetFocusCycler(focus_cycler_.get()); - shelf_->SetLauncher(launcher_.get()); - if (panel_layout_manager_) - panel_layout_manager_->SetLauncher(launcher_.get()); - - if (delegate()) - launcher_->SetVisible(delegate()->IsSessionStarted()); - launcher_->widget()->Show(); + GetPrimaryRootWindowController()->CreateLauncher(); } void Shell::ShowLauncher() { - if (!launcher_.get()) - return; - launcher_->SetVisible(true); + GetPrimaryRootWindowController()->ShowLauncher(); } void Shell::AddShellObserver(ShellObserver* observer) { @@ -634,26 +591,30 @@ void Shell::RemoveShellObserver(ShellObserver* observer) { observers_.RemoveObserver(observer); } +Launcher* Shell::launcher() { + return GetPrimaryRootWindowController()->launcher(); +} + void Shell::UpdateShelfVisibility() { - shelf_->UpdateVisibilityState(); + GetPrimaryRootWindowController()->UpdateShelfVisibility(); } void Shell::SetShelfAutoHideBehavior(ShelfAutoHideBehavior behavior) { - shelf_->SetAutoHideBehavior(behavior); + GetPrimaryRootWindowController()->SetShelfAutoHideBehavior(behavior); } ShelfAutoHideBehavior Shell::GetShelfAutoHideBehavior() const { - return shelf_->auto_hide_behavior(); + return GetPrimaryRootWindowController()->GetShelfAutoHideBehavior(); } void Shell::SetShelfAlignment(ShelfAlignment alignment) { - if (!shelf_->SetAlignment(alignment)) - return; - FOR_EACH_OBSERVER(ShellObserver, observers_, OnShelfAlignmentChanged()); + if (GetPrimaryRootWindowController()->SetShelfAlignment(alignment)) { + FOR_EACH_OBSERVER(ShellObserver, observers_, OnShelfAlignmentChanged()); + } } ShelfAlignment Shell::GetShelfAlignment() { - return shelf_->alignment(); + return GetPrimaryRootWindowController()->GetShelfAlignment(); } void Shell::SetDimming(bool should_dim) { @@ -691,12 +652,20 @@ void Shell::OnModalWindowRemoved(aura::Window* removed) { } } +internal::ShelfLayoutManager* Shell::shelf() const { + return GetPrimaryRootWindowController()->shelf(); +} + +internal::StatusAreaWidget* Shell::status_area_widget() const { + return GetPrimaryRootWindowController()->status_area_widget(); +} + SystemTrayDelegate* Shell::tray_delegate() { - return status_area_widget_->system_tray_delegate(); + return status_area_widget()->system_tray_delegate(); } SystemTray* Shell::system_tray() { - return status_area_widget_->system_tray(); + return status_area_widget()->system_tray(); } void Shell::InitRootWindowForSecondaryDisplay(aura::RootWindow* root) { @@ -769,39 +738,6 @@ void Shell::InitRootWindowController( //////////////////////////////////////////////////////////////////////////////// // Shell, private: -void Shell::InitLayoutManagersForPrimaryDisplay( - internal::RootWindowController* controller) { - DCHECK(status_area_widget_); - - internal::ShelfLayoutManager* shelf_layout_manager = - new internal::ShelfLayoutManager(status_area_widget_); - controller->GetContainer(internal::kShellWindowId_LauncherContainer)-> - SetLayoutManager(shelf_layout_manager); - shelf_ = shelf_layout_manager; - - internal::StatusAreaLayoutManager* status_area_layout_manager = - new internal::StatusAreaLayoutManager(shelf_layout_manager); - controller->GetContainer(internal::kShellWindowId_StatusContainer)-> - SetLayoutManager(status_area_layout_manager); - - shelf_layout_manager->set_workspace_controller( - controller->workspace_controller()); - - // TODO(oshima): Support multiple displays. - controller->workspace_controller()->SetShelf(shelf()); - - // Create Panel layout manager - aura::Window* panel_container = GetContainer( - GetPrimaryRootWindow(), - internal::kShellWindowId_PanelContainer); - panel_layout_manager_ = - new internal::PanelLayoutManager(panel_container); - panel_container->SetEventFilter( - new internal::PanelWindowEventFilter( - panel_container, panel_layout_manager_)); - panel_container->SetLayoutManager(panel_layout_manager_); -} - void Shell::SetCursor(gfx::NativeCursor cursor) { RootWindowList root_windows = GetAllRootWindows(); for (RootWindowList::iterator iter = root_windows.begin(); diff --git a/ash/shell.h b/ash/shell.h index a7365d8..5200854 100644 --- a/ash/shell.h +++ b/ash/shell.h @@ -90,7 +90,6 @@ class MagnificationController; class MouseCursorEventFilter; class OutputConfiguratorAnimation; class OverlayEventFilter; -class PanelLayoutManager; class ResizeShadowController; class RootWindowController; class RootWindowLayoutManager; @@ -182,6 +181,9 @@ class ASH_EXPORT Shell : CursorDelegate, // all root windows. static std::vector<aura::Window*> GetAllContainers(int container_id); + // True if "launcher per display" feature is enabled. + static bool IsLauncherPerDisplayEnabled(); + void set_active_root_window(aura::RootWindow* active_root_window) { active_root_window_ = active_root_window; } @@ -307,7 +309,8 @@ class ASH_EXPORT Shell : CursorDelegate, return magnification_controller_.get(); } - Launcher* launcher() { return launcher_.get(); } + // TODO(oshima): Remove methods that are moved to RootWindowController. + Launcher* launcher(); const ScreenAsh* screen() { return screen_; } @@ -334,11 +337,9 @@ class ASH_EXPORT Shell : CursorDelegate, void OnModalWindowRemoved(aura::Window* removed); // TODO(sky): don't expose this! - internal::ShelfLayoutManager* shelf() const { return shelf_; } + internal::ShelfLayoutManager* shelf() const; - internal::StatusAreaWidget* status_area_widget() const { - return status_area_widget_; - } + internal::StatusAreaWidget* status_area_widget() const; // Convenience accessor for members of StatusAreaWidget. SystemTrayDelegate* tray_delegate(); @@ -432,8 +433,6 @@ class ASH_EXPORT Shell : CursorDelegate, scoped_ptr<UserWallpaperDelegate> user_wallpaper_delegate_; scoped_ptr<CapsLockDelegate> caps_lock_delegate_; - scoped_ptr<Launcher> launcher_; - scoped_ptr<internal::AppListController> app_list_controller_; scoped_ptr<internal::StackingController> stacking_controller_; @@ -492,19 +491,8 @@ class ASH_EXPORT Shell : CursorDelegate, CursorManager cursor_manager_; - // The shelf for managing the launcher and the status widget in non-compact - // mode. Shell does not own the shelf. Instead, it is owned by container of - // the status area. - internal::ShelfLayoutManager* shelf_; - - // Manages layout of panels. Owned by PanelContainer. - internal::PanelLayoutManager* panel_layout_manager_; - ObserverList<ShellObserver> observers_; - // Widget containing system tray. - internal::StatusAreaWidget* status_area_widget_; - // Used by ash/shell. content::BrowserContext* browser_context_; |