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

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

Issue 7057014: Variety of tweaks to View API. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years, 7 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/label_unittest.cc ('k') | views/controls/menu/menu_controller.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(OS_LINUX) 9 #if defined(OS_LINUX)
10 #include <gdk/gdk.h> 10 #include <gdk/gdk.h>
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
62 } 62 }
63 63
64 namespace views { 64 namespace views {
65 65
66 const char Link::kViewClassName[] = "views/Link"; 66 const char Link::kViewClassName[] = "views/Link";
67 67
68 Link::Link() : Label(L""), 68 Link::Link() : Label(L""),
69 listener_(NULL), 69 listener_(NULL),
70 highlighted_(false) { 70 highlighted_(false) {
71 Init(); 71 Init();
72 SetFocusable(true); 72 set_focusable(true);
73 } 73 }
74 74
75 Link::Link(const std::wstring& title) : Label(title), 75 Link::Link(const std::wstring& title) : Label(title),
76 listener_(NULL), 76 listener_(NULL),
77 highlighted_(false) { 77 highlighted_(false) {
78 Init(); 78 Init();
79 SetFocusable(true); 79 set_focusable(true);
80 } 80 }
81 81
82 void Link::Init() { 82 void Link::Init() {
83 GetColors(NULL, &highlighted_color_, &disabled_color_, &normal_color_); 83 GetColors(NULL, &highlighted_color_, &disabled_color_, &normal_color_);
84 SetColor(normal_color_); 84 SetColor(normal_color_);
85 ValidateStyle(); 85 ValidateStyle();
86 } 86 }
87 87
88 Link::~Link() { 88 Link::~Link() {
89 } 89 }
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
214 } else { 214 } else {
215 if (font().GetStyle() & gfx::Font::UNDERLINED) { 215 if (font().GetStyle() & gfx::Font::UNDERLINED) {
216 Label::SetFont( 216 Label::SetFont(
217 font().DeriveFont(0, font().GetStyle() & ~gfx::Font::UNDERLINED)); 217 font().DeriveFont(0, font().GetStyle() & ~gfx::Font::UNDERLINED));
218 } 218 }
219 Label::SetColor(disabled_color_); 219 Label::SetColor(disabled_color_);
220 } 220 }
221 } 221 }
222 222
223 } // namespace views 223 } // namespace views
OLDNEW
« no previous file with comments | « views/controls/label_unittest.cc ('k') | views/controls/menu/menu_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698