OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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_EXTENSIONS_CHOOSER_DIALOG_VIEW_H_ | 5 #ifndef CHROME_BROWSER_UI_VIEWS_EXTENSIONS_CHOOSER_DIALOG_VIEW_H_ |
6 #define CHROME_BROWSER_UI_VIEWS_EXTENSIONS_CHOOSER_DIALOG_VIEW_H_ | 6 #define CHROME_BROWSER_UI_VIEWS_EXTENSIONS_CHOOSER_DIALOG_VIEW_H_ |
7 | 7 |
| 8 #include <memory> |
| 9 |
8 #include "base/macros.h" | 10 #include "base/macros.h" |
9 #include "ui/views/controls/styled_label_listener.h" | 11 #include "ui/views/controls/styled_label_listener.h" |
10 #include "ui/views/controls/table/table_view_observer.h" | 12 #include "ui/views/controls/table/table_view_observer.h" |
11 #include "ui/views/window/dialog_delegate.h" | 13 #include "ui/views/window/dialog_delegate.h" |
| 14 #include "url/origin.h" |
12 | 15 |
13 class ChooserContentView; | 16 class ChooserContentView; |
14 class ChooserController; | 17 class ChooserController; |
15 | 18 |
16 namespace content { | 19 namespace content { |
17 class WebContents; | 20 class WebContents; |
18 } | 21 } |
19 | 22 |
20 namespace views { | 23 namespace views { |
21 class TableView; | 24 class TableView; |
22 } | 25 } |
23 | 26 |
24 // Displays a chooser view as a modal dialog constrained | 27 // Displays a chooser view as a modal dialog constrained |
25 // to the window/tab displaying the given web contents. | 28 // to the window/tab displaying the given web contents. |
26 class ChooserDialogView : public views::DialogDelegateView, | 29 class ChooserDialogView : public views::DialogDelegateView, |
27 public views::StyledLabelListener, | 30 public views::StyledLabelListener, |
28 public views::TableViewObserver { | 31 public views::TableViewObserver { |
29 public: | 32 public: |
30 ChooserDialogView(content::WebContents* web_contents, | 33 ChooserDialogView(content::WebContents* web_contents, |
31 ChooserController* chooser_controller); | 34 std::unique_ptr<ChooserController> chooser_controller); |
32 ~ChooserDialogView() override; | 35 ~ChooserDialogView() override; |
33 | 36 |
34 // views::WidgetDelegate: | 37 // views::WidgetDelegate: |
35 base::string16 GetWindowTitle() const override; | 38 base::string16 GetWindowTitle() const override; |
36 bool ShouldShowCloseButton() const override; | 39 bool ShouldShowCloseButton() const override; |
37 ui::ModalType GetModalType() const override; | 40 ui::ModalType GetModalType() const override; |
38 | 41 |
39 // views::DialogDelegate: | 42 // views::DialogDelegate: |
40 base::string16 GetDialogButtonLabel(ui::DialogButton button) const override; | 43 base::string16 GetDialogButtonLabel(ui::DialogButton button) const override; |
41 bool IsDialogButtonEnabled(ui::DialogButton button) const override; | 44 bool IsDialogButtonEnabled(ui::DialogButton button) const override; |
(...skipping 11 matching lines...) Expand all Loading... |
53 void StyledLabelLinkClicked(views::StyledLabel* label, | 56 void StyledLabelLinkClicked(views::StyledLabel* label, |
54 const gfx::Range& range, | 57 const gfx::Range& range, |
55 int event_flags) override; | 58 int event_flags) override; |
56 | 59 |
57 // views::TableViewObserver: | 60 // views::TableViewObserver: |
58 void OnSelectionChanged() override; | 61 void OnSelectionChanged() override; |
59 | 62 |
60 views::TableView* table_view_for_test() const; | 63 views::TableView* table_view_for_test() const; |
61 | 64 |
62 private: | 65 private: |
| 66 content::WebContents* web_contents_; |
| 67 url::Origin origin_; |
63 ChooserContentView* chooser_content_view_; | 68 ChooserContentView* chooser_content_view_; |
64 content::WebContents* web_contents_; | |
65 ChooserController* chooser_controller_; | |
66 | 69 |
67 DISALLOW_COPY_AND_ASSIGN(ChooserDialogView); | 70 DISALLOW_COPY_AND_ASSIGN(ChooserDialogView); |
68 }; | 71 }; |
69 | 72 |
70 #endif // CHROME_BROWSER_UI_VIEWS_EXTENSIONS_CHOOSER_DIALOG_VIEW_H_ | 73 #endif // CHROME_BROWSER_UI_VIEWS_EXTENSIONS_CHOOSER_DIALOG_VIEW_H_ |
OLD | NEW |