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 17 matching lines...) Expand all Loading... |
28 virtual void CloseTab(BaseTab* tab) OVERRIDE {} | 28 virtual void CloseTab(BaseTab* tab) OVERRIDE {} |
29 virtual void ShowContextMenuForTab(BaseTab* tab, | 29 virtual void ShowContextMenuForTab(BaseTab* tab, |
30 const gfx::Point& p) OVERRIDE {} | 30 const gfx::Point& p) OVERRIDE {} |
31 virtual bool IsActiveTab(const BaseTab* tab) const OVERRIDE { return false; } | 31 virtual bool IsActiveTab(const BaseTab* tab) const OVERRIDE { return false; } |
32 virtual bool IsTabSelected(const BaseTab* tab) const OVERRIDE { | 32 virtual bool IsTabSelected(const BaseTab* tab) const OVERRIDE { |
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 void MaybeStartDrag( | 36 virtual void MaybeStartDrag( |
37 BaseTab* tab, | 37 BaseTab* tab, |
38 const views::LocatedEvent& event, | 38 const ui::LocatedEvent& event, |
39 const TabStripSelectionModel& original_selection) OVERRIDE {} | 39 const TabStripSelectionModel& original_selection) OVERRIDE {} |
40 virtual void ContinueDrag(views::View* view, | 40 virtual void ContinueDrag(views::View* view, |
41 const gfx::Point& location) OVERRIDE {} | 41 const gfx::Point& location) OVERRIDE {} |
42 virtual bool EndDrag(bool canceled) OVERRIDE { return false; } | 42 virtual bool EndDrag(bool canceled) OVERRIDE { return false; } |
43 virtual BaseTab* GetTabAt(BaseTab* tab, | 43 virtual BaseTab* GetTabAt(BaseTab* tab, |
44 const gfx::Point& tab_in_tab_coordinates) OVERRIDE { | 44 const gfx::Point& tab_in_tab_coordinates) OVERRIDE { |
45 return NULL; | 45 return NULL; |
46 } | 46 } |
47 virtual void ClickActiveTab(const BaseTab* tab) const OVERRIDE {} | 47 virtual void ClickActiveTab(const BaseTab* tab) const OVERRIDE {} |
48 virtual void OnMouseEventInTab(views::View* source, | 48 virtual void OnMouseEventInTab(views::View* source, |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
84 | 84 |
85 // 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 |
86 // select the tab. | 86 // select the tab. |
87 widget.Maximize(); | 87 widget.Maximize(); |
88 EXPECT_TRUE(tab.HitTestPoint(gfx::Point(middle_x, 0))); | 88 EXPECT_TRUE(tab.HitTestPoint(gfx::Point(middle_x, 0))); |
89 | 89 |
90 // 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. |
91 EXPECT_FALSE(tab.HitTestPoint(gfx::Point(0, 0))); | 91 EXPECT_FALSE(tab.HitTestPoint(gfx::Point(0, 0))); |
92 EXPECT_FALSE(tab.HitTestPoint(gfx::Point(tab.width() - 1, 0))); | 92 EXPECT_FALSE(tab.HitTestPoint(gfx::Point(tab.width() - 1, 0))); |
93 } | 93 } |
OLD | NEW |