| 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 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 160 } else if (is_visible_) { | 160 } else if (is_visible_) { |
| 161 // AppListModel and AppListViewDelegate are owned by AppListView. They | 161 // AppListModel and AppListViewDelegate are owned by AppListView. They |
| 162 // will be released with AppListView on close. | 162 // will be released with AppListView on close. |
| 163 app_list::AppListView* view = new app_list::AppListView( | 163 app_list::AppListView* view = new app_list::AppListView( |
| 164 Shell::GetInstance()->delegate()->CreateAppListViewDelegate()); | 164 Shell::GetInstance()->delegate()->CreateAppListViewDelegate()); |
| 165 aura::Window* root_window = window->GetRootWindow(); | 165 aura::Window* root_window = window->GetRootWindow(); |
| 166 aura::Window* container = GetRootWindowController(root_window)-> | 166 aura::Window* container = GetRootWindowController(root_window)-> |
| 167 GetContainer(kShellWindowId_AppListContainer); | 167 GetContainer(kShellWindowId_AppListContainer); |
| 168 if (app_list::switches::IsExperimentalAppListPositionEnabled()) { | 168 if (app_list::switches::IsExperimentalAppListPositionEnabled()) { |
| 169 // The experimental app list is centered over the primary display. | 169 // The experimental app list is centered over the primary display. |
| 170 view->InitAsBubbleAtFixedLocation( | 170 view->InitAsBubbleCenteredOnPrimaryDisplay( |
| 171 NULL, | 171 NULL, |
| 172 pagination_model_.get(), | 172 pagination_model_.get(), |
| 173 Shell::GetScreen()->GetPrimaryDisplay().bounds().CenterPoint(), | 173 Shell::GetScreen(), |
| 174 views::BubbleBorder::FLOAT, | 174 views::BubbleBorder::FLOAT, |
| 175 true /* border_accepts_events */); | 175 true /* border_accepts_events */); |
| 176 } else { | 176 } else { |
| 177 gfx::Rect applist_button_bounds = Shelf::ForWindow(container)-> | 177 gfx::Rect applist_button_bounds = Shelf::ForWindow(container)-> |
| 178 GetAppListButtonView()->GetBoundsInScreen(); | 178 GetAppListButtonView()->GetBoundsInScreen(); |
| 179 // We need the location of the button within the local screen. | 179 // We need the location of the button within the local screen. |
| 180 applist_button_bounds = ScreenUtil::ConvertRectFromScreen( | 180 applist_button_bounds = ScreenUtil::ConvertRectFromScreen( |
| 181 root_window, | 181 root_window, |
| 182 applist_button_bounds); | 182 applist_button_bounds); |
| 183 view->InitAsBubbleAttachedToAnchor( | 183 view->InitAsBubbleAttachedToAnchor( |
| (...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 421 } else if (should_snap_back_) { | 421 } else if (should_snap_back_) { |
| 422 should_snap_back_ = false; | 422 should_snap_back_ = false; |
| 423 ui::ScopedLayerAnimationSettings animation(widget_animator); | 423 ui::ScopedLayerAnimationSettings animation(widget_animator); |
| 424 animation.SetTransitionDuration(base::TimeDelta::FromMilliseconds( | 424 animation.SetTransitionDuration(base::TimeDelta::FromMilliseconds( |
| 425 app_list::kOverscrollPageTransitionDurationMs)); | 425 app_list::kOverscrollPageTransitionDurationMs)); |
| 426 widget->SetBounds(view_bounds_); | 426 widget->SetBounds(view_bounds_); |
| 427 } | 427 } |
| 428 } | 428 } |
| 429 | 429 |
| 430 } // namespace ash | 430 } // namespace ash |
| OLD | NEW |