| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/accelerators/exit_warning_handler.h" | 5 #include "ash/accelerators/exit_warning_handler.h" |
| 6 | 6 |
| 7 #include "ash/common/shell_window_ids.h" | 7 #include "ash/common/shell_window_ids.h" |
| 8 #include "ash/metrics/user_metrics_recorder.h" | 8 #include "ash/common/wm_shell.h" |
| 9 #include "ash/shell.h" | 9 #include "ash/shell.h" |
| 10 #include "ash/shell_delegate.h" | 10 #include "ash/shell_delegate.h" |
| 11 #include "base/strings/utf_string_conversions.h" | 11 #include "base/strings/utf_string_conversions.h" |
| 12 #include "base/time/time.h" | 12 #include "base/time/time.h" |
| 13 #include "base/timer/timer.h" | 13 #include "base/timer/timer.h" |
| 14 #include "grit/ash_strings.h" | 14 #include "grit/ash_strings.h" |
| 15 #include "ui/accessibility/ax_view_state.h" | 15 #include "ui/accessibility/ax_view_state.h" |
| 16 #include "ui/aura/window.h" | 16 #include "ui/aura/window.h" |
| 17 #include "ui/base/l10n/l10n_util.h" | 17 #include "ui/base/l10n/l10n_util.h" |
| 18 #include "ui/base/resource/resource_bundle.h" | 18 #include "ui/base/resource/resource_bundle.h" |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 107 Hide(); | 107 Hide(); |
| 108 } | 108 } |
| 109 | 109 |
| 110 void ExitWarningHandler::HandleAccelerator() { | 110 void ExitWarningHandler::HandleAccelerator() { |
| 111 ShellDelegate* shell_delegate = Shell::GetInstance()->delegate(); | 111 ShellDelegate* shell_delegate = Shell::GetInstance()->delegate(); |
| 112 switch (state_) { | 112 switch (state_) { |
| 113 case IDLE: | 113 case IDLE: |
| 114 state_ = WAIT_FOR_DOUBLE_PRESS; | 114 state_ = WAIT_FOR_DOUBLE_PRESS; |
| 115 Show(); | 115 Show(); |
| 116 StartTimer(); | 116 StartTimer(); |
| 117 Shell::GetInstance()-> | 117 WmShell::Get()->RecordUserMetricsAction(UMA_ACCEL_EXIT_FIRST_Q); |
| 118 metrics()->RecordUserMetricsAction(UMA_ACCEL_EXIT_FIRST_Q); | |
| 119 break; | 118 break; |
| 120 case WAIT_FOR_DOUBLE_PRESS: | 119 case WAIT_FOR_DOUBLE_PRESS: |
| 121 state_ = EXITING; | 120 state_ = EXITING; |
| 122 CancelTimer(); | 121 CancelTimer(); |
| 123 Hide(); | 122 Hide(); |
| 124 Shell::GetInstance()-> | 123 WmShell::Get()->RecordUserMetricsAction(UMA_ACCEL_EXIT_SECOND_Q); |
| 125 metrics()->RecordUserMetricsAction(UMA_ACCEL_EXIT_SECOND_Q); | |
| 126 shell_delegate->Exit(); | 124 shell_delegate->Exit(); |
| 127 break; | 125 break; |
| 128 case EXITING: | 126 case EXITING: |
| 129 break; | 127 break; |
| 130 default: | 128 default: |
| 131 NOTREACHED(); | 129 NOTREACHED(); |
| 132 break; | 130 break; |
| 133 } | 131 } |
| 134 } | 132 } |
| 135 | 133 |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 180 widget_->Show(); | 178 widget_->Show(); |
| 181 | 179 |
| 182 delegate->NotifyAccessibilityEvent(ui::AX_EVENT_ALERT, true); | 180 delegate->NotifyAccessibilityEvent(ui::AX_EVENT_ALERT, true); |
| 183 } | 181 } |
| 184 | 182 |
| 185 void ExitWarningHandler::Hide() { | 183 void ExitWarningHandler::Hide() { |
| 186 widget_.reset(); | 184 widget_.reset(); |
| 187 } | 185 } |
| 188 | 186 |
| 189 } // namespace ash | 187 } // namespace ash |
| OLD | NEW |