Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1412)

Unified Diff: chrome/browser/ui/views/website_settings/permission_selector_row.h

Issue 2725783004: views: align columns in site settings dialog (Closed)
Patch Set: fix nits Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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_;

Powered by Google App Engine
This is Rietveld 408576698