| 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 20 matching lines...) Expand all Loading... |
| 31 #include "ash/launcher/launcher_item_delegate.h" | 31 #include "ash/launcher/launcher_item_delegate.h" |
| 32 #include "ash/launcher/launcher_item_delegate_manager.h" | 32 #include "ash/launcher/launcher_item_delegate_manager.h" |
| 33 #include "ash/launcher/launcher_model.h" | 33 #include "ash/launcher/launcher_model.h" |
| 34 #include "ash/magnifier/magnification_controller.h" | 34 #include "ash/magnifier/magnification_controller.h" |
| 35 #include "ash/magnifier/partial_magnification_controller.h" | 35 #include "ash/magnifier/partial_magnification_controller.h" |
| 36 #include "ash/root_window_controller.h" | 36 #include "ash/root_window_controller.h" |
| 37 #include "ash/screen_ash.h" | 37 #include "ash/screen_ash.h" |
| 38 #include "ash/session_state_delegate.h" | 38 #include "ash/session_state_delegate.h" |
| 39 #include "ash/shelf/app_list_shelf_item_delegate.h" | 39 #include "ash/shelf/app_list_shelf_item_delegate.h" |
| 40 #include "ash/shelf/shelf_layout_manager.h" | 40 #include "ash/shelf/shelf_layout_manager.h" |
| 41 #include "ash/shelf/shelf_util.h" | |
| 42 #include "ash/shelf/shelf_widget.h" | 41 #include "ash/shelf/shelf_widget.h" |
| 43 #include "ash/shell_delegate.h" | 42 #include "ash/shell_delegate.h" |
| 44 #include "ash/shell_factory.h" | 43 #include "ash/shell_factory.h" |
| 45 #include "ash/shell_window_ids.h" | 44 #include "ash/shell_window_ids.h" |
| 46 #include "ash/system/locale/locale_notification_controller.h" | 45 #include "ash/system/locale/locale_notification_controller.h" |
| 47 #include "ash/system/status_area_widget.h" | 46 #include "ash/system/status_area_widget.h" |
| 48 #include "ash/system/tray/system_tray_delegate.h" | 47 #include "ash/system/tray/system_tray_delegate.h" |
| 49 #include "ash/system/tray/system_tray_notifier.h" | 48 #include "ash/system/tray/system_tray_notifier.h" |
| 50 #include "ash/wm/app_list_controller.h" | 49 #include "ash/wm/app_list_controller.h" |
| 51 #include "ash/wm/ash_focus_rules.h" | 50 #include "ash/wm/ash_focus_rules.h" |
| (...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 255 partial_magnification_controller_.reset(); | 254 partial_magnification_controller_.reset(); |
| 256 resize_shadow_controller_.reset(); | 255 resize_shadow_controller_.reset(); |
| 257 shadow_controller_.reset(); | 256 shadow_controller_.reset(); |
| 258 tooltip_controller_.reset(); | 257 tooltip_controller_.reset(); |
| 259 event_client_.reset(); | 258 event_client_.reset(); |
| 260 window_cycle_controller_.reset(); | 259 window_cycle_controller_.reset(); |
| 261 nested_dispatcher_controller_.reset(); | 260 nested_dispatcher_controller_.reset(); |
| 262 user_action_client_.reset(); | 261 user_action_client_.reset(); |
| 263 visibility_controller_.reset(); | 262 visibility_controller_.reset(); |
| 264 launcher_delegate_.reset(); | 263 launcher_delegate_.reset(); |
| 265 // |launcher_item_delegate_manager_| observes |launcher_model_|. It must be | |
| 266 // destroyed before |launcher_model_| is destroyed. | |
| 267 launcher_item_delegate_manager_.reset(); | |
| 268 launcher_model_.reset(); | 264 launcher_model_.reset(); |
| 269 video_detector_.reset(); | 265 video_detector_.reset(); |
| 270 | 266 |
| 271 power_button_controller_.reset(); | 267 power_button_controller_.reset(); |
| 272 lock_state_controller_.reset(); | 268 lock_state_controller_.reset(); |
| 273 mru_window_tracker_.reset(); | 269 mru_window_tracker_.reset(); |
| 274 | 270 |
| 275 resolution_notification_controller_.reset(); | 271 resolution_notification_controller_.reset(); |
| 276 desktop_background_controller_.reset(); | 272 desktop_background_controller_.reset(); |
| 277 | 273 |
| (...skipping 536 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 814 ShelfWidget* shelf = GetPrimaryRootWindowController()->shelf(); | 810 ShelfWidget* shelf = GetPrimaryRootWindowController()->shelf(); |
| 815 return shelf && shelf->status_area_widget(); | 811 return shelf && shelf->status_area_widget(); |
| 816 } | 812 } |
| 817 | 813 |
| 818 SystemTray* Shell::GetPrimarySystemTray() { | 814 SystemTray* Shell::GetPrimarySystemTray() { |
| 819 return GetPrimaryRootWindowController()->GetSystemTray(); | 815 return GetPrimaryRootWindowController()->GetSystemTray(); |
| 820 } | 816 } |
| 821 | 817 |
| 822 LauncherDelegate* Shell::GetLauncherDelegate() { | 818 LauncherDelegate* Shell::GetLauncherDelegate() { |
| 823 if (!launcher_delegate_) { | 819 if (!launcher_delegate_) { |
| 820 // Creates LauncherItemDelegateManager before LauncherDelegate. |
| 821 launcher_item_delegate_manager_.reset(new LauncherItemDelegateManager); |
| 824 launcher_model_.reset(new LauncherModel); | 822 launcher_model_.reset(new LauncherModel); |
| 825 // Creates LauncherItemDelegateManager before LauncherDelegate. | |
| 826 launcher_item_delegate_manager_.reset( | |
| 827 new LauncherItemDelegateManager(launcher_model_.get())); | |
| 828 | |
| 829 launcher_delegate_.reset( | 823 launcher_delegate_.reset( |
| 830 delegate_->CreateLauncherDelegate(launcher_model_.get())); | 824 delegate_->CreateLauncherDelegate(launcher_model_.get())); |
| 831 scoped_ptr<LauncherItemDelegate> controller( | 825 app_list_shelf_item_delegate_.reset( |
| 832 new internal::AppListShelfItemDelegate); | 826 new internal::AppListShelfItemDelegate); |
| 833 | |
| 834 ash::LauncherID app_list_id = 0; | |
| 835 // TODO(simon.hong81): Make function for this in shelf_util.h | |
| 836 for (size_t i = 0; i < launcher_model_->items().size(); ++i) { | |
| 837 if (launcher_model_->items()[i].type == ash::TYPE_APP_LIST) { | |
| 838 app_list_id = launcher_model_->items()[i].id; | |
| 839 break; | |
| 840 } | |
| 841 } | |
| 842 DCHECK(app_list_id); | |
| 843 launcher_item_delegate_manager_->SetLauncherItemDelegate( | |
| 844 app_list_id, | |
| 845 controller.Pass()); | |
| 846 } | 827 } |
| 847 return launcher_delegate_.get(); | 828 return launcher_delegate_.get(); |
| 848 } | 829 } |
| 849 | 830 |
| 850 void Shell::SetTouchHudProjectionEnabled(bool enabled) { | 831 void Shell::SetTouchHudProjectionEnabled(bool enabled) { |
| 851 if (is_touch_hud_projection_enabled_ == enabled) | 832 if (is_touch_hud_projection_enabled_ == enabled) |
| 852 return; | 833 return; |
| 853 | 834 |
| 854 is_touch_hud_projection_enabled_ = enabled; | 835 is_touch_hud_projection_enabled_ = enabled; |
| 855 FOR_EACH_OBSERVER(ShellObserver, observers_, | 836 FOR_EACH_OBSERVER(ShellObserver, observers_, |
| (...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 948 //////////////////////////////////////////////////////////////////////////////// | 929 //////////////////////////////////////////////////////////////////////////////// |
| 949 // Shell, aura::client::ActivationChangeObserver implementation: | 930 // Shell, aura::client::ActivationChangeObserver implementation: |
| 950 | 931 |
| 951 void Shell::OnWindowActivated(aura::Window* gained_active, | 932 void Shell::OnWindowActivated(aura::Window* gained_active, |
| 952 aura::Window* lost_active) { | 933 aura::Window* lost_active) { |
| 953 if (gained_active) | 934 if (gained_active) |
| 954 target_root_window_ = gained_active->GetRootWindow(); | 935 target_root_window_ = gained_active->GetRootWindow(); |
| 955 } | 936 } |
| 956 | 937 |
| 957 } // namespace ash | 938 } // namespace ash |
| OLD | NEW |