| Index: chrome/browser/ui/views/website_settings/permission_selector_row.h
|
| diff --git a/chrome/browser/ui/views/website_settings/permission_selector_row.h b/chrome/browser/ui/views/website_settings/permission_selector_row.h
|
| index 28310c39feca93582f9dc6f9e09b8f8ee3889036..6407216c1d4e2fd40d866d60cbb268497fc35f2b 100644
|
| --- a/chrome/browser/ui/views/website_settings/permission_selector_row.h
|
| +++ b/chrome/browser/ui/views/website_settings/permission_selector_row.h
|
| @@ -27,30 +27,36 @@ class PermissionCombobox;
|
| class PermissionMenuButton;
|
| }
|
|
|
| +namespace test {
|
| +class WebsiteSettingsPopupViewTestApi;
|
| +}
|
| +
|
| namespace views {
|
| class GridLayout;
|
| class ImageView;
|
| +class Label;
|
| }
|
|
|
| -// A PermissionSelectorRow is a row in the Page Info bubble that shows a
|
| +// A |PermissionSelectorRow| is a row in the Page Info bubble that shows a
|
| // permission that a site can have ambient access to, and allows the user to
|
| -// control whether that access is granted.
|
| -class PermissionSelectorRow : public views::View {
|
| +// control whether that access is granted. A |PermissionSelectorRow| is not
|
| +// itself a |View|, but creates some |View|s, which end up owned by the |View|
|
| +// hierarchy.
|
| +class PermissionSelectorRow {
|
| public:
|
| + // The |PermissionSelectorRow|'s constituent views are added to |layout|.
|
| PermissionSelectorRow(Profile* profile,
|
| const GURL& url,
|
| - const WebsiteSettingsUI::PermissionInfo& permission);
|
| + const WebsiteSettingsUI::PermissionInfo& permission,
|
| + views::GridLayout* layout);
|
| + virtual ~PermissionSelectorRow();
|
|
|
| void AddObserver(PermissionSelectorRowObserver* observer);
|
|
|
| void PermissionChanged(const WebsiteSettingsUI::PermissionInfo& permission);
|
|
|
| - protected:
|
| - // Overridden from views::View.
|
| - void ChildPreferredSizeChanged(View* child) override;
|
| -
|
| private:
|
| - ~PermissionSelectorRow() override;
|
| + friend class test::WebsiteSettingsPopupViewTestApi;
|
|
|
| void InitializeMenuButtonView(
|
| views::GridLayout* layout,
|
| @@ -59,15 +65,21 @@ class PermissionSelectorRow : public views::View {
|
| views::GridLayout* layout,
|
| const WebsiteSettingsUI::PermissionInfo& permission);
|
|
|
| + // Returns the "button" for this row, which is the control used to change the
|
| + // permission's value. This is either a |MenuButton| or a |Combobox|.
|
| + views::View* button();
|
| +
|
| Profile* profile_;
|
|
|
| // Model for the permission's menu.
|
| std::unique_ptr<PermissionMenuModel> menu_model_;
|
| std::unique_ptr<internal::ComboboxModelAdapter> combobox_model_adapter_;
|
|
|
| - views::ImageView* icon_; // Owned by the views hierachy.
|
| - internal::PermissionMenuButton* menu_button_; // Owned by the views hierachy.
|
| - internal::PermissionCombobox* combobox_; // Owned by the views hierarchy.
|
| + // These are all owned by the views hierarchy:
|
| + views::ImageView* icon_;
|
| + views::Label* label_;
|
| + internal::PermissionMenuButton* menu_button_;
|
| + internal::PermissionCombobox* combobox_;
|
|
|
| base::ObserverList<PermissionSelectorRowObserver, false> observer_list_;
|
|
|
|
|