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

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

Issue 8113031: Change std::wstring to string16 for views::Label and views::Link (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 9 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 | Annotate | Revision Log
« no previous file with comments | « views/controls/link.h ('k') | views/controls/message_box_view.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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/link.h" 5 #include "views/controls/link.h"
6 6
7 #include "build/build_config.h" 7 #include "build/build_config.h"
8 8
9 #if defined(TOOLKIT_USES_GTK) 9 #if defined(TOOLKIT_USES_GTK)
10 #include <gdk/gdk.h> 10 #include <gdk/gdk.h>
11 #endif 11 #endif
12 12
13 #include "base/logging.h" 13 #include "base/logging.h"
14 #include "base/utf_string_conversions.h"
14 #include "ui/base/accessibility/accessible_view_state.h" 15 #include "ui/base/accessibility/accessible_view_state.h"
15 #include "ui/base/keycodes/keyboard_codes.h" 16 #include "ui/base/keycodes/keyboard_codes.h"
16 #include "ui/gfx/color_utils.h" 17 #include "ui/gfx/color_utils.h"
17 #include "ui/gfx/font.h" 18 #include "ui/gfx/font.h"
18 #include "views/controls/link_listener.h" 19 #include "views/controls/link_listener.h"
19 #include "views/events/event.h" 20 #include "views/events/event.h"
20 21
21 #if defined(TOOLKIT_USES_GTK) 22 #if defined(TOOLKIT_USES_GTK)
22 #include "ui/gfx/gtk_util.h" 23 #include "ui/gfx/gtk_util.h"
23 #endif 24 #endif
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 *disabled_color = kDisabledColor; 59 *disabled_color = kDisabledColor;
59 *normal_color = kNormalColor; 60 *normal_color = kNormalColor;
60 } 61 }
61 } 62 }
62 } 63 }
63 64
64 namespace views { 65 namespace views {
65 66
66 const char Link::kViewClassName[] = "views/Link"; 67 const char Link::kViewClassName[] = "views/Link";
67 68
68 Link::Link() : Label(L""), 69 Link::Link()
69 listener_(NULL), 70 : Label(string16()),
70 highlighted_(false) { 71 listener_(NULL),
72 highlighted_(false) {
71 Init(); 73 Init();
72 set_focusable(true); 74 set_focusable(true);
73 } 75 }
74 76
75 Link::Link(const std::wstring& title) : Label(title), 77 Link::Link(const string16& title)
76 listener_(NULL), 78 : Label(title),
77 highlighted_(false) { 79 listener_(NULL),
80 highlighted_(false) {
78 Init(); 81 Init();
79 set_focusable(true); 82 set_focusable(true);
80 } 83 }
81 84
82 void Link::Init() { 85 void Link::Init() {
83 GetColors(NULL, &highlighted_color_, &disabled_color_, &normal_color_); 86 GetColors(NULL, &highlighted_color_, &disabled_color_, &normal_color_);
84 SetColor(normal_color_); 87 SetColor(normal_color_);
85 ValidateStyle(); 88 ValidateStyle();
86 } 89 }
87 90
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after
222 } else { 225 } else {
223 if (font().GetStyle() & gfx::Font::UNDERLINED) { 226 if (font().GetStyle() & gfx::Font::UNDERLINED) {
224 Label::SetFont( 227 Label::SetFont(
225 font().DeriveFont(0, font().GetStyle() & ~gfx::Font::UNDERLINED)); 228 font().DeriveFont(0, font().GetStyle() & ~gfx::Font::UNDERLINED));
226 } 229 }
227 Label::SetColor(disabled_color_); 230 Label::SetColor(disabled_color_);
228 } 231 }
229 } 232 }
230 233
231 } // namespace views 234 } // namespace views
OLDNEW
« no previous file with comments | « views/controls/link.h ('k') | views/controls/message_box_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698