| 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/shell.h" | 5 #include "ash/shell.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "ash/accelerators/accelerator_controller.h" | 10 #include "ash/accelerators/accelerator_controller.h" |
| (...skipping 15 matching lines...) Expand all Loading... |
| 26 #include "ash/drag_drop/drag_drop_controller.h" | 26 #include "ash/drag_drop/drag_drop_controller.h" |
| 27 #include "ash/first_run/first_run_helper_impl.h" | 27 #include "ash/first_run/first_run_helper_impl.h" |
| 28 #include "ash/focus_cycler.h" | 28 #include "ash/focus_cycler.h" |
| 29 #include "ash/high_contrast/high_contrast_controller.h" | 29 #include "ash/high_contrast/high_contrast_controller.h" |
| 30 #include "ash/host/root_window_host_factory.h" | 30 #include "ash/host/root_window_host_factory.h" |
| 31 #include "ash/keyboard_uma_event_filter.h" | 31 #include "ash/keyboard_uma_event_filter.h" |
| 32 #include "ash/launcher/launcher_delegate.h" | 32 #include "ash/launcher/launcher_delegate.h" |
| 33 #include "ash/launcher/launcher_item_delegate.h" | 33 #include "ash/launcher/launcher_item_delegate.h" |
| 34 #include "ash/launcher/launcher_item_delegate_manager.h" | 34 #include "ash/launcher/launcher_item_delegate_manager.h" |
| 35 #include "ash/launcher/launcher_model.h" | 35 #include "ash/launcher/launcher_model.h" |
| 36 #include "ash/launcher/launcher_model_util.h" | |
| 37 #include "ash/magnifier/magnification_controller.h" | 36 #include "ash/magnifier/magnification_controller.h" |
| 38 #include "ash/magnifier/partial_magnification_controller.h" | 37 #include "ash/magnifier/partial_magnification_controller.h" |
| 39 #include "ash/new_window_delegate.h" | 38 #include "ash/new_window_delegate.h" |
| 40 #include "ash/root_window_controller.h" | 39 #include "ash/root_window_controller.h" |
| 41 #include "ash/screen_ash.h" | 40 #include "ash/screen_ash.h" |
| 42 #include "ash/session_state_delegate.h" | 41 #include "ash/session_state_delegate.h" |
| 43 #include "ash/shelf/app_list_shelf_item_delegate.h" | 42 #include "ash/shelf/app_list_shelf_item_delegate.h" |
| 44 #include "ash/shelf/shelf_layout_manager.h" | 43 #include "ash/shelf/shelf_layout_manager.h" |
| 44 #include "ash/shelf/shelf_model_util.h" |
| 45 #include "ash/shelf/shelf_widget.h" | 45 #include "ash/shelf/shelf_widget.h" |
| 46 #include "ash/shell_delegate.h" | 46 #include "ash/shell_delegate.h" |
| 47 #include "ash/shell_factory.h" | 47 #include "ash/shell_factory.h" |
| 48 #include "ash/shell_window_ids.h" | 48 #include "ash/shell_window_ids.h" |
| 49 #include "ash/system/locale/locale_notification_controller.h" | 49 #include "ash/system/locale/locale_notification_controller.h" |
| 50 #include "ash/system/status_area_widget.h" | 50 #include "ash/system/status_area_widget.h" |
| 51 #include "ash/system/tray/system_tray_delegate.h" | 51 #include "ash/system/tray/system_tray_delegate.h" |
| 52 #include "ash/system/tray/system_tray_notifier.h" | 52 #include "ash/system/tray/system_tray_notifier.h" |
| 53 #include "ash/wm/app_list_controller.h" | 53 #include "ash/wm/app_list_controller.h" |
| 54 #include "ash/wm/ash_focus_rules.h" | 54 #include "ash/wm/ash_focus_rules.h" |
| (...skipping 436 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 491 new LauncherItemDelegateManager(launcher_model_.get())); | 491 new LauncherItemDelegateManager(launcher_model_.get())); |
| 492 | 492 |
| 493 launcher_delegate_.reset( | 493 launcher_delegate_.reset( |
| 494 delegate_->CreateLauncherDelegate(launcher_model_.get())); | 494 delegate_->CreateLauncherDelegate(launcher_model_.get())); |
| 495 scoped_ptr<LauncherItemDelegate> controller( | 495 scoped_ptr<LauncherItemDelegate> controller( |
| 496 new internal::AppListShelfItemDelegate); | 496 new internal::AppListShelfItemDelegate); |
| 497 | 497 |
| 498 // Finding the launcher model's location of the app list and setting its | 498 // Finding the launcher model's location of the app list and setting its |
| 499 // LauncherItemDelegate. | 499 // LauncherItemDelegate. |
| 500 int app_list_index = | 500 int app_list_index = |
| 501 ash::GetLauncherItemIndexForType(ash::TYPE_APP_LIST, *launcher_model_); | 501 GetShelfItemIndexForType(ash::TYPE_APP_LIST, *launcher_model_); |
| 502 DCHECK_GE(app_list_index, 0); | 502 DCHECK_GE(app_list_index, 0); |
| 503 ash::LauncherID app_list_id = launcher_model_->items()[app_list_index].id; | 503 ash::LauncherID app_list_id = launcher_model_->items()[app_list_index].id; |
| 504 DCHECK(app_list_id); | 504 DCHECK(app_list_id); |
| 505 launcher_item_delegate_manager_->SetLauncherItemDelegate( | 505 launcher_item_delegate_manager_->SetLauncherItemDelegate( |
| 506 app_list_id, | 506 app_list_id, |
| 507 controller.Pass()); | 507 controller.Pass()); |
| 508 } | 508 } |
| 509 return launcher_delegate_.get(); | 509 return launcher_delegate_.get(); |
| 510 } | 510 } |
| 511 | 511 |
| (...skipping 473 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 985 //////////////////////////////////////////////////////////////////////////////// | 985 //////////////////////////////////////////////////////////////////////////////// |
| 986 // Shell, aura::client::ActivationChangeObserver implementation: | 986 // Shell, aura::client::ActivationChangeObserver implementation: |
| 987 | 987 |
| 988 void Shell::OnWindowActivated(aura::Window* gained_active, | 988 void Shell::OnWindowActivated(aura::Window* gained_active, |
| 989 aura::Window* lost_active) { | 989 aura::Window* lost_active) { |
| 990 if (gained_active) | 990 if (gained_active) |
| 991 target_root_window_ = gained_active->GetRootWindow(); | 991 target_root_window_ = gained_active->GetRootWindow(); |
| 992 } | 992 } |
| 993 | 993 |
| 994 } // namespace ash | 994 } // namespace ash |
| OLD | NEW |