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