| 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" |
| 11 #include "ash/shelf/shelf_layout_manager.h" | 11 #include "ash/shelf/shelf_layout_manager.h" |
| 12 #include "ash/shell.h" | 12 #include "ash/shell.h" |
| 13 #include "ash/shell_delegate.h" | 13 #include "ash/shell_delegate.h" |
| 14 #include "ash/shell_window_ids.h" | 14 #include "ash/shell_window_ids.h" |
| 15 #include "base/command_line.h" | 15 #include "base/command_line.h" |
| 16 #include "ui/app_list/app_list_constants.h" | 16 #include "ui/app_list/app_list_constants.h" |
| 17 #include "ui/app_list/app_list_switches.h" | 17 #include "ui/app_list/app_list_switches.h" |
| 18 #include "ui/app_list/app_list_view_delegate.h" |
| 18 #include "ui/app_list/pagination_model.h" | 19 #include "ui/app_list/pagination_model.h" |
| 19 #include "ui/app_list/views/app_list_view.h" | 20 #include "ui/app_list/views/app_list_view.h" |
| 20 #include "ui/aura/client/focus_client.h" | 21 #include "ui/aura/client/focus_client.h" |
| 21 #include "ui/aura/window.h" | 22 #include "ui/aura/window.h" |
| 22 #include "ui/aura/window_event_dispatcher.h" | 23 #include "ui/aura/window_event_dispatcher.h" |
| 23 #include "ui/compositor/layer.h" | 24 #include "ui/compositor/layer.h" |
| 24 #include "ui/compositor/scoped_layer_animation_settings.h" | 25 #include "ui/compositor/scoped_layer_animation_settings.h" |
| 25 #include "ui/events/event.h" | 26 #include "ui/events/event.h" |
| 26 #include "ui/gfx/transform_util.h" | 27 #include "ui/gfx/transform_util.h" |
| 27 #include "ui/keyboard/keyboard_controller.h" | 28 #include "ui/keyboard/keyboard_controller.h" |
| (...skipping 267 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 295 if (keyboard_controller) | 296 if (keyboard_controller) |
| 296 keyboard_controller->AddObserver(this); | 297 keyboard_controller->AddObserver(this); |
| 297 Shell::GetInstance()->AddPreTargetHandler(this); | 298 Shell::GetInstance()->AddPreTargetHandler(this); |
| 298 Shelf::ForWindow(widget->GetNativeWindow())->AddIconObserver(this); | 299 Shelf::ForWindow(widget->GetNativeWindow())->AddIconObserver(this); |
| 299 widget->GetNativeView()->GetRootWindow()->AddObserver(this); | 300 widget->GetNativeView()->GetRootWindow()->AddObserver(this); |
| 300 aura::client::GetFocusClient(widget->GetNativeView())->AddObserver(this); | 301 aura::client::GetFocusClient(widget->GetNativeView())->AddObserver(this); |
| 301 | 302 |
| 302 view_->GetAppsPaginationModel()->AddObserver(this); | 303 view_->GetAppsPaginationModel()->AddObserver(this); |
| 303 | 304 |
| 304 view_->ShowWhenReady(); | 305 view_->ShowWhenReady(); |
| 306 |
| 307 Shell::GetInstance()->delegate()->GetAppListViewDelegate()->ViewInitialized(); |
| 305 } | 308 } |
| 306 | 309 |
| 307 void AppListController::ResetView() { | 310 void AppListController::ResetView() { |
| 308 if (!view_) | 311 if (!view_) |
| 309 return; | 312 return; |
| 310 | 313 |
| 311 views::Widget* widget = view_->GetWidget(); | 314 views::Widget* widget = view_->GetWidget(); |
| 312 widget->RemoveObserver(this); | 315 widget->RemoveObserver(this); |
| 313 GetLayer(widget)->GetAnimator()->RemoveObserver(this); | 316 GetLayer(widget)->GetAnimator()->RemoveObserver(this); |
| 314 keyboard::KeyboardController* keyboard_controller = | 317 keyboard::KeyboardController* keyboard_controller = |
| (...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 520 } else if (should_snap_back_) { | 523 } else if (should_snap_back_) { |
| 521 should_snap_back_ = false; | 524 should_snap_back_ = false; |
| 522 ui::ScopedLayerAnimationSettings animation(widget_animator); | 525 ui::ScopedLayerAnimationSettings animation(widget_animator); |
| 523 animation.SetTransitionDuration(base::TimeDelta::FromMilliseconds( | 526 animation.SetTransitionDuration(base::TimeDelta::FromMilliseconds( |
| 524 app_list::kOverscrollPageTransitionDurationMs)); | 527 app_list::kOverscrollPageTransitionDurationMs)); |
| 525 widget->SetBounds(view_bounds_); | 528 widget->SetBounds(view_bounds_); |
| 526 } | 529 } |
| 527 } | 530 } |
| 528 | 531 |
| 529 } // namespace ash | 532 } // namespace ash |
| OLD | NEW |