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_CHOOSER_CONTENT_VIEW_H_ | |
| 6 #define CHROME_BROWSER_UI_VIEWS_CHOOSER_CONTENT_VIEW_H_ | |
| 7 | |
| 8 #include "base/macros.h" | |
| 9 #include "ui/views/bubble/bubble_dialog_delegate.h" | |
| 10 #include "ui/views/controls/styled_label_listener.h" | |
| 11 #include "ui/views/controls/table/table_view_observer.h" | |
| 12 | |
| 13 class ChooserController; | |
| 14 class ChooserTableModel; | |
| 15 | |
| 16 // A chooser content view class that user can select an option. | |
|
msw
2016/06/03 20:04:08
nit: "A bubble or dialog view for choosing among s
juncai
2016/06/07 18:11:05
Done.
| |
| 17 class ChooserContentView : public views::BubbleDialogDelegateView, | |
| 18 public views::StyledLabelListener, | |
| 19 public views::TableViewObserver { | |
| 20 public: | |
| 21 ChooserContentView(views::View* anchor_view, | |
| 22 views::BubbleBorder::Arrow anchor_arrow, | |
| 23 ChooserController* chooser_controller); | |
| 24 ~ChooserContentView() override; | |
| 25 | |
| 26 // views::BubbleDialogDelegateView: | |
| 27 bool ShouldShowWindowTitle() const override; | |
| 28 base::string16 GetDialogButtonLabel(ui::DialogButton button) const override; | |
| 29 bool IsDialogButtonEnabled(ui::DialogButton button) const override; | |
| 30 views::View* CreateFootnoteView() override; | |
| 31 | |
| 32 // views::StyledLabelListener: | |
| 33 void StyledLabelLinkClicked(views::StyledLabel* label, | |
| 34 const gfx::Range& range, | |
| 35 int event_flags) override; | |
| 36 | |
| 37 // views::TableViewObserver: | |
| 38 void OnSelectionChanged() override; | |
| 39 | |
| 40 // Called by the destructor of the class that passed |chooser_controller_| | |
|
msw
2016/06/03 20:04:09
nit: "Called just before |chooser_controller_| is
juncai
2016/06/07 18:11:05
Done.
| |
| 41 // to this class. Since the |chooser_controller_| passed to this class may | |
| 42 // be destroyed and not be used any more. | |
| 43 void ChooserControllerDestroying(); | |
| 44 | |
| 45 protected: | |
| 46 ChooserController* chooser_controller() const { return chooser_controller_; } | |
| 47 views::TableView* table_view() const { return table_view_; } | |
| 48 | |
| 49 private: | |
| 50 ChooserController* chooser_controller_; // Weak. | |
| 51 views::TableView* table_view_; | |
| 52 ChooserTableModel* chooser_table_model_; | |
| 53 DISALLOW_COPY_AND_ASSIGN(ChooserContentView); | |
| 54 }; | |
| 55 | |
| 56 #endif // CHROME_BROWSER_UI_VIEWS_CHOOSER_CONTENT_VIEW_H_ | |
| OLD | NEW |