diff options
author | mukai <mukai@chromium.org> | 2015-07-15 13:47:30 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-07-15 20:48:06 +0000 |
commit | 3feb0502b15d88fd25740918fae497f30044c321 (patch) | |
tree | 672895debfad6d9f37a47cfe42fc082d91a66288 | |
parent | 842cf8bf97c8c12b64c5c189e2f0781a3330aba8 (diff) | |
download | chromium_src-3feb0502b15d88fd25740918fae497f30044c321.zip chromium_src-3feb0502b15d88fd25740918fae497f30044c321.tar.gz chromium_src-3feb0502b15d88fd25740918fae497f30044c321.tar.bz2 |
Dismiss the fullscreen app-list on entering/exiting touch view mode.
BUG=510062
TEST=manually
R=tdanderson@chromium.org, pkotwicz@chromium.org
Review URL: https://codereview.chromium.org/1234123002
Cr-Commit-Position: refs/heads/master@{#338910}
-rw-r--r-- | ash/wm/app_list_controller.cc | 39 | ||||
-rw-r--r-- | ash/wm/app_list_controller.h | 2 |
2 files changed, 32 insertions, 9 deletions
diff --git a/ash/wm/app_list_controller.cc b/ash/wm/app_list_controller.cc index 4dbd3af..e4fdb79 100644 --- a/ash/wm/app_list_controller.cc +++ b/ash/wm/app_list_controller.cc @@ -148,6 +148,16 @@ int GetMinimumBoundsHeightForAppList(const app_list::AppListView* app_list) { return app_list->bounds().height() + 2 * kMinimalCenteredAppListMargin; } +bool IsFullscreenAppListEnabled() { +#if defined(OS_CHROMEOS) + return base::CommandLine::ForCurrentProcess()->HasSwitch( + switches::kAshEnableFullscreenAppList) && + app_list::switches::IsExperimentalAppListEnabled(); +#else + return false; +#endif +} + } // namespace //////////////////////////////////////////////////////////////////////////////// @@ -198,15 +208,10 @@ void AppListController::Show(aura::Window* window) { views::View* applist_button = Shelf::ForWindow(container)->GetAppListButtonView(); is_centered_ = view->ShouldCenterWindow(); - bool is_fullscreen = false; -#if defined(OS_CHROMEOS) - is_fullscreen = base::CommandLine::ForCurrentProcess()->HasSwitch( - switches::kAshEnableFullscreenAppList) && - app_list::switches::IsExperimentalAppListEnabled() && - Shell::GetInstance() - ->maximize_mode_controller() - ->IsMaximizeModeWindowManagerEnabled(); -#endif + bool is_fullscreen = IsFullscreenAppListEnabled() && + Shell::GetInstance() + ->maximize_mode_controller() + ->IsMaximizeModeWindowManagerEnabled(); if (is_fullscreen) { view->InitAsFramelessWindow( container, current_apps_page_, @@ -478,6 +483,22 @@ void AppListController::OnShelfAlignmentChanged(aura::Window* root_window) { view_->SetBubbleArrow(GetBubbleArrow(view_->GetWidget()->GetNativeView())); } +void AppListController::OnMaximizeModeStarted() { + // The "fullscreen" app-list is initialized as in a different type of window, + // therefore we can't switch between the fullscreen status and the normal + // app-list bubble. App-list should be dismissed for the transition between + // maximize mode (touch-view mode) and non-maximize mode, otherwise the app + // list tries to behave as a bubble which leads to a crash. crbug.com/510062 + if (IsFullscreenAppListEnabled() && is_visible_) + Dismiss(); +} + +void AppListController::OnMaximizeModeEnded() { + // See the comments of OnMaximizeModeStarted(). + if (IsFullscreenAppListEnabled() && is_visible_) + Dismiss(); +} + //////////////////////////////////////////////////////////////////////////////// // AppListController, ShelfIconObserver implementation: diff --git a/ash/wm/app_list_controller.h b/ash/wm/app_list_controller.h index ca1160cc..2226ba4 100644 --- a/ash/wm/app_list_controller.h +++ b/ash/wm/app_list_controller.h @@ -114,6 +114,8 @@ class AppListController : public ui::EventHandler, // ShellObserver overrides: void OnShelfAlignmentChanged(aura::Window* root_window) override; + void OnMaximizeModeStarted() override; + void OnMaximizeModeEnded() override; // ShelfIconObserver overrides: void OnShelfIconPositionsChanged() override; |