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

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

Issue 341323002: views: Fix border around menu button in content settings bubble. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 6 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 288 matching lines...) Expand 10 before | Expand all | Expand 10 after
299 layout->AddPaddingRow(0, views::kRelatedControlVerticalSpacing); 299 layout->AddPaddingRow(0, views::kRelatedControlVerticalSpacing);
300 layout->StartRow(0, kMediaMenuColumnSetId); 300 layout->StartRow(0, kMediaMenuColumnSetId);
301 301
302 views::Label* label = 302 views::Label* label =
303 new views::Label(base::UTF8ToUTF16(i->second.label)); 303 new views::Label(base::UTF8ToUTF16(i->second.label));
304 label->SetHorizontalAlignment(gfx::ALIGN_LEFT); 304 label->SetHorizontalAlignment(gfx::ALIGN_LEFT);
305 305
306 views::MenuButton* menu_button = new views::MenuButton( 306 views::MenuButton* menu_button = new views::MenuButton(
307 NULL, base::UTF8ToUTF16((i->second.selected_device.name)), 307 NULL, base::UTF8ToUTF16((i->second.selected_device.name)),
308 this, true); 308 this, true);
309 menu_button->SetStyle(views::Button::STYLE_BUTTON);
309 menu_button->SetHorizontalAlignment(gfx::ALIGN_LEFT); 310 menu_button->SetHorizontalAlignment(gfx::ALIGN_LEFT);
310 menu_button->set_animate_on_state_change(false); 311 menu_button->set_animate_on_state_change(false);
311 312
312 MediaMenuParts* menu_view = new MediaMenuParts(i->first); 313 MediaMenuParts* menu_view = new MediaMenuParts(i->first);
313 menu_view->menu_model.reset(new ContentSettingMediaMenuModel( 314 menu_view->menu_model.reset(new ContentSettingMediaMenuModel(
314 i->first, 315 i->first,
315 content_setting_bubble_model_.get(), 316 content_setting_bubble_model_.get(),
316 base::Bind(&ContentSettingBubbleContents::UpdateMenuLabel, 317 base::Bind(&ContentSettingBubbleContents::UpdateMenuLabel,
317 base::Unretained(this)))); 318 base::Unretained(this))));
318 media_menus_[menu_button] = menu_view; 319 media_menus_[menu_button] = menu_view;
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after
488 int width = button->GetPreferredSize().width(); 489 int width = button->GetPreferredSize().width();
489 for (int i = 0; i < menu_model->GetItemCount(); ++i) { 490 for (int i = 0; i < menu_model->GetItemCount(); ++i) {
490 button->SetText(menu_model->GetLabelAt(i)); 491 button->SetText(menu_model->GetLabelAt(i));
491 width = std::max(width, button->GetPreferredSize().width()); 492 width = std::max(width, button->GetPreferredSize().width());
492 } 493 }
493 494
494 // Recover the title for the menu button. 495 // Recover the title for the menu button.
495 button->SetText(title); 496 button->SetText(title);
496 return width; 497 return width;
497 } 498 }
OLDNEW
« 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