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

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: Fixed errors reported by trybots 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
« no previous file with comments | « ui/views/controls/label.h ('k') | ui/views/controls/link.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) 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 253 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
OLDNEW
« no previous file with comments | « ui/views/controls/label.h ('k') | ui/views/controls/link.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698