| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <iterator> | 8 #include <iterator> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 60 | 60 |
| 61 namespace { | 61 namespace { |
| 62 | 62 |
| 63 /////////////////////////////////////////////////////////////////////////////// | 63 /////////////////////////////////////////////////////////////////////////////// |
| 64 // NewTabButton | 64 // NewTabButton |
| 65 // | 65 // |
| 66 // A subclass of button that hit-tests to the shape of the new tab button. | 66 // A subclass of button that hit-tests to the shape of the new tab button. |
| 67 | 67 |
| 68 class NewTabButton : public views::ImageButton { | 68 class NewTabButton : public views::ImageButton { |
| 69 public: | 69 public: |
| 70 explicit NewTabButton(TabStrip* tab_strip, views::ButtonListener* listener) | 70 NewTabButton(TabStrip* tab_strip, views::ButtonListener* listener) |
| 71 : views::ImageButton(listener), | 71 : views::ImageButton(listener), |
| 72 tab_strip_(tab_strip) { | 72 tab_strip_(tab_strip) { |
| 73 } | 73 } |
| 74 virtual ~NewTabButton() {} | 74 virtual ~NewTabButton() {} |
| 75 | 75 |
| 76 protected: | 76 protected: |
| 77 // Overridden from views::View: | 77 // Overridden from views::View: |
| 78 virtual bool HasHitTestMask() const { | 78 virtual bool HasHitTestMask() const { |
| 79 // When the button is sized to the top of the tab strip we want the user to | 79 // When the button is sized to the top of the tab strip we want the user to |
| 80 // be able to click on complete bounds, and so don't return a custom hit | 80 // be able to click on complete bounds, and so don't return a custom hit |
| (...skipping 945 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1026 } | 1026 } |
| 1027 return mini_count; | 1027 return mini_count; |
| 1028 } | 1028 } |
| 1029 | 1029 |
| 1030 bool TabStrip::IsPointInTab(Tab* tab, | 1030 bool TabStrip::IsPointInTab(Tab* tab, |
| 1031 const gfx::Point& point_in_tabstrip_coords) { | 1031 const gfx::Point& point_in_tabstrip_coords) { |
| 1032 gfx::Point point_in_tab_coords(point_in_tabstrip_coords); | 1032 gfx::Point point_in_tab_coords(point_in_tabstrip_coords); |
| 1033 View::ConvertPointToView(this, tab, &point_in_tab_coords); | 1033 View::ConvertPointToView(this, tab, &point_in_tab_coords); |
| 1034 return tab->HitTest(point_in_tab_coords); | 1034 return tab->HitTest(point_in_tab_coords); |
| 1035 } | 1035 } |
| OLD | NEW |