Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(640)

Side by Side Diff: remoting/host/it2me/it2me_confirmation_dialog_chromeos.cc

Issue 1864213002: Convert //remoting to use std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Mac IWYU Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « remoting/host/it2me/it2me_confirmation_dialog.cc ('k') | remoting/host/it2me/it2me_confirmation_dialog_proxy.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698