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