| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "athena/system/shutdown_dialog.h" | 5 #include "athena/system/shutdown_dialog.h" |
| 6 | 6 |
| 7 #include "athena/screen/public/screen_manager.h" | 7 #include "athena/screen/public/screen_manager.h" |
| 8 #include "athena/strings/grit/athena_strings.h" | 8 #include "athena/strings/grit/athena_strings.h" |
| 9 #include "chromeos/dbus/dbus_thread_manager.h" | 9 #include "chromeos/dbus/dbus_thread_manager.h" |
| 10 #include "chromeos/dbus/power_manager_client.h" | 10 #include "chromeos/dbus/power_manager_client.h" |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 namespace { | 21 namespace { |
| 22 | 22 |
| 23 // The amount of time that the power button must be held to shut down the | 23 // The amount of time that the power button must be held to shut down the |
| 24 // device after shutdown dialog is shown. | 24 // device after shutdown dialog is shown. |
| 25 const int kShutdownTimeoutMs = 4000; | 25 const int kShutdownTimeoutMs = 4000; |
| 26 | 26 |
| 27 class ModalWidgetDelegate : public views::WidgetDelegate { | 27 class ModalWidgetDelegate : public views::WidgetDelegate { |
| 28 public: | 28 public: |
| 29 explicit ModalWidgetDelegate(views::View* contents_view) | 29 explicit ModalWidgetDelegate(views::View* contents_view) |
| 30 : contents_view_(contents_view) {} | 30 : contents_view_(contents_view) {} |
| 31 virtual ~ModalWidgetDelegate() {} | 31 ~ModalWidgetDelegate() override {} |
| 32 | 32 |
| 33 // Overridden from WidgetDelegate: | 33 // Overridden from WidgetDelegate: |
| 34 virtual views::Widget* GetWidget() override { | 34 virtual views::Widget* GetWidget() override { |
| 35 return contents_view_->GetWidget(); | 35 return contents_view_->GetWidget(); |
| 36 } | 36 } |
| 37 virtual const views::Widget* GetWidget() const override { | 37 virtual const views::Widget* GetWidget() const override { |
| 38 return contents_view_->GetWidget(); | 38 return contents_view_->GetWidget(); |
| 39 } | 39 } |
| 40 virtual views::View* GetContentsView() override { return contents_view_; } | 40 virtual views::View* GetContentsView() override { return contents_view_; } |
| 41 virtual ui::ModalType GetModalType() const override { | 41 virtual ui::ModalType GetModalType() const override { |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 120 ->RequestSuspend(); | 120 ->RequestSuspend(); |
| 121 } | 121 } |
| 122 state_ = STATE_OTHER; | 122 state_ = STATE_OTHER; |
| 123 timer_.Stop(); | 123 timer_.Stop(); |
| 124 shutdown_warning_message_.reset(); | 124 shutdown_warning_message_.reset(); |
| 125 break; | 125 break; |
| 126 } | 126 } |
| 127 } | 127 } |
| 128 | 128 |
| 129 } // namespace athena | 129 } // namespace athena |
| OLD | NEW |