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 <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include "base/macros.h" | 9 #include "base/macros.h" |
10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
74 return paint_throbber_to_layer_; | 74 return paint_throbber_to_layer_; |
75 } | 75 } |
76 bool IsImmersiveStyle() const override { return immersive_style_; } | 76 bool IsImmersiveStyle() const override { return immersive_style_; } |
77 SkColor GetToolbarTopSeparatorColor() const override { return SK_ColorBLACK; } | 77 SkColor GetToolbarTopSeparatorColor() const override { return SK_ColorBLACK; } |
78 int GetBackgroundResourceId(bool* custom_image) const override { | 78 int GetBackgroundResourceId(bool* custom_image) const override { |
79 *custom_image = false; | 79 *custom_image = false; |
80 return IDR_THEME_TAB_BACKGROUND; | 80 return IDR_THEME_TAB_BACKGROUND; |
81 } | 81 } |
82 void UpdateTabAccessibilityState(const Tab* tab, | 82 void UpdateTabAccessibilityState(const Tab* tab, |
83 ui::AXNodeData* node_data) override{}; | 83 ui::AXNodeData* node_data) override{}; |
84 base::string16 GetAccessibleTabName() const override { | |
85 return base::string16(); | |
86 } | |
87 | 84 |
88 private: | 85 private: |
89 ui::ListSelectionModel selection_model_; | 86 ui::ListSelectionModel selection_model_; |
90 bool immersive_style_ = false; | 87 bool immersive_style_ = false; |
91 bool active_tab_ = false; | 88 bool active_tab_ = false; |
92 bool paint_throbber_to_layer_ = true; | 89 bool paint_throbber_to_layer_ = true; |
93 | 90 |
94 DISALLOW_COPY_AND_ASSIGN(FakeTabController); | 91 DISALLOW_COPY_AND_ASSIGN(FakeTabController); |
95 }; | 92 }; |
96 | 93 |
(...skipping 394 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
491 } | 488 } |
492 | 489 |
493 TEST_F(TabTest, TitleHiddenWhenSmall) { | 490 TEST_F(TabTest, TitleHiddenWhenSmall) { |
494 FakeTabController tab_controller; | 491 FakeTabController tab_controller; |
495 Tab tab(&tab_controller, nullptr); | 492 Tab tab(&tab_controller, nullptr); |
496 tab.SetBounds(0, 0, 100, 50); | 493 tab.SetBounds(0, 0, 100, 50); |
497 EXPECT_GT(GetTitleWidth(tab), 0); | 494 EXPECT_GT(GetTitleWidth(tab), 0); |
498 tab.SetBounds(0, 0, 0, 50); | 495 tab.SetBounds(0, 0, 0, 50); |
499 EXPECT_EQ(0, GetTitleWidth(tab)); | 496 EXPECT_EQ(0, GetTitleWidth(tab)); |
500 } | 497 } |
OLD | NEW |