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

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

Issue 145033006: views: Make View::set_border() take a scoped_ptr<>. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase to ToT Created 6 years, 11 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
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 274 matching lines...) Expand 10 before | Expand all | Expand 10 after
285 layout->StartRow(0, kMediaMenuColumnSetId); 285 layout->StartRow(0, kMediaMenuColumnSetId);
286 286
287 views::Label* label = 287 views::Label* label =
288 new views::Label(base::UTF8ToUTF16(i->second.label)); 288 new views::Label(base::UTF8ToUTF16(i->second.label));
289 label->SetHorizontalAlignment(gfx::ALIGN_LEFT); 289 label->SetHorizontalAlignment(gfx::ALIGN_LEFT);
290 290
291 views::MenuButton* menu_button = new views::MenuButton( 291 views::MenuButton* menu_button = new views::MenuButton(
292 NULL, base::UTF8ToUTF16((i->second.selected_device.name)), 292 NULL, base::UTF8ToUTF16((i->second.selected_device.name)),
293 this, true); 293 this, true);
294 menu_button->set_alignment(views::TextButton::ALIGN_LEFT); 294 menu_button->set_alignment(views::TextButton::ALIGN_LEFT);
295 menu_button->set_border( 295 menu_button->SetBorder(scoped_ptr<views::Border>(
296 new views::TextButtonNativeThemeBorder(menu_button)); 296 new views::TextButtonNativeThemeBorder(menu_button)));
297 menu_button->set_animate_on_state_change(false); 297 menu_button->set_animate_on_state_change(false);
298 298
299 MediaMenuParts* menu_view = new MediaMenuParts(i->first); 299 MediaMenuParts* menu_view = new MediaMenuParts(i->first);
300 menu_view->menu_model.reset(new ContentSettingMediaMenuModel( 300 menu_view->menu_model.reset(new ContentSettingMediaMenuModel(
301 i->first, 301 i->first,
302 content_setting_bubble_model_.get(), 302 content_setting_bubble_model_.get(),
303 base::Bind(&ContentSettingBubbleContents::UpdateMenuLabel, 303 base::Bind(&ContentSettingBubbleContents::UpdateMenuLabel,
304 base::Unretained(this)))); 304 base::Unretained(this))));
305 media_menus_[menu_button] = menu_view; 305 media_menus_[menu_button] = menu_view;
306 306
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after
461 int width = button->GetPreferredSize().width(); 461 int width = button->GetPreferredSize().width();
462 for (int i = 0; i < menu_model->GetItemCount(); ++i) { 462 for (int i = 0; i < menu_model->GetItemCount(); ++i) {
463 button->SetText(menu_model->GetLabelAt(i)); 463 button->SetText(menu_model->GetLabelAt(i));
464 width = std::max(width, button->GetPreferredSize().width()); 464 width = std::max(width, button->GetPreferredSize().width());
465 } 465 }
466 466
467 // Recover the title for the menu button. 467 // Recover the title for the menu button.
468 button->SetText(title); 468 button->SetText(title);
469 return width; 469 return width;
470 } 470 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/collected_cookies_views.cc ('k') | chrome/browser/ui/views/cookie_info_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698