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

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: 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..ea808d84e0e5fba09d901c9a0412771b1daff50f 100644
--- a/chrome/browser/ui/views/content_setting_bubble_contents.cc
+++ b/chrome/browser/ui/views/content_setting_bubble_contents.cc
@@ -53,6 +53,10 @@ const int kMaxContentsWidth = 500;
// narrow bubbles with lots of line-wrapping.
const int kMinMultiLineContentsWidth = 250;
+// Subresource filter bubble has ling explanation string, so the width should be
msw 2016/09/15 18:29:03 nit: 'a long' consider: 'Maximum width of the subr
melandory 2016/09/15 19:47:43 Done.
+// bounded.
+const int kMaxSubresourceFilterPromptWidth = 320;
+
} // namespace
using content::PluginService;
@@ -182,7 +186,11 @@ gfx::Size ContentSettingBubbleContents::GetPreferredSize() const {
(kMinMultiLineContentsWidth > preferred_size.width()))
? kMinMultiLineContentsWidth
: preferred_size.width();
- preferred_size.set_width(std::min(preferred_width, kMaxContentsWidth));
+ preferred_size.set_width(
msw 2016/09/15 18:29:03 nit: consider: preferred_size.set_width(std::min
melandory 2016/09/15 19:47:43 Done.
+ std::min(preferred_width,
+ content_setting_bubble_model_->AsSubresourceFilterBubbleModel()
+ ? kMaxSubresourceFilterPromptWidth
+ : 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