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

Side by Side Diff: chrome/browser/ui/views/tabs/tab_strip.cc

Issue 308003019: Add DCHECK to MaskedViewTargeter::GetHitTestMask() overrides (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: DCHECK_EQ 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 | « no previous file | ui/app_list/views/speech_view.cc » ('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 "chrome/browser/ui/views/tabs/tab_strip.h" 5 #include "chrome/browser/ui/views/tabs/tab_strip.h"
6 6
7 #if defined(OS_WIN) 7 #if defined(OS_WIN)
8 #include <windowsx.h> 8 #include <windowsx.h>
9 #endif 9 #endif
10 10
(...skipping 412 matching lines...) Expand 10 before | Expand all | Expand 10 after
423 public: 423 public:
424 explicit NewTabButtonTargeter(views::View* new_tab_button) 424 explicit NewTabButtonTargeter(views::View* new_tab_button)
425 : views::MaskedViewTargeter(new_tab_button) {} 425 : views::MaskedViewTargeter(new_tab_button) {}
426 virtual ~NewTabButtonTargeter() {} 426 virtual ~NewTabButtonTargeter() {}
427 427
428 private: 428 private:
429 // views::MaskedViewTargeter: 429 // views::MaskedViewTargeter:
430 virtual bool GetHitTestMask(const views::View* view, 430 virtual bool GetHitTestMask(const views::View* view,
431 gfx::Path* mask) const OVERRIDE { 431 gfx::Path* mask) const OVERRIDE {
432 DCHECK(mask); 432 DCHECK(mask);
433 DCHECK_EQ(view, masked_view());
433 434
434 SkScalar w = SkIntToScalar(view->width()); 435 SkScalar w = SkIntToScalar(view->width());
435 SkScalar v_offset = SkIntToScalar(kNewTabButtonVerticalOffset); 436 SkScalar v_offset = SkIntToScalar(kNewTabButtonVerticalOffset);
436 437
437 // These values are defined by the shape of the new tab image. Should that 438 // These values are defined by the shape of the new tab image. Should that
438 // image ever change, these values will need to be updated. They're so 439 // image ever change, these values will need to be updated. They're so
439 // custom it's not really worth defining constants for. 440 // custom it's not really worth defining constants for.
440 // These values are correct for regular and USE_ASH versions of the image. 441 // These values are correct for regular and USE_ASH versions of the image.
441 mask->moveTo(0, v_offset + 1); 442 mask->moveTo(0, v_offset + 1);
442 mask->lineTo(w - 7, v_offset + 1); 443 mask->lineTo(w - 7, v_offset + 1);
(...skipping 2218 matching lines...) Expand 10 before | Expand all | Expand 10 after
2661 if (value == reset_to_shrink_on_exit_) 2662 if (value == reset_to_shrink_on_exit_)
2662 return; 2663 return;
2663 2664
2664 reset_to_shrink_on_exit_ = value; 2665 reset_to_shrink_on_exit_ = value;
2665 // Add an observer so we know when the mouse moves out of the tabstrip. 2666 // Add an observer so we know when the mouse moves out of the tabstrip.
2666 if (reset_to_shrink_on_exit_) 2667 if (reset_to_shrink_on_exit_)
2667 AddMessageLoopObserver(); 2668 AddMessageLoopObserver();
2668 else 2669 else
2669 RemoveMessageLoopObserver(); 2670 RemoveMessageLoopObserver();
2670 } 2671 }
OLDNEW
« no previous file with comments | « no previous file | ui/app_list/views/speech_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698