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

Side by Side Diff: chrome/browser/ui/views/external_protocol_dialog.h

Issue 2610793002: Add a browser test for the views external protocol dialog. (Closed)
Patch Set: CreateDialog is a macro on Windows -_- Created 3 years, 11 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 (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 views { 16 namespace views {
17 class MessageBoxView; 17 class MessageBoxView;
18 } 18 }
19 19
20 class ExternalProtocolDialog : public views::DialogDelegate { 20 class ExternalProtocolDialog : public views::DialogDelegate {
21 public: 21 public:
22 // RunExternalProtocolDialog calls this private constructor. 22 // RunExternalProtocolDialog calls this private constructor.
23 ExternalProtocolDialog(std::unique_ptr<const ProtocolDialogDelegate> delegate, 23 ExternalProtocolDialog(std::unique_ptr<const ProtocolDialogDelegate> delegate,
24 int render_process_host_id, 24 int render_process_host_id,
25 int routing_id); 25 int routing_id);
26 26
27 ~ExternalProtocolDialog() override; 27 ~ExternalProtocolDialog() override;
28 void SetCheckBoxSelectedForTesting(bool checked);
tapted 2017/01/04 23:32:49 instead of this, you can do namespace test { clas
dominickn 2017/01/04 23:51:35 Done.
28 29
29 // views::DialogDelegate methods: 30 // views::DialogDelegate methods:
30 int GetDefaultDialogButton() const override; 31 int GetDefaultDialogButton() const override;
31 base::string16 GetDialogButtonLabel(ui::DialogButton button) const override; 32 base::string16 GetDialogButtonLabel(ui::DialogButton button) const override;
32 base::string16 GetWindowTitle() const override; 33 base::string16 GetWindowTitle() const override;
33 void DeleteDelegate() override; 34 void DeleteDelegate() override;
34 bool Cancel() override; 35 bool Cancel() override;
35 bool Accept() override; 36 bool Accept() override;
36 bool Close() override; 37 bool Close() override;
37 views::View* GetContentsView() override; 38 views::View* GetContentsView() override;
38 views::Widget* GetWidget() override; 39 views::Widget* GetWidget() override;
39 const views::Widget* GetWidget() const override; 40 const views::Widget* GetWidget() const override;
40 ui::ModalType GetModalType() const override; 41 ui::ModalType GetModalType() const override;
41 42
42 private: 43 private:
43 const std::unique_ptr<const ProtocolDialogDelegate> delegate_; 44 const std::unique_ptr<const ProtocolDialogDelegate> delegate_;
tapted 2017/01/04 23:32:49 friend class test::ExternalProtocolDialogTestApi;
dominickn 2017/01/04 23:51:35 Done.
44 45
45 // The message box view whose commands we handle. 46 // The message box view whose commands we handle.
46 views::MessageBoxView* message_box_view_; 47 views::MessageBoxView* message_box_view_;
47 48
48 // IDs of the associated WebContents. 49 // IDs of the associated WebContents.
49 int render_process_host_id_; 50 int render_process_host_id_;
50 int routing_id_; 51 int routing_id_;
51 52
52 // The time at which this dialog was created. 53 // The time at which this dialog was created.
53 base::TimeTicks creation_time_; 54 base::TimeTicks creation_time_;
54 55
55 DISALLOW_COPY_AND_ASSIGN(ExternalProtocolDialog); 56 DISALLOW_COPY_AND_ASSIGN(ExternalProtocolDialog);
56 }; 57 };
57 58
58 #endif // CHROME_BROWSER_UI_VIEWS_EXTERNAL_PROTOCOL_DIALOG_H_ 59 #endif // CHROME_BROWSER_UI_VIEWS_EXTERNAL_PROTOCOL_DIALOG_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698