| 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 25 matching lines...) Expand all Loading... |
| 36 #include "ash/magnifier/magnification_controller.h" | 36 #include "ash/magnifier/magnification_controller.h" |
| 37 #include "ash/magnifier/partial_magnification_controller.h" | 37 #include "ash/magnifier/partial_magnification_controller.h" |
| 38 #include "ash/media_delegate.h" | 38 #include "ash/media_delegate.h" |
| 39 #include "ash/new_window_delegate.h" | 39 #include "ash/new_window_delegate.h" |
| 40 #include "ash/root_window_controller.h" | 40 #include "ash/root_window_controller.h" |
| 41 #include "ash/screen_ash.h" | 41 #include "ash/screen_ash.h" |
| 42 #include "ash/session_state_delegate.h" | 42 #include "ash/session_state_delegate.h" |
| 43 #include "ash/shelf/app_list_shelf_item_delegate.h" | 43 #include "ash/shelf/app_list_shelf_item_delegate.h" |
| 44 #include "ash/shelf/shelf_layout_manager.h" | 44 #include "ash/shelf/shelf_layout_manager.h" |
| 45 #include "ash/shelf/shelf_model.h" | 45 #include "ash/shelf/shelf_model.h" |
| 46 #include "ash/shelf/shelf_model_util.h" | |
| 47 #include "ash/shelf/shelf_widget.h" | 46 #include "ash/shelf/shelf_widget.h" |
| 48 #include "ash/shell_delegate.h" | 47 #include "ash/shell_delegate.h" |
| 49 #include "ash/shell_factory.h" | 48 #include "ash/shell_factory.h" |
| 50 #include "ash/shell_window_ids.h" | 49 #include "ash/shell_window_ids.h" |
| 51 #include "ash/system/locale/locale_notification_controller.h" | 50 #include "ash/system/locale/locale_notification_controller.h" |
| 52 #include "ash/system/status_area_widget.h" | 51 #include "ash/system/status_area_widget.h" |
| 53 #include "ash/system/tray/system_tray_delegate.h" | 52 #include "ash/system/tray/system_tray_delegate.h" |
| 54 #include "ash/system/tray/system_tray_notifier.h" | 53 #include "ash/system/tray/system_tray_notifier.h" |
| 55 #include "ash/wm/app_list_controller.h" | 54 #include "ash/wm/app_list_controller.h" |
| 56 #include "ash/wm/ash_focus_rules.h" | 55 #include "ash/wm/ash_focus_rules.h" |
| (...skipping 447 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 504 launcher_item_delegate_manager_.reset( | 503 launcher_item_delegate_manager_.reset( |
| 505 new LauncherItemDelegateManager(shelf_model_.get())); | 504 new LauncherItemDelegateManager(shelf_model_.get())); |
| 506 | 505 |
| 507 launcher_delegate_.reset( | 506 launcher_delegate_.reset( |
| 508 delegate_->CreateLauncherDelegate(shelf_model_.get())); | 507 delegate_->CreateLauncherDelegate(shelf_model_.get())); |
| 509 scoped_ptr<LauncherItemDelegate> controller( | 508 scoped_ptr<LauncherItemDelegate> controller( |
| 510 new internal::AppListShelfItemDelegate); | 509 new internal::AppListShelfItemDelegate); |
| 511 | 510 |
| 512 // Finding the shelf model's location of the app list and setting its | 511 // Finding the shelf model's location of the app list and setting its |
| 513 // LauncherItemDelegate. | 512 // LauncherItemDelegate. |
| 514 int app_list_index = GetShelfItemIndexForType(TYPE_APP_LIST, *shelf_model_); | 513 int app_list_index = shelf_model_->GetItemIndexForType(TYPE_APP_LIST); |
| 515 DCHECK_GE(app_list_index, 0); | 514 DCHECK_GE(app_list_index, 0); |
| 516 LauncherID app_list_id = shelf_model_->items()[app_list_index].id; | 515 LauncherID app_list_id = shelf_model_->items()[app_list_index].id; |
| 517 DCHECK(app_list_id); | 516 DCHECK(app_list_id); |
| 518 launcher_item_delegate_manager_->SetLauncherItemDelegate( | 517 launcher_item_delegate_manager_->SetLauncherItemDelegate( |
| 519 app_list_id, | 518 app_list_id, |
| 520 controller.Pass()); | 519 controller.Pass()); |
| 521 } | 520 } |
| 522 return launcher_delegate_.get(); | 521 return launcher_delegate_.get(); |
| 523 } | 522 } |
| 524 | 523 |
| (...skipping 477 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1002 //////////////////////////////////////////////////////////////////////////////// | 1001 //////////////////////////////////////////////////////////////////////////////// |
| 1003 // Shell, aura::client::ActivationChangeObserver implementation: | 1002 // Shell, aura::client::ActivationChangeObserver implementation: |
| 1004 | 1003 |
| 1005 void Shell::OnWindowActivated(aura::Window* gained_active, | 1004 void Shell::OnWindowActivated(aura::Window* gained_active, |
| 1006 aura::Window* lost_active) { | 1005 aura::Window* lost_active) { |
| 1007 if (gained_active) | 1006 if (gained_active) |
| 1008 target_root_window_ = gained_active->GetRootWindow(); | 1007 target_root_window_ = gained_active->GetRootWindow(); |
| 1009 } | 1008 } |
| 1010 | 1009 |
| 1011 } // namespace ash | 1010 } // namespace ash |
| OLD | NEW |