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

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

Issue 10827198: Change View::HitTest to View::HitTestRect (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Revised patch with tests added Created 8 years, 4 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
OLDNEW
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
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 250 matching lines...) Expand 10 before | Expand all | Expand 10 after
490 ui::ELIDE_IN_MIDDLE); 490 ui::ELIDE_IN_MIDDLE);
491 } else { 491 } else {
492 *paint_text = text_; 492 *paint_text = text_;
493 } 493 }
494 494
495 *text_bounds = GetTextBounds(); 495 *text_bounds = GetTextBounds();
496 *flags = ComputeDrawStringFlags(); 496 *flags = ComputeDrawStringFlags();
497 } 497 }
498 498
499 } // namespace views 499 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/controls/label.h ('k') | ui/views/controls/link.h » ('j') | ui/views/view.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698