summaryrefslogtreecommitdiffstats
path: root/ash/wm/app_list_controller.cc
diff options
context:
space:
mode:
authoroshima@chromium.org <oshima@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-12-11 13:07:19 +0000
committeroshima@chromium.org <oshima@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-12-11 13:07:19 +0000
commitb913a3acaaebf26e54ca13dc37e3c21527e841f3 (patch)
treedeeb025f24a5709d9272e3da45b558f27cb4eb2d /ash/wm/app_list_controller.cc
parentff1779bcb9314565caab15f8bfb44e57d9744b33 (diff)
downloadchromium_src-b913a3acaaebf26e54ca13dc37e3c21527e841f3.zip
chromium_src-b913a3acaaebf26e54ca13dc37e3c21527e841f3.tar.gz
chromium_src-b913a3acaaebf26e54ca13dc37e3c21527e841f3.tar.bz2
- Show app list on 2nd launcher
- Share the launcher mode/delegate in multiple launchers. This CL moves the launcher mode/delegate to Shell - Initialize Display objects before creating RootWindow for 2nd as it'll be used during creation. I'll add tests in next CL, as it crashes without https://codereview.chromium.org/11515004/. BUG=145978 TEST=none Review URL: https://chromiumcodereview.appspot.com/11465037 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@172310 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ash/wm/app_list_controller.cc')
-rw-r--r--ash/wm/app_list_controller.cc26
1 files changed, 12 insertions, 14 deletions
diff --git a/ash/wm/app_list_controller.cc b/ash/wm/app_list_controller.cc
index 3c52d77..d21e19f 100644
--- a/ash/wm/app_list_controller.cc
+++ b/ash/wm/app_list_controller.cc
@@ -101,7 +101,7 @@ AppListController::~AppListController() {
pagination_model_->RemoveObserver(this);
}
-void AppListController::SetVisible(bool visible) {
+void AppListController::SetVisible(bool visible, aura::Window* window) {
if (visible == is_visible_)
return;
@@ -118,14 +118,12 @@ void AppListController::SetVisible(bool visible) {
// will be released with AppListView on close.
app_list::AppListView* view = new app_list::AppListView(
Shell::GetInstance()->delegate()->CreateAppListViewDelegate());
- // TODO(oshima): support multiple displays.
- aura::Window* container = Shell::GetPrimaryRootWindowController()->
+ aura::Window* container = GetRootWindowController(window->GetRootWindow())->
GetContainer(kShellWindowId_AppListContainer);
view->InitAsBubble(
- Shell::GetPrimaryRootWindowController()->GetContainer(
- kShellWindowId_AppListContainer),
+ container,
pagination_model_.get(),
- Launcher::ForWindow(GetWindow())->GetAppListButtonView(),
+ Launcher::ForWindow(container)->GetAppListButtonView(),
gfx::Point(),
GetBubbleArrowLocation(container));
SetView(view);
@@ -151,7 +149,7 @@ void AppListController::SetView(app_list::AppListView* view) {
views::Widget* widget = view_->GetWidget();
widget->AddObserver(this);
Shell::GetInstance()->AddPreTargetHandler(this);
- Launcher::ForWindow(GetWindow())->AddIconObserver(this);
+ Launcher::ForWindow(widget->GetNativeWindow())->AddIconObserver(this);
widget->GetNativeView()->GetRootWindow()->AddRootWindowObserver(this);
aura::client::GetFocusClient(widget->GetNativeView())->AddObserver(this);
@@ -166,7 +164,7 @@ void AppListController::ResetView() {
widget->RemoveObserver(this);
GetLayer(widget)->GetAnimator()->RemoveObserver(this);
Shell::GetInstance()->RemovePreTargetHandler(this);
- Launcher::ForWindow(GetWindow())->RemoveIconObserver(this);
+ Launcher::ForWindow(widget->GetNativeWindow())->RemoveIconObserver(this);
widget->GetNativeView()->GetRootWindow()->RemoveRootWindowObserver(this);
aura::client::GetFocusClient(widget->GetNativeView())->RemoveObserver(this);
view_ = NULL;
@@ -222,7 +220,7 @@ void AppListController::ProcessLocatedEvent(ui::LocatedEvent* event) {
&window_local_point);
// Use HitTest to respect the hit test mask of the bubble.
if (!window->HitTest(window_local_point))
- SetVisible(false);
+ SetVisible(false, window);
}
}
@@ -251,11 +249,11 @@ void AppListController::OnGestureEvent(ui::GestureEvent* event) {
void AppListController::OnWindowFocused(aura::Window* gained_focus,
aura::Window* lost_focus) {
if (gained_focus && view_ && is_visible_) {
- aura::Window* applist_container = Shell::GetContainer(
- Shell::GetPrimaryRootWindow(),
- kShellWindowId_AppListContainer);
+ aura::Window* applist_container =
+ GetRootWindowController(gained_focus->GetRootWindow())->GetContainer(
+ kShellWindowId_AppListContainer);
if (gained_focus->parent() != applist_container)
- SetVisible(false);
+ SetVisible(false, gained_focus);
}
}
@@ -282,7 +280,7 @@ void AppListController::OnImplicitAnimationsCompleted() {
void AppListController::OnWidgetClosing(views::Widget* widget) {
DCHECK(view_->GetWidget() == widget);
if (is_visible_)
- SetVisible(false);
+ SetVisible(false, widget->GetNativeView());
ResetView();
}