OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
219 w = std::max(0, w - GetInsets().width()); | 219 w = std::max(0, w - GetInsets().width()); |
220 int h = font_.GetHeight(); | 220 int h = font_.GetHeight(); |
221 gfx::Canvas::SizeStringInt(text_, font_, &w, &h, ComputeDrawStringFlags()); | 221 gfx::Canvas::SizeStringInt(text_, font_, &w, &h, ComputeDrawStringFlags()); |
222 return h + GetInsets().height(); | 222 return h + GetInsets().height(); |
223 } | 223 } |
224 | 224 |
225 std::string Label::GetClassName() const { | 225 std::string Label::GetClassName() const { |
226 return kViewClassName; | 226 return kViewClassName; |
227 } | 227 } |
228 | 228 |
229 bool Label::HitTest(const gfx::Point& l) const { | 229 bool Label::HitTestRect(const gfx::Rect& rect) const { |
230 return false; | 230 return false; |
231 } | 231 } |
232 | 232 |
233 void Label::OnMouseMoved(const MouseEvent& event) { | 233 void Label::OnMouseMoved(const MouseEvent& event) { |
234 UpdateContainsMouse(event); | 234 UpdateContainsMouse(event); |
235 } | 235 } |
236 | 236 |
237 void Label::OnMouseEntered(const MouseEvent& event) { | 237 void Label::OnMouseEntered(const MouseEvent& event) { |
238 UpdateContainsMouse(event); | 238 UpdateContainsMouse(event); |
239 } | 239 } |
(...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
493 ui::ELIDE_AT_END); | 493 ui::ELIDE_AT_END); |
494 } else { | 494 } else { |
495 *paint_text = text_; | 495 *paint_text = text_; |
496 } | 496 } |
497 | 497 |
498 *text_bounds = GetTextBounds(); | 498 *text_bounds = GetTextBounds(); |
499 *flags = ComputeDrawStringFlags(); | 499 *flags = ComputeDrawStringFlags(); |
500 } | 500 } |
501 | 501 |
502 } // namespace views | 502 } // namespace views |
OLD | NEW |