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

Unified Diff: chrome/browser/ui/views/content_setting_bubble_contents.cc

Issue 2344663003: Restrict width of the Subresource Filtering bubble to 320px. (Closed)
Patch Set: comments and names updates Created 4 years, 3 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
« 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/content_setting_bubble_contents.cc
diff --git a/chrome/browser/ui/views/content_setting_bubble_contents.cc b/chrome/browser/ui/views/content_setting_bubble_contents.cc
index 198251d336ccbce2711934eb5376e1807004f9ad..423bcc2f675ce27ee0302596ce4ca266cd6d58d1 100644
--- a/chrome/browser/ui/views/content_setting_bubble_contents.cc
+++ b/chrome/browser/ui/views/content_setting_bubble_contents.cc
@@ -49,6 +49,10 @@ namespace {
// the bubble arbitrarily wide.
const int kMaxContentsWidth = 500;
+// The new default width for the content settings bubble. The review process to
+// the width on per-bubble basis is tracked with https://crbug.com/649650.
+const int kMaxDefaultContentsWidth = 320;
+
// When we have multiline labels, we should set a minimum width lest we get very
// narrow bubbles with lots of line-wrapping.
const int kMinMultiLineContentsWidth = 250;
@@ -182,7 +186,12 @@ gfx::Size ContentSettingBubbleContents::GetPreferredSize() const {
(kMinMultiLineContentsWidth > preferred_size.width()))
? kMinMultiLineContentsWidth
: preferred_size.width();
- preferred_size.set_width(std::min(preferred_width, kMaxContentsWidth));
+ if (content_setting_bubble_model_->AsSubresourceFilterBubbleModel()) {
+ preferred_size.set_width(std::min(preferred_width,
+ kMaxDefaultContentsWidth));
+ } else {
+ preferred_size.set_width(std::min(preferred_width, kMaxContentsWidth));
+ }
return preferred_size;
}
« 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