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

Side by Side Diff: views/controls/label.cc

Issue 6121004: Remove wstring from gfx. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 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
« no previous file with comments | « views/controls/button/text_button.cc ('k') | views/controls/label_unittest.cc » ('j') | 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) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 "views/controls/label.h" 5 #include "views/controls/label.h"
6 6
7 #include <cmath> 7 #include <cmath>
8 #include <limits> 8 #include <limits>
9 9
10 #include "app/resource_bundle.h" 10 #include "app/resource_bundle.h"
(...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after
264 if (is_multi_line_) { 264 if (is_multi_line_) {
265 text_size_valid_ = false; 265 text_size_valid_ = false;
266 PreferredSizeChanged(); 266 PreferredSizeChanged();
267 } 267 }
268 } 268 }
269 269
270 void Label::PaintText(gfx::Canvas* canvas, 270 void Label::PaintText(gfx::Canvas* canvas,
271 const std::wstring& text, 271 const std::wstring& text,
272 const gfx::Rect& text_bounds, 272 const gfx::Rect& text_bounds,
273 int flags) { 273 int flags) {
274 canvas->DrawStringInt(text, font_, color_, 274 canvas->DrawStringInt(WideToUTF16Hack(text), font_, color_,
275 text_bounds.x(), text_bounds.y(), 275 text_bounds.x(), text_bounds.y(),
276 text_bounds.width(), text_bounds.height(), flags); 276 text_bounds.width(), text_bounds.height(), flags);
277 277
278 if (HasFocus() || paint_as_focused_) { 278 if (HasFocus() || paint_as_focused_) {
279 gfx::Rect focus_bounds = text_bounds; 279 gfx::Rect focus_bounds = text_bounds;
280 focus_bounds.Inset(-kFocusBorderPadding, -kFocusBorderPadding); 280 focus_bounds.Inset(-kFocusBorderPadding, -kFocusBorderPadding);
281 canvas->DrawFocusRect(focus_bounds.x(), focus_bounds.y(), 281 canvas->DrawFocusRect(focus_bounds.x(), focus_bounds.y(),
282 focus_bounds.width(), focus_bounds.height()); 282 focus_bounds.width(), focus_bounds.height());
283 } 283 }
284 } 284 }
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after
446 font_, GetAvailableRect().width(), true)); 446 font_, GetAvailableRect().width(), true));
447 } else { 447 } else {
448 *paint_text = UTF16ToWideHack(text_); 448 *paint_text = UTF16ToWideHack(text_);
449 } 449 }
450 450
451 *text_bounds = GetTextBounds(); 451 *text_bounds = GetTextBounds();
452 *flags = ComputeMultiLineFlags(); 452 *flags = ComputeMultiLineFlags();
453 } 453 }
454 454
455 } // namespace views 455 } // namespace views
OLDNEW
« no previous file with comments | « views/controls/button/text_button.cc ('k') | views/controls/label_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698