Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef REMOTING_HOST_IT2ME_IT2ME_CONFIRMATION_DIALOG_PROXY_H_ | |
| 6 #define REMOTING_HOST_IT2ME_IT2ME_CONFIRMATION_DIALOG_PROXY_H_ | |
| 7 | |
| 8 #include "base/callback.h" | |
| 9 #include "base/memory/ref_counted.h" | |
| 10 #include "base/memory/weak_ptr.h" | |
| 11 #include "base/single_thread_task_runner.h" | |
| 12 #include "base/threading/non_thread_safe.h" | |
| 13 #include "remoting/host/it2me/it2me_confirmation_dialog.h" | |
| 14 | |
| 15 namespace remoting { | |
| 16 | |
| 17 class It2MeConfirmationDialogProxy { | |
|
Sergey Ulanov
2014/12/19 03:16:19
should this implement It2MeConfirmationDialog?
dcaiafa
2014/12/20 00:22:00
Done.
| |
| 18 public: | |
| 19 It2MeConfirmationDialogProxy( | |
| 20 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner, | |
| 21 scoped_refptr<base::SingleThreadTaskRunner> caller_task_runner, | |
| 22 scoped_ptr<It2MeConfirmationDialog> dialog); | |
| 23 | |
| 24 ~It2MeConfirmationDialogProxy(); | |
| 25 | |
| 26 void Show(const It2MeConfirmationDialog::ResultCallback& callback); | |
| 27 | |
| 28 private: | |
| 29 class Core : public base::RefCountedThreadSafe<Core> { | |
|
Sergey Ulanov
2014/12/19 03:16:19
don't need this to be ref-counted. Use DeleteSoon(
Sergey Ulanov
2014/12/19 03:16:19
this can be moved to the .cc file.
dcaiafa
2014/12/20 00:22:00
Done.
dcaiafa
2014/12/20 00:22:00
Done.
| |
| 30 public: | |
| 31 Core(scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner, | |
| 32 scoped_refptr<base::SingleThreadTaskRunner> caller_task_runner, | |
| 33 base::WeakPtr<It2MeConfirmationDialogProxy> parent, | |
| 34 scoped_ptr<It2MeConfirmationDialog> dialog); | |
| 35 | |
| 36 void Show(); | |
| 37 | |
| 38 private: | |
| 39 friend base::RefCountedThreadSafe<Core>; | |
| 40 | |
| 41 ~Core(); | |
| 42 void ReportResult(It2MeConfirmationDialog::Result result); | |
| 43 | |
| 44 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner_; | |
| 45 scoped_refptr<base::SingleThreadTaskRunner> caller_task_runner_; | |
| 46 base::WeakPtr<It2MeConfirmationDialogProxy> parent_; | |
| 47 scoped_ptr<It2MeConfirmationDialog> dialog_; | |
| 48 }; | |
| 49 | |
| 50 void ReportResult(It2MeConfirmationDialog::Result result); | |
| 51 | |
| 52 scoped_refptr<Core> core_; | |
| 53 It2MeConfirmationDialog::ResultCallback callback_; | |
| 54 base::WeakPtrFactory<It2MeConfirmationDialogProxy> weak_factory_; | |
| 55 }; | |
| 56 | |
| 57 } // namespace remoting | |
| 58 | |
| 59 #endif // REMOTING_HOST_IT2ME_IT2ME_CONFIRMATION_DIALOG_PROXY_H_ | |
| OLD | NEW |