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

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

Issue 8964001: views: Convert IsFocusable() to just focusable() since it's just a simple accessor. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: don't need to override IsFocusableInRootView in omnibox_view_views Created 9 years 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 | « ui/views/controls/button/text_button.cc ('k') | ui/views/controls/textfield/textfield.h » ('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 "ui/views/controls/label.h" 5 #include "ui/views/controls/label.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <cmath> 8 #include <cmath>
9 #include <limits> 9 #include <limits>
10 #include <vector> 10 #include <vector>
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after
175 void Label::SetHasFocusBorder(bool has_focus_border) { 175 void Label::SetHasFocusBorder(bool has_focus_border) {
176 has_focus_border_ = has_focus_border; 176 has_focus_border_ = has_focus_border;
177 if (is_multi_line_) { 177 if (is_multi_line_) {
178 text_size_valid_ = false; 178 text_size_valid_ = false;
179 PreferredSizeChanged(); 179 PreferredSizeChanged();
180 } 180 }
181 } 181 }
182 182
183 gfx::Insets Label::GetInsets() const { 183 gfx::Insets Label::GetInsets() const {
184 gfx::Insets insets = View::GetInsets(); 184 gfx::Insets insets = View::GetInsets();
185 if (IsFocusable() || has_focus_border_) { 185 if (focusable() || has_focus_border_) {
186 insets += gfx::Insets(kFocusBorderPadding, kFocusBorderPadding, 186 insets += gfx::Insets(kFocusBorderPadding, kFocusBorderPadding,
187 kFocusBorderPadding, kFocusBorderPadding); 187 kFocusBorderPadding, kFocusBorderPadding);
188 } 188 }
189 return insets; 189 return insets;
190 } 190 }
191 191
192 int Label::GetBaseline() const { 192 int Label::GetBaseline() const {
193 return GetInsets().top() + font_.GetBaseline(); 193 return GetInsets().top() + font_.GetBaseline();
194 } 194 }
195 195
(...skipping 302 matching lines...) Expand 10 before | Expand all | Expand 10 after
498 // it is right aligned. Otherwise, its directionality is forced to be LTR. 498 // it is right aligned. Otherwise, its directionality is forced to be LTR.
499 if (rtl_alignment_mode_ == AUTO_DETECT_ALIGNMENT) { 499 if (rtl_alignment_mode_ == AUTO_DETECT_ALIGNMENT) {
500 if (horiz_alignment_ == ALIGN_RIGHT) 500 if (horiz_alignment_ == ALIGN_RIGHT)
501 *flags |= gfx::Canvas::FORCE_RTL_DIRECTIONALITY; 501 *flags |= gfx::Canvas::FORCE_RTL_DIRECTIONALITY;
502 else 502 else
503 *flags |= gfx::Canvas::FORCE_LTR_DIRECTIONALITY; 503 *flags |= gfx::Canvas::FORCE_LTR_DIRECTIONALITY;
504 } 504 }
505 } 505 }
506 506
507 } // namespace views 507 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/controls/button/text_button.cc ('k') | ui/views/controls/textfield/textfield.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698