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 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
176 view_->GetWidget()->Deactivate(); | 176 view_->GetWidget()->Deactivate(); |
177 ScheduleAnimation(); | 177 ScheduleAnimation(); |
178 } else if (is_visible_) { | 178 } else if (is_visible_) { |
179 // AppListModel and AppListViewDelegate are owned by AppListView. They | 179 // AppListModel and AppListViewDelegate are owned by AppListView. They |
180 // will be released with AppListView on close. | 180 // will be released with AppListView on close. |
181 app_list::AppListView* view = new app_list::AppListView( | 181 app_list::AppListView* view = new app_list::AppListView( |
182 Shell::GetInstance()->delegate()->CreateAppListViewDelegate()); | 182 Shell::GetInstance()->delegate()->CreateAppListViewDelegate()); |
183 aura::Window* root_window = window->GetRootWindow(); | 183 aura::Window* root_window = window->GetRootWindow(); |
184 aura::Window* container = GetRootWindowController(root_window)-> | 184 aura::Window* container = GetRootWindowController(root_window)-> |
185 GetContainer(kShellWindowId_AppListContainer); | 185 GetContainer(kShellWindowId_AppListContainer); |
186 is_centered_ = view->ShouldCenterWindow(); | 186 is_centered_ = app_list::switches::IsCenteredAppListEnabled(); |
187 if (is_centered_) { | 187 if (is_centered_) { |
188 // The experimental app list is centered over the primary display. | 188 // The experimental app list is centered over the primary display. |
189 view->InitAsBubbleAtFixedLocation( | 189 view->InitAsBubbleAtFixedLocation( |
190 NULL, | 190 NULL, |
191 pagination_model_.get(), | 191 pagination_model_.get(), |
192 GetScreenCenter(), | 192 GetScreenCenter(), |
193 views::BubbleBorder::FLOAT, | 193 views::BubbleBorder::FLOAT, |
194 true /* border_accepts_events */); | 194 true /* border_accepts_events */); |
195 } else { | 195 } else { |
196 gfx::Rect applist_button_bounds = Shelf::ForWindow(container)-> | 196 gfx::Rect applist_button_bounds = Shelf::ForWindow(container)-> |
(...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
460 } else if (should_snap_back_) { | 460 } else if (should_snap_back_) { |
461 should_snap_back_ = false; | 461 should_snap_back_ = false; |
462 ui::ScopedLayerAnimationSettings animation(widget_animator); | 462 ui::ScopedLayerAnimationSettings animation(widget_animator); |
463 animation.SetTransitionDuration(base::TimeDelta::FromMilliseconds( | 463 animation.SetTransitionDuration(base::TimeDelta::FromMilliseconds( |
464 app_list::kOverscrollPageTransitionDurationMs)); | 464 app_list::kOverscrollPageTransitionDurationMs)); |
465 widget->SetBounds(view_bounds_); | 465 widget->SetBounds(view_bounds_); |
466 } | 466 } |
467 } | 467 } |
468 | 468 |
469 } // namespace ash | 469 } // namespace ash |
OLD | NEW |