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 "base/bind.h" | 5 #include "base/bind.h" |
6 #include "base/callback_helpers.h" | 6 #include "base/callback_helpers.h" |
7 #include "base/location.h" | 7 #include "base/location.h" |
8 #include "base/macros.h" | 8 #include "base/macros.h" |
9 #include "base/memory/weak_ptr.h" | 9 #include "base/memory/weak_ptr.h" |
10 #include "base/single_thread_task_runner.h" | 10 #include "base/single_thread_task_runner.h" |
(...skipping 10 matching lines...) Expand all Loading... |
21 It2MeConfirmationDialogChromeOS(); | 21 It2MeConfirmationDialogChromeOS(); |
22 ~It2MeConfirmationDialogChromeOS() override; | 22 ~It2MeConfirmationDialogChromeOS() override; |
23 | 23 |
24 // It2MeConfirmationDialog implementation. | 24 // It2MeConfirmationDialog implementation. |
25 void Show(const ResultCallback& callback) override; | 25 void Show(const ResultCallback& callback) override; |
26 | 26 |
27 private: | 27 private: |
28 // Handles result from |message_box_|. | 28 // Handles result from |message_box_|. |
29 void OnMessageBoxResult(MessageBox::Result result); | 29 void OnMessageBoxResult(MessageBox::Result result); |
30 | 30 |
31 scoped_ptr<MessageBox> message_box_; | 31 std::unique_ptr<MessageBox> message_box_; |
32 ResultCallback callback_; | 32 ResultCallback callback_; |
33 | 33 |
34 DISALLOW_COPY_AND_ASSIGN(It2MeConfirmationDialogChromeOS); | 34 DISALLOW_COPY_AND_ASSIGN(It2MeConfirmationDialogChromeOS); |
35 }; | 35 }; |
36 | 36 |
37 It2MeConfirmationDialogChromeOS::It2MeConfirmationDialogChromeOS() {} | 37 It2MeConfirmationDialogChromeOS::It2MeConfirmationDialogChromeOS() {} |
38 | 38 |
39 It2MeConfirmationDialogChromeOS::~It2MeConfirmationDialogChromeOS() {} | 39 It2MeConfirmationDialogChromeOS::~It2MeConfirmationDialogChromeOS() {} |
40 | 40 |
41 void It2MeConfirmationDialogChromeOS::Show(const ResultCallback& callback) { | 41 void It2MeConfirmationDialogChromeOS::Show(const ResultCallback& callback) { |
(...skipping 10 matching lines...) Expand all Loading... |
52 message_box_->Show(); | 52 message_box_->Show(); |
53 } | 53 } |
54 | 54 |
55 void It2MeConfirmationDialogChromeOS::OnMessageBoxResult( | 55 void It2MeConfirmationDialogChromeOS::OnMessageBoxResult( |
56 MessageBox::Result result) { | 56 MessageBox::Result result) { |
57 message_box_->Hide(); | 57 message_box_->Hide(); |
58 base::ResetAndReturn(&callback_).Run(result == MessageBox::OK ? | 58 base::ResetAndReturn(&callback_).Run(result == MessageBox::OK ? |
59 Result::OK : Result::CANCEL); | 59 Result::OK : Result::CANCEL); |
60 } | 60 } |
61 | 61 |
62 scoped_ptr<It2MeConfirmationDialog> It2MeConfirmationDialogFactory::Create() { | 62 std::unique_ptr<It2MeConfirmationDialog> |
63 return scoped_ptr<It2MeConfirmationDialog>( | 63 It2MeConfirmationDialogFactory::Create() { |
| 64 return std::unique_ptr<It2MeConfirmationDialog>( |
64 new It2MeConfirmationDialogChromeOS()); | 65 new It2MeConfirmationDialogChromeOS()); |
65 } | 66 } |
66 | 67 |
67 } // namespace remoting | 68 } // namespace remoting |
OLD | NEW |