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 "remoting/host/continue_window.h" | 5 #include "remoting/host/continue_window.h" |
6 | 6 |
7 #include "base/macros.h" | 7 #include "base/macros.h" |
| 8 #include "base/memory/ptr_util.h" |
8 #include "remoting/base/string_resources.h" | 9 #include "remoting/base/string_resources.h" |
9 #include "remoting/host/chromeos/message_box.h" | 10 #include "remoting/host/chromeos/message_box.h" |
10 #include "ui/base/l10n/l10n_util.h" | 11 #include "ui/base/l10n/l10n_util.h" |
11 | 12 |
12 namespace remoting { | 13 namespace remoting { |
13 | 14 |
14 namespace { | 15 namespace { |
15 | 16 |
16 class ContinueWindowAura : public ContinueWindow { | 17 class ContinueWindowAura : public ContinueWindow { |
17 public: | 18 public: |
18 ContinueWindowAura(); | 19 ContinueWindowAura(); |
19 ~ContinueWindowAura() override; | 20 ~ContinueWindowAura() override; |
20 | 21 |
21 void OnMessageBoxResult(MessageBox::Result result); | 22 void OnMessageBoxResult(MessageBox::Result result); |
22 | 23 |
23 protected: | 24 protected: |
24 // ContinueWindow interface. | 25 // ContinueWindow interface. |
25 void ShowUi() override; | 26 void ShowUi() override; |
26 void HideUi() override; | 27 void HideUi() override; |
27 | 28 |
28 private: | 29 private: |
29 scoped_ptr<MessageBox> message_box_; | 30 std::unique_ptr<MessageBox> message_box_; |
30 DISALLOW_COPY_AND_ASSIGN(ContinueWindowAura); | 31 DISALLOW_COPY_AND_ASSIGN(ContinueWindowAura); |
31 }; | 32 }; |
32 | 33 |
33 ContinueWindowAura::ContinueWindowAura() { | 34 ContinueWindowAura::ContinueWindowAura() { |
34 message_box_.reset(new MessageBox( | 35 message_box_.reset(new MessageBox( |
35 l10n_util::GetStringUTF16(IDS_MODE_IT2ME), // title | 36 l10n_util::GetStringUTF16(IDS_MODE_IT2ME), // title |
36 l10n_util::GetStringUTF16(IDS_CONTINUE_PROMPT), // dialog label | 37 l10n_util::GetStringUTF16(IDS_CONTINUE_PROMPT), // dialog label |
37 l10n_util::GetStringUTF16(IDS_CONTINUE_BUTTON), // ok label | 38 l10n_util::GetStringUTF16(IDS_CONTINUE_BUTTON), // ok label |
38 l10n_util::GetStringUTF16(IDS_STOP_SHARING_BUTTON), // cancel label | 39 l10n_util::GetStringUTF16(IDS_STOP_SHARING_BUTTON), // cancel label |
39 base::Bind(&ContinueWindowAura::OnMessageBoxResult, | 40 base::Bind(&ContinueWindowAura::OnMessageBoxResult, |
(...skipping 16 matching lines...) Expand all Loading... |
56 message_box_->Show(); | 57 message_box_->Show(); |
57 } | 58 } |
58 | 59 |
59 void ContinueWindowAura::HideUi() { | 60 void ContinueWindowAura::HideUi() { |
60 message_box_->Hide(); | 61 message_box_->Hide(); |
61 } | 62 } |
62 | 63 |
63 } // namespace | 64 } // namespace |
64 | 65 |
65 // static | 66 // static |
66 scoped_ptr<HostWindow> HostWindow::CreateContinueWindow() { | 67 std::unique_ptr<HostWindow> HostWindow::CreateContinueWindow() { |
67 return make_scoped_ptr(new ContinueWindowAura()); | 68 return base::WrapUnique(new ContinueWindowAura()); |
68 } | 69 } |
69 | 70 |
70 } // namespace remoting | 71 } // namespace remoting |
OLD | NEW |