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

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

Issue 659713003: Use scoped_ptr::Pass instead of scoped_ptr::PassAs<T>. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Simplify Created 6 years, 2 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
« no previous file with comments | « ui/views/controls/combobox/combobox.cc ('k') | 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) 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 "ui/base/l10n/l10n_util.h" 8 #include "ui/base/l10n/l10n_util.h"
9 #include "ui/base/resource/resource_bundle.h" 9 #include "ui/base/resource/resource_bundle.h"
10 #include "ui/gfx/canvas.h" 10 #include "ui/gfx/canvas.h"
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after
147 button->set_request_focus_on_press(false); 147 button->set_request_focus_on_press(false);
148 const gfx::FontList& font_list = 148 const gfx::FontList& font_list =
149 ui::ResourceBundle::GetSharedInstance().GetFontList( 149 ui::ResourceBundle::GetSharedInstance().GetFontList(
150 ui::ResourceBundle::SmallFont); 150 ui::ResourceBundle::SmallFont);
151 scoped_ptr<LabelButtonBorder> button_border( 151 scoped_ptr<LabelButtonBorder> button_border(
152 new LabelButtonBorder(button->style())); 152 new LabelButtonBorder(button->style()));
153 int v_border = (kMenuButtonHeight - font_list.GetHeight()) / 2; 153 int v_border = (kMenuButtonHeight - font_list.GetHeight()) / 2;
154 int h_border = (kMenuButtonWidth - gfx::GetStringWidth(label, font_list)) / 2; 154 int h_border = (kMenuButtonWidth - gfx::GetStringWidth(label, font_list)) / 2;
155 button_border->set_insets( 155 button_border->set_insets(
156 gfx::Insets(v_border, h_border, v_border, h_border)); 156 gfx::Insets(v_border, h_border, v_border, h_border));
157 button->SetBorder(button_border.PassAs<Border>()); 157 button->SetBorder(button_border.Pass());
158 button->SetFontList(font_list); 158 button->SetFontList(font_list);
159 button->set_tag(tag); 159 button->set_tag(tag);
160 return button; 160 return button;
161 } 161 }
162 162
163 } // namespace views 163 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/controls/combobox/combobox.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698