| 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 <memory> |
| 9 |
| 10 #include "base/macros.h" |
| 11 #include "base/strings/string16.h" |
| 12 #include "ui/base/ui_base_types.h" |
| 13 #include "ui/views/view.h" |
| 14 |
| 15 class ChooserController; |
| 16 class ChooserTableModel; |
| 17 |
| 18 namespace ui { |
| 19 class TableModel; |
| 20 } |
| 21 |
| 22 namespace views { |
| 23 class StyledLabel; |
| 24 class StyledLabelListener; |
| 25 class TableView; |
| 26 class TableViewObserver; |
| 27 } |
| 28 |
| 29 // A bubble or dialog view for choosing among several options in a table. |
| 30 // Used for WebUSB/WebBluetooth device selection for Chrome and extensions. |
| 31 class ChooserContentView : public views::View { |
| 32 public: |
| 33 ChooserContentView(views::TableViewObserver* observer, |
| 34 ChooserController* chooser_controller); |
| 35 ~ChooserContentView() override; |
| 36 |
| 37 // views::View: |
| 38 gfx::Size GetPreferredSize() const override; |
| 39 |
| 40 base::string16 GetDialogButtonLabel(ui::DialogButton button) const; |
| 41 bool IsDialogButtonEnabled(ui::DialogButton button) const; |
| 42 // Ownership of the view is passed to the caller. |
| 43 views::StyledLabel* CreateFootnoteView( |
| 44 views::StyledLabelListener* listener) const; |
| 45 void Accept(); |
| 46 void Cancel(); |
| 47 void Close(); |
| 48 void StyledLabelLinkClicked() const; |
| 49 void UpdateTableModel(); |
| 50 |
| 51 views::TableView* table_view_for_test() const { return table_view_; } |
| 52 |
| 53 private: |
| 54 void ChooserControllerDestroying(); |
| 55 |
| 56 ChooserController* chooser_controller_; // Weak. |
| 57 views::TableView* table_view_; |
| 58 std::unique_ptr<ChooserTableModel> chooser_table_model_; |
| 59 |
| 60 DISALLOW_COPY_AND_ASSIGN(ChooserContentView); |
| 61 }; |
| 62 |
| 63 #endif // CHROME_BROWSER_UI_VIEWS_CHOOSER_CONTENT_VIEW_H_ |
| OLD | NEW |