OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "ash/wm/app_list_controller.h" | 5 #include "ash/wm/app_list_controller.h" |
6 | 6 |
7 #include "ash/ash_switches.h" | 7 #include "ash/ash_switches.h" |
8 #include "ash/root_window_controller.h" | 8 #include "ash/root_window_controller.h" |
9 #include "ash/screen_util.h" | 9 #include "ash/screen_util.h" |
10 #include "ash/shelf/shelf.h" | 10 #include "ash/shelf/shelf.h" |
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
180 is_visible_ = true; | 180 is_visible_ = true; |
181 | 181 |
182 // App list needs to know the new shelf layout in order to calculate its | 182 // App list needs to know the new shelf layout in order to calculate its |
183 // UI layout when AppListView visibility changes. | 183 // UI layout when AppListView visibility changes. |
184 Shell::GetPrimaryRootWindowController()->GetShelfLayoutManager()-> | 184 Shell::GetPrimaryRootWindowController()->GetShelfLayoutManager()-> |
185 UpdateAutoHideState(); | 185 UpdateAutoHideState(); |
186 | 186 |
187 if (view_) { | 187 if (view_) { |
188 ScheduleAnimation(); | 188 ScheduleAnimation(); |
189 } else { | 189 } else { |
190 // AppListModel and AppListViewDelegate are owned by AppListView. They | 190 // Note the AppListViewDelegate outlives the AppListView. For Ash, the view |
191 // will be released with AppListView on close. | 191 // is destroyed when dismissed. |
192 app_list::AppListView* view = new app_list::AppListView( | 192 app_list::AppListView* view = new app_list::AppListView( |
193 Shell::GetInstance()->delegate()->CreateAppListViewDelegate()); | 193 Shell::GetInstance()->delegate()->GetAppListViewDelegate()); |
194 aura::Window* root_window = window->GetRootWindow(); | 194 aura::Window* root_window = window->GetRootWindow(); |
195 aura::Window* container = GetRootWindowController(root_window)-> | 195 aura::Window* container = GetRootWindowController(root_window)-> |
196 GetContainer(kShellWindowId_AppListContainer); | 196 GetContainer(kShellWindowId_AppListContainer); |
197 views::View* applist_button = | 197 views::View* applist_button = |
198 Shelf::ForWindow(container)->GetAppListButtonView(); | 198 Shelf::ForWindow(container)->GetAppListButtonView(); |
199 is_centered_ = view->ShouldCenterWindow(); | 199 is_centered_ = view->ShouldCenterWindow(); |
200 if (is_centered_) { | 200 if (is_centered_) { |
201 // Note: We can't center the app list until we have its dimensions, so we | 201 // Note: We can't center the app list until we have its dimensions, so we |
202 // init at (0, 0) and then reset its anchor point. | 202 // init at (0, 0) and then reset its anchor point. |
203 view->InitAsBubbleAtFixedLocation(container, | 203 view->InitAsBubbleAtFixedLocation(container, |
(...skipping 316 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
520 } else if (should_snap_back_) { | 520 } else if (should_snap_back_) { |
521 should_snap_back_ = false; | 521 should_snap_back_ = false; |
522 ui::ScopedLayerAnimationSettings animation(widget_animator); | 522 ui::ScopedLayerAnimationSettings animation(widget_animator); |
523 animation.SetTransitionDuration(base::TimeDelta::FromMilliseconds( | 523 animation.SetTransitionDuration(base::TimeDelta::FromMilliseconds( |
524 app_list::kOverscrollPageTransitionDurationMs)); | 524 app_list::kOverscrollPageTransitionDurationMs)); |
525 widget->SetBounds(view_bounds_); | 525 widget->SetBounds(view_bounds_); |
526 } | 526 } |
527 } | 527 } |
528 | 528 |
529 } // namespace ash | 529 } // namespace ash |
OLD | NEW |