OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #ifndef CHROME_BROWSER_UI_VIEWS_EXTERNAL_PROTOCOL_DIALOG_H_ | 5 #ifndef CHROME_BROWSER_UI_VIEWS_EXTERNAL_PROTOCOL_DIALOG_H_ |
6 #define CHROME_BROWSER_UI_VIEWS_EXTERNAL_PROTOCOL_DIALOG_H_ | 6 #define CHROME_BROWSER_UI_VIEWS_EXTERNAL_PROTOCOL_DIALOG_H_ |
7 | 7 |
8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
9 #include "base/macros.h" | 9 #include "base/macros.h" |
10 #include "base/time/time.h" | 10 #include "base/time/time.h" |
11 #include "ui/views/window/dialog_delegate.h" | 11 #include "ui/views/window/dialog_delegate.h" |
12 #include "url/gurl.h" | 12 #include "url/gurl.h" |
13 | 13 |
14 class ProtocolDialogDelegate; | 14 class ProtocolDialogDelegate; |
15 | 15 |
| 16 namespace test { |
| 17 class ExternalProtocolDialogTestApi; |
| 18 } |
| 19 |
16 namespace views { | 20 namespace views { |
17 class MessageBoxView; | 21 class MessageBoxView; |
18 } | 22 } |
19 | 23 |
20 class ExternalProtocolDialog : public views::DialogDelegate { | 24 class ExternalProtocolDialog : public views::DialogDelegate { |
21 public: | 25 public: |
22 // RunExternalProtocolDialog calls this private constructor. | 26 // RunExternalProtocolDialog calls this private constructor. |
23 ExternalProtocolDialog(std::unique_ptr<const ProtocolDialogDelegate> delegate, | 27 ExternalProtocolDialog(std::unique_ptr<const ProtocolDialogDelegate> delegate, |
24 int render_process_host_id, | 28 int render_process_host_id, |
25 int routing_id); | 29 int routing_id); |
26 | 30 |
27 ~ExternalProtocolDialog() override; | 31 ~ExternalProtocolDialog() override; |
28 | 32 |
29 // views::DialogDelegate methods: | 33 // views::DialogDelegate methods: |
30 int GetDefaultDialogButton() const override; | 34 int GetDefaultDialogButton() const override; |
31 base::string16 GetDialogButtonLabel(ui::DialogButton button) const override; | 35 base::string16 GetDialogButtonLabel(ui::DialogButton button) const override; |
32 base::string16 GetWindowTitle() const override; | 36 base::string16 GetWindowTitle() const override; |
33 void DeleteDelegate() override; | 37 void DeleteDelegate() override; |
34 bool Cancel() override; | 38 bool Cancel() override; |
35 bool Accept() override; | 39 bool Accept() override; |
36 bool Close() override; | 40 bool Close() override; |
37 views::View* GetContentsView() override; | 41 views::View* GetContentsView() override; |
38 views::Widget* GetWidget() override; | 42 views::Widget* GetWidget() override; |
39 const views::Widget* GetWidget() const override; | 43 const views::Widget* GetWidget() const override; |
40 ui::ModalType GetModalType() const override; | 44 ui::ModalType GetModalType() const override; |
41 | 45 |
42 private: | 46 private: |
| 47 friend class test::ExternalProtocolDialogTestApi; |
| 48 |
43 const std::unique_ptr<const ProtocolDialogDelegate> delegate_; | 49 const std::unique_ptr<const ProtocolDialogDelegate> delegate_; |
44 | 50 |
45 // The message box view whose commands we handle. | 51 // The message box view whose commands we handle. |
46 views::MessageBoxView* message_box_view_; | 52 views::MessageBoxView* message_box_view_; |
47 | 53 |
48 // IDs of the associated WebContents. | 54 // IDs of the associated WebContents. |
49 int render_process_host_id_; | 55 int render_process_host_id_; |
50 int routing_id_; | 56 int routing_id_; |
51 | 57 |
52 // The time at which this dialog was created. | 58 // The time at which this dialog was created. |
53 base::TimeTicks creation_time_; | 59 base::TimeTicks creation_time_; |
54 | 60 |
55 DISALLOW_COPY_AND_ASSIGN(ExternalProtocolDialog); | 61 DISALLOW_COPY_AND_ASSIGN(ExternalProtocolDialog); |
56 }; | 62 }; |
57 | 63 |
58 #endif // CHROME_BROWSER_UI_VIEWS_EXTERNAL_PROTOCOL_DIALOG_H_ | 64 #endif // CHROME_BROWSER_UI_VIEWS_EXTERNAL_PROTOCOL_DIALOG_H_ |
OLD | NEW |