Chromium Code Reviews| 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 "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 Loading... | |
| 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(view == masked_view()); | |
|
sadrul
2014/06/03 16:37:01
Use DCHECK_EQ
tdanderson
2014/06/03 18:22:54
Done.
| |
| 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 Loading... | |
| 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 } |
| OLD | NEW |