Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef CHROME_BROWSER_UI_VIEWS_EXTENSIONS_CHOOSER_DIALOG_VIEW_H_ | |
| 6 #define CHROME_BROWSER_UI_VIEWS_EXTENSIONS_CHOOSER_DIALOG_VIEW_H_ | |
| 7 | |
| 8 #include "base/macros.h" | |
| 9 #include "ui/views/controls/styled_label_listener.h" | |
| 10 #include "ui/views/controls/table/table_view_observer.h" | |
| 11 #include "ui/views/window/dialog_delegate.h" | |
| 12 | |
| 13 class ChooserContentView; | |
| 14 class ChooserController; | |
| 15 | |
| 16 namespace content { | |
| 17 class WebContents; | |
| 18 } | |
| 19 | |
| 20 namespace ui { | |
| 21 class TableModel; | |
| 22 } | |
| 23 | |
| 24 namespace views { | |
| 25 class TableView; | |
| 26 } | |
| 27 | |
| 28 // Displays a chooser view as a modal dialog constrained | |
| 29 // to the window/tab displaying the given web contents. | |
| 30 class ChooserDialogView : public views::DialogDelegateView, | |
| 31 public views::StyledLabelListener, | |
| 32 public views::TableViewObserver { | |
| 33 public: | |
| 34 ChooserDialogView(content::WebContents* web_contents, | |
| 35 ChooserController* chooser_controller); | |
| 36 ~ChooserDialogView() override; | |
| 37 | |
| 38 // views::View: | |
| 39 gfx::Size GetPreferredSize() const override; | |
| 40 | |
| 41 // views::WidgetDelegate: | |
| 42 base::string16 GetWindowTitle() const override; | |
| 43 bool ShouldShowCloseButton() const override; | |
| 44 ui::ModalType GetModalType() const override; | |
| 45 | |
| 46 // views::DialogDelegate: | |
| 47 base::string16 GetDialogButtonLabel(ui::DialogButton button) const override; | |
| 48 bool IsDialogButtonEnabled(ui::DialogButton button) const override; | |
| 49 views::View* CreateFootnoteView() override; | |
| 50 bool Accept() override; | |
| 51 bool Cancel() override; | |
| 52 bool Close() override; | |
| 53 | |
| 54 // views::StyledLabelListener: | |
| 55 void StyledLabelLinkClicked(views::StyledLabel* label, | |
| 56 const gfx::Range& range, | |
| 57 int event_flags) override; | |
| 58 | |
| 59 // views::TableViewObserver: | |
| 60 void OnSelectionChanged() override; | |
| 61 | |
| 62 private: | |
| 63 friend class ChooserDialogViewTest; | |
|
msw
2016/06/08 01:16:32
nit: remove this, add public table_view_for_test()
juncai
2016/06/09 01:59:53
Done.
| |
| 64 std::unique_ptr<ChooserContentView> chooser_content_view_; | |
| 65 content::WebContents* web_contents_; | |
| 66 ChooserController* chooser_controller_; | |
| 67 views::TableView* table_view_; | |
| 68 // Weak. Owned by ChooserContentView. | |
| 69 ui::TableModel* table_model_; | |
| 70 | |
| 71 DISALLOW_COPY_AND_ASSIGN(ChooserDialogView); | |
| 72 }; | |
| 73 | |
| 74 #endif // CHROME_BROWSER_UI_VIEWS_EXTENSIONS_CHOOSER_DIALOG_VIEW_H_ | |
| OLD | NEW |