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

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

Issue 287193002: Remove overrides of HitTestRect() which just return false (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: override View::CanProcessEventsWithinSubtree() Created 6 years, 6 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 | « 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 271 matching lines...) Expand 10 before | Expand all | Expand 10 after
282 // implementation should be used. 282 // implementation should be used.
283 if (!View::HitTestRect(gfx::Rect(point, gfx::Size(1, 1)))) 283 if (!View::HitTestRect(gfx::Rect(point, gfx::Size(1, 1))))
284 return NULL; 284 return NULL;
285 285
286 if (tooltip_text_.empty() && !ShouldShowDefaultTooltip()) 286 if (tooltip_text_.empty() && !ShouldShowDefaultTooltip())
287 return NULL; 287 return NULL;
288 288
289 return this; 289 return this;
290 } 290 }
291 291
292 bool Label::HitTestRect(const gfx::Rect& rect) const { 292 bool Label::CanProcessEventsWithinSubtree() const {
293 // Send events to the parent view for handling.
293 return false; 294 return false;
294 } 295 }
295 296
296 bool Label::GetTooltipText(const gfx::Point& p, base::string16* tooltip) const { 297 bool Label::GetTooltipText(const gfx::Point& p, base::string16* tooltip) const {
297 DCHECK(tooltip); 298 DCHECK(tooltip);
298 299
299 // If a tooltip has been explicitly set, use it. 300 // If a tooltip has been explicitly set, use it.
300 if (!tooltip_text_.empty()) { 301 if (!tooltip_text_.empty()) {
301 tooltip->assign(tooltip_text_); 302 tooltip->assign(tooltip_text_);
302 return true; 303 return true;
(...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after
557 cached_heights_[i] = gfx::Size(); 558 cached_heights_[i] = gfx::Size();
558 } 559 }
559 560
560 bool Label::ShouldShowDefaultTooltip() const { 561 bool Label::ShouldShowDefaultTooltip() const {
561 return !is_multi_line_ && !is_obscured_ && 562 return !is_multi_line_ && !is_obscured_ &&
562 gfx::GetStringWidth(layout_text(), font_list_) > 563 gfx::GetStringWidth(layout_text(), font_list_) >
563 GetAvailableRect().width(); 564 GetAvailableRect().width();
564 } 565 }
565 566
566 } // namespace views 567 } // 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