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 28 matching lines...) Expand all Loading... |
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, |
49 const views::MouseEvent& event) OVERRIDE {} | 49 const ui::MouseEvent& event) OVERRIDE {} |
50 virtual bool ShouldPaintTab(const BaseTab* tab, gfx::Rect* clip) OVERRIDE { | 50 virtual bool ShouldPaintTab(const BaseTab* tab, gfx::Rect* clip) OVERRIDE { |
51 return true; | 51 return true; |
52 } | 52 } |
53 virtual bool IsInstantExtendedAPIEnabled() OVERRIDE { | 53 virtual bool IsInstantExtendedAPIEnabled() OVERRIDE { |
54 return false; | 54 return false; |
55 } | 55 } |
56 | 56 |
57 private: | 57 private: |
58 TabStripSelectionModel selection_model_; | 58 TabStripSelectionModel selection_model_; |
59 | 59 |
(...skipping 24 matching lines...) Expand all 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 |