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

Unified Diff: chrome/browser/ui/views/website_settings/website_settings_popup_view.cc

Issue 11363197: Merge 166748 - [Views] Set the width of the Website Settings UI dynamically based on the size of th… (Closed) Base URL: svn://svn.chromium.org/chrome/branches/1312/src/
Patch Set: Created 8 years, 1 month 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/views/website_settings/website_settings_popup_view.cc
===================================================================
--- chrome/browser/ui/views/website_settings/website_settings_popup_view.cc (revision 167201)
+++ chrome/browser/ui/views/website_settings/website_settings_popup_view.cc (working copy)
@@ -79,6 +79,9 @@
// the Omnibox's edge, inset the bubble's anchor rect by this amount of pixels.
const int kLocationIconVerticalMargin = 5;
+// The max possible width of the popup.
+const int kMaxPopupWidth = 500;
+
// The margins between the popup border and the popup content.
const int kPopupMarginTop = 4;
const int kPopupMarginLeft = 0;
@@ -86,9 +89,11 @@
const int kPopupMarginRight = 0;
// Padding values for sections on the permissions tab.
+const int kPermissionsSectionContentMinWidth = 300;
const int kPermissionsSectionPaddingBottom = 6;
const int kPermissionsSectionPaddingLeft = 18;
const int kPermissionsSectionPaddingTop = 16;
+
// Space between the headline and the content of a section on the permissions
// tab.
const int kPermissionsSectionHeadlineMarginBottom = 10;
@@ -97,9 +102,6 @@
// is the space between these rows.
const int kPermissionsSectionRowSpacing = 2;
-// The max width of the popup.
-const int kPopupWidth = 310;
-
const int kSiteDataIconColumnWidth = 20;
const int kSiteDataSectionRowSpacing = 11;
@@ -406,7 +408,16 @@
height += header_->GetPreferredSize().height();
if (tabbed_pane_)
height += tabbed_pane_->GetPreferredSize().height();
- return gfx::Size(kPopupWidth, height);
+
+ int width = kPermissionsSectionContentMinWidth;
+ if (site_data_content_)
+ width = std::max(width, site_data_content_->GetPreferredSize().width());
+ if (permissions_content_)
+ width = std::max(width, permissions_content_->GetPreferredSize().width());
+ width += kPermissionsSectionPaddingLeft;
+ width = std::min(width, kMaxPopupWidth);
+
+ return gfx::Size(width, height);
}
void WebsiteSettingsPopupView::SetCookieInfo(
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698