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 642 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
653 user_metrics_recorder_.reset(new UserMetricsRecorder); | 653 user_metrics_recorder_.reset(new UserMetricsRecorder); |
654 | 654 |
655 #if defined(OS_CHROMEOS) | 655 #if defined(OS_CHROMEOS) |
656 PowerStatus::Initialize(); | 656 PowerStatus::Initialize(); |
657 #endif | 657 #endif |
658 } | 658 } |
659 | 659 |
660 Shell::~Shell() { | 660 Shell::~Shell() { |
661 TRACE_EVENT0("shutdown", "ash::Shell::Destructor"); | 661 TRACE_EVENT0("shutdown", "ash::Shell::Destructor"); |
662 | 662 |
| 663 user_metrics_recorder_->OnShellShuttingDown(); |
| 664 |
663 delegate_->PreShutdown(); | 665 delegate_->PreShutdown(); |
664 | 666 |
665 views::FocusManagerFactory::Install(NULL); | 667 views::FocusManagerFactory::Install(NULL); |
666 | 668 |
667 // Remove the focus from any window. This will prevent overhead and side | 669 // Remove the focus from any window. This will prevent overhead and side |
668 // effects (e.g. crashes) from changing focus during shutdown. | 670 // effects (e.g. crashes) from changing focus during shutdown. |
669 // See bug crbug.com/134502. | 671 // See bug crbug.com/134502. |
670 aura::client::GetFocusClient(GetPrimaryRootWindow())->FocusWindow(NULL); | 672 aura::client::GetFocusClient(GetPrimaryRootWindow())->FocusWindow(NULL); |
671 | 673 |
672 // Please keep in same order as in Init() because it's easy to miss one. | 674 // Please keep in same order as in Init() because it's easy to miss one. |
(...skipping 405 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1078 video_activity_notifier_.reset( | 1080 video_activity_notifier_.reset( |
1079 new VideoActivityNotifier(video_detector_.get())); | 1081 new VideoActivityNotifier(video_detector_.get())); |
1080 bluetooth_notification_controller_.reset(new BluetoothNotificationController); | 1082 bluetooth_notification_controller_.reset(new BluetoothNotificationController); |
1081 last_window_closed_logout_reminder_.reset(new LastWindowClosedLogoutReminder); | 1083 last_window_closed_logout_reminder_.reset(new LastWindowClosedLogoutReminder); |
1082 screen_orientation_controller_.reset(new ScreenOrientationController()); | 1084 screen_orientation_controller_.reset(new ScreenOrientationController()); |
1083 #endif | 1085 #endif |
1084 // The compositor thread and main message loop have to be running in | 1086 // The compositor thread and main message loop have to be running in |
1085 // order to create mirror window. Run it after the main message loop | 1087 // order to create mirror window. Run it after the main message loop |
1086 // is started. | 1088 // is started. |
1087 display_manager_->CreateMirrorWindowAsyncIfAny(); | 1089 display_manager_->CreateMirrorWindowAsyncIfAny(); |
| 1090 |
| 1091 user_metrics_recorder_->OnShellInitialized(); |
1088 } | 1092 } |
1089 | 1093 |
1090 void Shell::InitKeyboard() { | 1094 void Shell::InitKeyboard() { |
1091 if (keyboard::IsKeyboardEnabled()) { | 1095 if (keyboard::IsKeyboardEnabled()) { |
1092 if (keyboard::KeyboardController::GetInstance()) { | 1096 if (keyboard::KeyboardController::GetInstance()) { |
1093 RootWindowControllerList controllers = GetAllRootWindowControllers(); | 1097 RootWindowControllerList controllers = GetAllRootWindowControllers(); |
1094 for (RootWindowControllerList::iterator iter = controllers.begin(); | 1098 for (RootWindowControllerList::iterator iter = controllers.begin(); |
1095 iter != controllers.end(); ++iter) { | 1099 iter != controllers.end(); ++iter) { |
1096 (*iter)->DeactivateKeyboard( | 1100 (*iter)->DeactivateKeyboard( |
1097 keyboard::KeyboardController::GetInstance()); | 1101 keyboard::KeyboardController::GetInstance()); |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1179 | 1183 |
1180 void Shell::OnWindowActivated( | 1184 void Shell::OnWindowActivated( |
1181 aura::client::ActivationChangeObserver::ActivationReason reason, | 1185 aura::client::ActivationChangeObserver::ActivationReason reason, |
1182 aura::Window* gained_active, | 1186 aura::Window* gained_active, |
1183 aura::Window* lost_active) { | 1187 aura::Window* lost_active) { |
1184 if (gained_active) | 1188 if (gained_active) |
1185 target_root_window_ = gained_active->GetRootWindow(); | 1189 target_root_window_ = gained_active->GetRootWindow(); |
1186 } | 1190 } |
1187 | 1191 |
1188 } // namespace ash | 1192 } // namespace ash |
OLD | NEW |