diff options
author | jamescook@chromium.org <jamescook@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-01-06 23:04:04 +0000 |
---|---|---|
committer | jamescook@chromium.org <jamescook@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-01-06 23:04:04 +0000 |
commit | fcd36fc95d953e44731164b0568e87bf472aa4de (patch) | |
tree | 2b05eea0a4639bd0655f4e85681f395b72fe2673 /ash | |
parent | f7594480318ce9cc618a6311fdbec521ec3899f7 (diff) | |
download | chromium_src-fcd36fc95d953e44731164b0568e87bf472aa4de.zip chromium_src-fcd36fc95d953e44731164b0568e87bf472aa4de.tar.gz chromium_src-fcd36fc95d953e44731164b0568e87bf472aa4de.tar.bz2 |
Aura: Fix Alt-Tab in compact window mode
We weren't creating the launcher in compact window mode, but for Alt-Tab to work we need access to its window list and data model. Instead, create the launcher and just hide its widget. This allows us to avoid NULL checks and make compact mode less likely to break in the future.
BUG=109213
TEST=Run Aura in compact window mode. Open several windows. Hit alt-tab to cycle through them.
Review URL: http://codereview.chromium.org/8983032
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@116762 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ash')
-rw-r--r-- | ash/launcher/launcher.cc | 4 | ||||
-rw-r--r-- | ash/launcher/launcher.h | 5 | ||||
-rw-r--r-- | ash/shell.cc | 8 | ||||
-rw-r--r-- | ash/shell.h | 1 |
4 files changed, 10 insertions, 8 deletions
diff --git a/ash/launcher/launcher.cc b/ash/launcher/launcher.cc index 68130dc..d6b40aa 100644 --- a/ash/launcher/launcher.cc +++ b/ash/launcher/launcher.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -157,7 +157,7 @@ void Launcher::OnWindowAdded(aura::Window* new_window) { known_windows_[new_window] = false; new_window->AddObserver(this); // Windows are created initially invisible. Wait until the window is made - // visible before asking, as othewise the delegate likely doesn't know about + // visible before asking, as otherwise the delegate likely doesn't know about // window (it's still creating it). if (new_window->IsVisible()) MaybeAdd(new_window); diff --git a/ash/launcher/launcher.h b/ash/launcher/launcher.h index 9b31274..069b513 100644 --- a/ash/launcher/launcher.h +++ b/ash/launcher/launcher.h @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -54,7 +54,8 @@ class ASH_EXPORT Launcher : public aura::WindowObserver { scoped_ptr<LauncherModel> model_; - // Widget hosting the view. + // Widget hosting the view. May be hidden if we're not using a launcher, + // e.g. Aura compact window mode. views::Widget* widget_; aura::Window* window_container_; diff --git a/ash/shell.cc b/ash/shell.cc index 404f0138..7c7ad6b 100644 --- a/ash/shell.cc +++ b/ash/shell.cc @@ -280,9 +280,11 @@ void Shell::InitLayoutManagers(aura::RootWindow* root_window) { aura::Window* default_container = GetContainer(internal::kShellWindowId_DefaultContainer); + launcher_.reset(new Launcher(default_container)); - // Compact mode has a simplified layout manager and doesn't use the launcher, - // desktop background, shelf, etc. + // Compact mode has a simplified layout manager and doesn't use the shelf, + // desktop background, etc. The launcher still exists so we can use its + // data model and list of open windows, but we hide the UI to save space. if (IsWindowModeCompact()) { default_container->SetLayoutManager( new internal::CompactLayoutManager(status_widget)); @@ -290,12 +292,12 @@ void Shell::InitLayoutManagers(aura::RootWindow* root_window) { new internal::CompactStatusAreaLayoutManager(status_widget); GetContainer(internal::kShellWindowId_StatusContainer)-> SetLayoutManager(status_area_layout_manager); + launcher_->widget()->Hide(); 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); diff --git a/ash/shell.h b/ash/shell.h index 3881712..05a0afa 100644 --- a/ash/shell.h +++ b/ash/shell.h @@ -95,7 +95,6 @@ class ASH_EXPORT Shell { 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. |