OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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_WEBSITE_SETTINGS_CHOSEN_OBJECT_VIEW_H_ | 5 #ifndef CHROME_BROWSER_UI_VIEWS_WEBSITE_SETTINGS_CHOSEN_OBJECT_ROW_H_ |
6 #define CHROME_BROWSER_UI_VIEWS_WEBSITE_SETTINGS_CHOSEN_OBJECT_VIEW_H_ | 6 #define CHROME_BROWSER_UI_VIEWS_WEBSITE_SETTINGS_CHOSEN_OBJECT_ROW_H_ |
7 | 7 |
8 #include "base/macros.h" | 8 #include "base/macros.h" |
9 #include "chrome/browser/ui/website_settings/website_settings_ui.h" | 9 #include "chrome/browser/ui/website_settings/website_settings_ui.h" |
10 #include "ui/views/controls/button/button.h" | 10 #include "ui/views/controls/button/button.h" |
11 #include "ui/views/view.h" | 11 #include "ui/views/view.h" |
12 | 12 |
13 namespace views { | 13 namespace views { |
14 class ImageButton; | 14 class ImageButton; |
15 class ImageView; | 15 class ImageView; |
16 } | 16 } |
17 | 17 |
18 class ChosenObjectViewObserver; | 18 class ChosenObjectRowObserver; |
19 | 19 |
20 class ChosenObjectView : public views::View, public views::ButtonListener { | 20 // A ChosenObjectRow is a row in the Page Info bubble that shows an individual |
| 21 // object (e.g. a Bluetooth device, a USB device) that the current site has |
| 22 // access to. |
| 23 class ChosenObjectRow : public views::View, public views::ButtonListener { |
21 public: | 24 public: |
22 explicit ChosenObjectView( | 25 explicit ChosenObjectRow( |
23 std::unique_ptr<WebsiteSettingsUI::ChosenObjectInfo> info); | 26 std::unique_ptr<WebsiteSettingsUI::ChosenObjectInfo> info); |
24 | 27 |
25 void AddObserver(ChosenObjectViewObserver* observer); | 28 void AddObserver(ChosenObjectRowObserver* observer); |
26 | 29 |
27 private: | 30 private: |
28 ~ChosenObjectView() override; | 31 ~ChosenObjectRow() override; |
29 | 32 |
30 // views::ButtonListener implementation. | 33 // views::ButtonListener implementation. |
31 void ButtonPressed(views::Button* sender, const ui::Event& event) override; | 34 void ButtonPressed(views::Button* sender, const ui::Event& event) override; |
32 | 35 |
33 views::ImageView* icon_; // Owned by the views hierarchy. | 36 views::ImageView* icon_; // Owned by the views hierarchy. |
34 views::ImageButton* delete_button_; // Owned by the views hierarchy. | 37 views::ImageButton* delete_button_; // Owned by the views hierarchy. |
35 | 38 |
36 base::ObserverList<ChosenObjectViewObserver> observer_list_; | 39 base::ObserverList<ChosenObjectRowObserver> observer_list_; |
37 std::unique_ptr<WebsiteSettingsUI::ChosenObjectInfo> info_; | 40 std::unique_ptr<WebsiteSettingsUI::ChosenObjectInfo> info_; |
38 | 41 |
39 DISALLOW_COPY_AND_ASSIGN(ChosenObjectView); | 42 DISALLOW_COPY_AND_ASSIGN(ChosenObjectRow); |
40 }; | 43 }; |
41 | 44 |
42 #endif // CHROME_BROWSER_UI_VIEWS_WEBSITE_SETTINGS_CHOSEN_OBJECT_VIEW_H_ | 45 #endif // CHROME_BROWSER_UI_VIEWS_WEBSITE_SETTINGS_CHOSEN_OBJECT_ROW_H_ |
OLD | NEW |