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

Side by Side Diff: ui/views/touchui/touch_editing_menu.cc

Issue 145033006: views: Make View::set_border() take a scoped_ptr<>. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Further renaming 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) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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 "ui/views/touchui/touch_editing_menu.h" 5 #include "ui/views/touchui/touch_editing_menu.h"
6 6
7 #include "base/strings/utf_string_conversions.h" 7 #include "base/strings/utf_string_conversions.h"
8 #include "grit/ui_strings.h" 8 #include "grit/ui_strings.h"
9 #include "ui/base/l10n/l10n_util.h" 9 #include "ui/base/l10n/l10n_util.h"
10 #include "ui/base/resource/resource_bundle.h" 10 #include "ui/base/resource/resource_bundle.h"
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
134 button->set_request_focus_on_press(false); 134 button->set_request_focus_on_press(false);
135 const gfx::FontList& font_list = 135 const gfx::FontList& font_list =
136 ui::ResourceBundle::GetSharedInstance().GetFontList( 136 ui::ResourceBundle::GetSharedInstance().GetFontList(
137 ui::ResourceBundle::SmallFont); 137 ui::ResourceBundle::SmallFont);
138 scoped_ptr<LabelButtonBorder> button_border( 138 scoped_ptr<LabelButtonBorder> button_border(
139 new LabelButtonBorder(button->style())); 139 new LabelButtonBorder(button->style()));
140 int v_border = (kMenuButtonHeight - font_list.GetHeight()) / 2; 140 int v_border = (kMenuButtonHeight - font_list.GetHeight()) / 2;
141 int h_border = (kMenuButtonWidth - gfx::GetStringWidth(label, font_list)) / 2; 141 int h_border = (kMenuButtonWidth - gfx::GetStringWidth(label, font_list)) / 2;
142 button_border->set_insets( 142 button_border->set_insets(
143 gfx::Insets(v_border, h_border, v_border, h_border)); 143 gfx::Insets(v_border, h_border, v_border, h_border));
144 button->set_border(button_border.release()); 144 button->SetBorder(button_border.PassAs<Border>());
145 button->SetFontList(font_list); 145 button->SetFontList(font_list);
146 button->set_tag(tag); 146 button->set_tag(tag);
147 return button; 147 return button;
148 } 148 }
149 149
150 } // namespace views 150 } // namespace views
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698