Chromium Code Reviews| 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 <algorithm> | |
| 8 | |
|
benwells
2013/08/01 22:53:12
Nit: Why the new include? Is it for iwyu for exist
xiyuan
2013/08/01 23:18:28
Yep, it's for the std::min/max in existing code. R
| |
| 7 #include "ash/ash_switches.h" | 9 #include "ash/ash_switches.h" |
| 8 #include "ash/launcher/launcher.h" | 10 #include "ash/launcher/launcher.h" |
| 9 #include "ash/root_window_controller.h" | 11 #include "ash/root_window_controller.h" |
| 10 #include "ash/shelf/shelf_layout_manager.h" | 12 #include "ash/shelf/shelf_layout_manager.h" |
| 11 #include "ash/shell.h" | 13 #include "ash/shell.h" |
| 12 #include "ash/shell_delegate.h" | 14 #include "ash/shell_delegate.h" |
| 13 #include "ash/shell_window_ids.h" | 15 #include "ash/shell_window_ids.h" |
| 14 #include "ash/wm/property_util.h" | 16 #include "ash/wm/property_util.h" |
| 15 #include "ui/app_list/app_list_constants.h" | 17 #include "ui/app_list/app_list_constants.h" |
| 16 #include "ui/app_list/pagination_model.h" | 18 #include "ui/app_list/pagination_model.h" |
| (...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 202 aura::Window* AppListController::GetWindow() { | 204 aura::Window* AppListController::GetWindow() { |
| 203 return is_visible_ && view_ ? view_->GetWidget()->GetNativeWindow() : NULL; | 205 return is_visible_ && view_ ? view_->GetWidget()->GetNativeWindow() : NULL; |
| 204 } | 206 } |
| 205 | 207 |
| 206 void AppListController::SetDragAndDropHostOfCurrentAppList( | 208 void AppListController::SetDragAndDropHostOfCurrentAppList( |
| 207 app_list::ApplicationDragAndDropHost* drag_and_drop_host) { | 209 app_list::ApplicationDragAndDropHost* drag_and_drop_host) { |
| 208 if (view_ && is_visible_) | 210 if (view_ && is_visible_) |
| 209 view_->SetDragAndDropHostOfCurrentAppList(drag_and_drop_host); | 211 view_->SetDragAndDropHostOfCurrentAppList(drag_and_drop_host); |
| 210 } | 212 } |
| 211 | 213 |
| 214 void AppListController::ShowAppsGrid() { | |
| 215 if (view_ && is_visible_) | |
| 216 view_->ShowAppsGrid(); | |
| 217 } | |
| 218 | |
| 212 //////////////////////////////////////////////////////////////////////////////// | 219 //////////////////////////////////////////////////////////////////////////////// |
| 213 // AppListController, private: | 220 // AppListController, private: |
| 214 | 221 |
| 215 void AppListController::SetView(app_list::AppListView* view) { | 222 void AppListController::SetView(app_list::AppListView* view) { |
| 216 DCHECK(view_ == NULL); | 223 DCHECK(view_ == NULL); |
| 217 DCHECK(is_visible_); | 224 DCHECK(is_visible_); |
| 218 | 225 |
| 219 view_ = view; | 226 view_ = view; |
| 220 views::Widget* widget = view_->GetWidget(); | 227 views::Widget* widget = view_->GetWidget(); |
| 221 widget->AddObserver(this); | 228 widget->AddObserver(this); |
| (...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 414 should_snap_back_ = false; | 421 should_snap_back_ = false; |
| 415 ui::ScopedLayerAnimationSettings animation(widget_animator); | 422 ui::ScopedLayerAnimationSettings animation(widget_animator); |
| 416 animation.SetTransitionDuration(base::TimeDelta::FromMilliseconds( | 423 animation.SetTransitionDuration(base::TimeDelta::FromMilliseconds( |
| 417 app_list::kOverscrollPageTransitionDurationMs)); | 424 app_list::kOverscrollPageTransitionDurationMs)); |
| 418 widget->SetBounds(view_bounds_); | 425 widget->SetBounds(view_bounds_); |
| 419 } | 426 } |
| 420 } | 427 } |
| 421 | 428 |
| 422 } // namespace internal | 429 } // namespace internal |
| 423 } // namespace ash | 430 } // namespace ash |
| OLD | NEW |