| 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 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 164 view_->GetWidget()->Deactivate(); | 164 view_->GetWidget()->Deactivate(); |
| 165 ScheduleAnimation(); | 165 ScheduleAnimation(); |
| 166 } else if (is_visible_) { | 166 } else if (is_visible_) { |
| 167 // AppListModel and AppListViewDelegate are owned by AppListView. They | 167 // AppListModel and AppListViewDelegate are owned by AppListView. They |
| 168 // will be released with AppListView on close. | 168 // will be released with AppListView on close. |
| 169 app_list::AppListView* view = new app_list::AppListView( | 169 app_list::AppListView* view = new app_list::AppListView( |
| 170 Shell::GetInstance()->delegate()->CreateAppListViewDelegate()); | 170 Shell::GetInstance()->delegate()->CreateAppListViewDelegate()); |
| 171 aura::Window* root_window = window->GetRootWindow(); | 171 aura::Window* root_window = window->GetRootWindow(); |
| 172 aura::Window* container = GetRootWindowController(root_window)-> | 172 aura::Window* container = GetRootWindowController(root_window)-> |
| 173 GetContainer(kShellWindowId_AppListContainer); | 173 GetContainer(kShellWindowId_AppListContainer); |
| 174 is_centered_ = app_list::switches::IsExperimentalAppListPositionEnabled(); | 174 is_centered_ = app_list::switches::IsAppListCentered(); |
| 175 if (is_centered_) { | 175 if (is_centered_) { |
| 176 // The experimental app list is centered over the primary display. | 176 // The experimental app list is centered over the primary display. |
| 177 view->InitAsBubbleAtFixedLocation( | 177 view->InitAsBubbleAtFixedLocation( |
| 178 NULL, | 178 NULL, |
| 179 pagination_model_.get(), | 179 pagination_model_.get(), |
| 180 GetScreenCenter(), | 180 GetScreenCenter(), |
| 181 views::BubbleBorder::FLOAT, | 181 views::BubbleBorder::FLOAT, |
| 182 true /* border_accepts_events */); | 182 true /* border_accepts_events */); |
| 183 } else { | 183 } else { |
| 184 gfx::Rect applist_button_bounds = Shelf::ForWindow(container)-> | 184 gfx::Rect applist_button_bounds = Shelf::ForWindow(container)-> |
| (...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 433 } else if (should_snap_back_) { | 433 } else if (should_snap_back_) { |
| 434 should_snap_back_ = false; | 434 should_snap_back_ = false; |
| 435 ui::ScopedLayerAnimationSettings animation(widget_animator); | 435 ui::ScopedLayerAnimationSettings animation(widget_animator); |
| 436 animation.SetTransitionDuration(base::TimeDelta::FromMilliseconds( | 436 animation.SetTransitionDuration(base::TimeDelta::FromMilliseconds( |
| 437 app_list::kOverscrollPageTransitionDurationMs)); | 437 app_list::kOverscrollPageTransitionDurationMs)); |
| 438 widget->SetBounds(view_bounds_); | 438 widget->SetBounds(view_bounds_); |
| 439 } | 439 } |
| 440 } | 440 } |
| 441 | 441 |
| 442 } // namespace ash | 442 } // namespace ash |
| OLD | NEW |