| 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.h" | 5 #include "chrome/browser/ui/views/tabs/tab.h" |
| 6 | 6 |
| 7 #include "chrome/browser/ui/tabs/tab_strip_selection_model.h" | 7 #include "chrome/browser/ui/tabs/tab_strip_selection_model.h" |
| 8 #include "chrome/browser/ui/views/tabs/tab_controller.h" | 8 #include "chrome/browser/ui/views/tabs/tab_controller.h" |
| 9 #include "testing/gtest/include/gtest/gtest.h" | 9 #include "testing/gtest/include/gtest/gtest.h" |
| 10 #include "ui/views/test/views_test_base.h" | 10 #include "ui/views/test/views_test_base.h" |
| (...skipping 22 matching lines...) Expand all Loading... |
| 33 return false; | 33 return false; |
| 34 } | 34 } |
| 35 virtual bool IsTabPinned(const BaseTab* tab) const OVERRIDE { return false; } | 35 virtual bool IsTabPinned(const BaseTab* tab) const OVERRIDE { return false; } |
| 36 virtual bool IsTabCloseable(const BaseTab* tab) const OVERRIDE { | 36 virtual bool IsTabCloseable(const BaseTab* tab) const OVERRIDE { |
| 37 return true; | 37 return true; |
| 38 } | 38 } |
| 39 virtual void MaybeStartDrag( | 39 virtual void MaybeStartDrag( |
| 40 BaseTab* tab, | 40 BaseTab* tab, |
| 41 const views::MouseEvent& event, | 41 const views::MouseEvent& event, |
| 42 const TabStripSelectionModel& original_selection) OVERRIDE {} | 42 const TabStripSelectionModel& original_selection) OVERRIDE {} |
| 43 virtual void ContinueDrag(const views::MouseEvent& event) OVERRIDE {} | 43 virtual void ContinueDrag(views::View* view, |
| 44 const gfx::Point& location) OVERRIDE {} |
| 44 virtual bool EndDrag(bool canceled) OVERRIDE { return false; } | 45 virtual bool EndDrag(bool canceled) OVERRIDE { return false; } |
| 45 virtual BaseTab* GetTabAt(BaseTab* tab, | 46 virtual BaseTab* GetTabAt(BaseTab* tab, |
| 46 const gfx::Point& tab_in_tab_coordinates) OVERRIDE { | 47 const gfx::Point& tab_in_tab_coordinates) OVERRIDE { |
| 47 return NULL; | 48 return NULL; |
| 48 } | 49 } |
| 49 virtual void ClickActiveTab(const BaseTab* tab) const OVERRIDE {} | 50 virtual void ClickActiveTab(const BaseTab* tab) const OVERRIDE {} |
| 50 virtual void OnMouseEventInTab(views::View* source, | 51 virtual void OnMouseEventInTab(views::View* source, |
| 51 const views::MouseEvent& event) OVERRIDE {} | 52 const views::MouseEvent& event) OVERRIDE {} |
| 52 virtual bool ShouldPaintTab(const BaseTab* tab, gfx::Rect* clip) OVERRIDE { | 53 virtual bool ShouldPaintTab(const BaseTab* tab, gfx::Rect* clip) OVERRIDE { |
| 53 return true; | 54 return true; |
| (...skipping 29 matching lines...) Expand all Loading... |
| 83 | 84 |
| 84 // If the window is maximized, however, we want clicks in the top edge to | 85 // If the window is maximized, however, we want clicks in the top edge to |
| 85 // select the tab. | 86 // select the tab. |
| 86 widget.Maximize(); | 87 widget.Maximize(); |
| 87 EXPECT_TRUE(tab.HitTest(gfx::Point(middle_x, 0))); | 88 EXPECT_TRUE(tab.HitTest(gfx::Point(middle_x, 0))); |
| 88 | 89 |
| 89 // But clicks in the area above the slanted sides should still miss. | 90 // But clicks in the area above the slanted sides should still miss. |
| 90 EXPECT_FALSE(tab.HitTest(gfx::Point(0, 0))); | 91 EXPECT_FALSE(tab.HitTest(gfx::Point(0, 0))); |
| 91 EXPECT_FALSE(tab.HitTest(gfx::Point(tab.width() - 1, 0))); | 92 EXPECT_FALSE(tab.HitTest(gfx::Point(tab.width() - 1, 0))); |
| 92 } | 93 } |
| OLD | NEW |