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

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

Issue 6192007: Remove wstring from views. Part 3: Switch accessibility strings to string16.... (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/image_view.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 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
100 font_ = font; 100 font_ = font;
101 text_size_valid_ = false; 101 text_size_valid_ = false;
102 PreferredSizeChanged(); 102 PreferredSizeChanged();
103 SchedulePaint(); 103 SchedulePaint();
104 } 104 }
105 105
106 void Label::SetText(const std::wstring& text) { 106 void Label::SetText(const std::wstring& text) {
107 text_ = WideToUTF16Hack(text); 107 text_ = WideToUTF16Hack(text);
108 url_set_ = false; 108 url_set_ = false;
109 text_size_valid_ = false; 109 text_size_valid_ = false;
110 SetAccessibleName(text); 110 SetAccessibleName(WideToUTF16Hack(text));
111 PreferredSizeChanged(); 111 PreferredSizeChanged();
112 SchedulePaint(); 112 SchedulePaint();
113 } 113 }
114 114
115 const std::wstring Label::GetText() const { 115 const std::wstring Label::GetText() const {
116 return url_set_ ? UTF8ToWide(url_.spec()) : UTF16ToWideHack(text_); 116 return url_set_ ? UTF8ToWide(url_.spec()) : UTF16ToWideHack(text_);
117 } 117 }
118 118
119 void Label::SetURL(const GURL& url) { 119 void Label::SetURL(const GURL& url) {
120 url_ = url; 120 url_ = url;
(...skipping 325 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/image_view.cc ('k') | views/controls/label_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698