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

Side by Side Diff: chrome/browser/ui/views/content_setting_bubble_contents.cc

Issue 371633002: LabelButton: cache the last computed preferred size (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 6 years, 5 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/ui/views/content_setting_bubble_contents.h" 5 #include "chrome/browser/ui/views/content_setting_bubble_contents.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <set> 8 #include <set>
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
(...skipping 485 matching lines...) Expand 10 before | Expand all | Expand 10 after
496 menu_width = std::max(menu_width, string_width); 496 menu_width = std::max(menu_width, string_width);
497 } 497 }
498 } 498 }
499 499
500 // Make sure the width is at least kMinMediaMenuButtonWidth. The 500 // Make sure the width is at least kMinMediaMenuButtonWidth. The
501 // maximum width will be clamped by kMaxContentsWidth of the view. 501 // maximum width will be clamped by kMaxContentsWidth of the view.
502 menu_width = std::max(kMinMediaMenuButtonWidth, menu_width + margins); 502 menu_width = std::max(kMinMediaMenuButtonWidth, menu_width + margins);
503 503
504 for (MediaMenuPartsMap::const_iterator i = media_menus_.begin(); 504 for (MediaMenuPartsMap::const_iterator i = media_menus_.begin();
505 i != media_menus_.end(); ++i) { 505 i != media_menus_.end(); ++i) {
506 i->first->set_min_size(gfx::Size(menu_width, 0)); 506 i->first->SetMinSize(gfx::Size(menu_width, 0));
507 i->first->set_max_size(gfx::Size(menu_width, 0)); 507 i->first->SetMaxSize(gfx::Size(menu_width, 0));
508 } 508 }
509 } 509 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/bookmarks/bookmark_bar_view.cc ('k') | chrome/browser/ui/views/fullscreen_exit_bubble_views.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698