| 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/common/accelerators/exit_warning_handler.h" | 5 #include "ash/common/accelerators/exit_warning_handler.h" |
| 6 | 6 |
| 7 #include "ash/common/shell_delegate.h" | 7 #include "ash/common/shell_delegate.h" |
| 8 #include "ash/common/wm_shell.h" | 8 #include "ash/common/wm_shell.h" |
| 9 #include "ash/common/wm_window.h" | 9 #include "ash/common/wm_window.h" |
| 10 #include "ash/public/cpp/shell_window_ids.h" | 10 #include "ash/public/cpp/shell_window_ids.h" |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 109 state_ = WAIT_FOR_DOUBLE_PRESS; | 109 state_ = WAIT_FOR_DOUBLE_PRESS; |
| 110 Show(); | 110 Show(); |
| 111 StartTimer(); | 111 StartTimer(); |
| 112 WmShell::Get()->RecordUserMetricsAction(UMA_ACCEL_EXIT_FIRST_Q); | 112 WmShell::Get()->RecordUserMetricsAction(UMA_ACCEL_EXIT_FIRST_Q); |
| 113 break; | 113 break; |
| 114 case WAIT_FOR_DOUBLE_PRESS: | 114 case WAIT_FOR_DOUBLE_PRESS: |
| 115 state_ = EXITING; | 115 state_ = EXITING; |
| 116 CancelTimer(); | 116 CancelTimer(); |
| 117 Hide(); | 117 Hide(); |
| 118 WmShell::Get()->RecordUserMetricsAction(UMA_ACCEL_EXIT_SECOND_Q); | 118 WmShell::Get()->RecordUserMetricsAction(UMA_ACCEL_EXIT_SECOND_Q); |
| 119 WmShell::Get()->delegate()->Exit(); | 119 Shell::Get()->shell_delegate()->Exit(); |
| 120 break; | 120 break; |
| 121 case EXITING: | 121 case EXITING: |
| 122 break; | 122 break; |
| 123 } | 123 } |
| 124 } | 124 } |
| 125 | 125 |
| 126 void ExitWarningHandler::TimerAction() { | 126 void ExitWarningHandler::TimerAction() { |
| 127 Hide(); | 127 Hide(); |
| 128 if (state_ == WAIT_FOR_DOUBLE_PRESS) | 128 if (state_ == WAIT_FOR_DOUBLE_PRESS) |
| 129 state_ = IDLE; | 129 state_ = IDLE; |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 167 widget_->Show(); | 167 widget_->Show(); |
| 168 | 168 |
| 169 delegate->NotifyAccessibilityEvent(ui::AX_EVENT_ALERT, true); | 169 delegate->NotifyAccessibilityEvent(ui::AX_EVENT_ALERT, true); |
| 170 } | 170 } |
| 171 | 171 |
| 172 void ExitWarningHandler::Hide() { | 172 void ExitWarningHandler::Hide() { |
| 173 widget_.reset(); | 173 widget_.reset(); |
| 174 } | 174 } |
| 175 | 175 |
| 176 } // namespace ash | 176 } // namespace ash |
| OLD | NEW |