| 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 "base/strings/utf_string_conversions.h" | 7 #include "base/strings/utf_string_conversions.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/base/models/list_selection_model.h" | 10 #include "ui/base/models/list_selection_model.h" |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 53 virtual Tab* GetTabAt(Tab* tab, | 53 virtual Tab* GetTabAt(Tab* tab, |
| 54 const gfx::Point& tab_in_tab_coordinates) OVERRIDE { | 54 const gfx::Point& tab_in_tab_coordinates) OVERRIDE { |
| 55 return NULL; | 55 return NULL; |
| 56 } | 56 } |
| 57 virtual void OnMouseEventInTab(views::View* source, | 57 virtual void OnMouseEventInTab(views::View* source, |
| 58 const ui::MouseEvent& event) OVERRIDE {} | 58 const ui::MouseEvent& event) OVERRIDE {} |
| 59 virtual bool ShouldPaintTab(const Tab* tab, gfx::Rect* clip) OVERRIDE { | 59 virtual bool ShouldPaintTab(const Tab* tab, gfx::Rect* clip) OVERRIDE { |
| 60 return true; | 60 return true; |
| 61 } | 61 } |
| 62 virtual bool IsImmersiveStyle() const OVERRIDE { return immersive_style_; } | 62 virtual bool IsImmersiveStyle() const OVERRIDE { return immersive_style_; } |
| 63 virtual void UpdateTabAccessibilityState(const Tab* tab, |
| 64 ui::AXViewState* state) OVERRIDE{}; |
| 63 | 65 |
| 64 private: | 66 private: |
| 65 ui::ListSelectionModel selection_model_; | 67 ui::ListSelectionModel selection_model_; |
| 66 bool immersive_style_; | 68 bool immersive_style_; |
| 67 bool active_tab_; | 69 bool active_tab_; |
| 68 | 70 |
| 69 DISALLOW_COPY_AND_ASSIGN(FakeTabController); | 71 DISALLOW_COPY_AND_ASSIGN(FakeTabController); |
| 70 }; | 72 }; |
| 71 | 73 |
| 72 class TabTest : public views::ViewsTestBase { | 74 class TabTest : public views::ViewsTestBase { |
| (...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 289 tab.Layout(); | 291 tab.Layout(); |
| 290 gfx::Insets close_button_insets_2 = tab.close_button_->GetInsets(); | 292 gfx::Insets close_button_insets_2 = tab.close_button_->GetInsets(); |
| 291 EXPECT_EQ(close_button_insets.top(), close_button_insets_2.top()); | 293 EXPECT_EQ(close_button_insets.top(), close_button_insets_2.top()); |
| 292 EXPECT_EQ(close_button_insets.left(), close_button_insets_2.left()); | 294 EXPECT_EQ(close_button_insets.left(), close_button_insets_2.left()); |
| 293 EXPECT_EQ(close_button_insets.bottom(), close_button_insets_2.bottom()); | 295 EXPECT_EQ(close_button_insets.bottom(), close_button_insets_2.bottom()); |
| 294 EXPECT_EQ(close_button_insets.right(), close_button_insets_2.right()); | 296 EXPECT_EQ(close_button_insets.right(), close_button_insets_2.right()); |
| 295 | 297 |
| 296 // Also make sure the close button is sized as large as the tab. | 298 // Also make sure the close button is sized as large as the tab. |
| 297 EXPECT_EQ(50, tab.close_button_->bounds().height()); | 299 EXPECT_EQ(50, tab.close_button_->bounds().height()); |
| 298 } | 300 } |
| OLD | NEW |