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 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
71 } | 71 } |
72 bool CanPaintThrobberToLayer() const override { | 72 bool CanPaintThrobberToLayer() const override { |
73 return paint_throbber_to_layer_; | 73 return paint_throbber_to_layer_; |
74 } | 74 } |
75 SkColor GetToolbarTopSeparatorColor() const override { return SK_ColorBLACK; } | 75 SkColor GetToolbarTopSeparatorColor() const override { return SK_ColorBLACK; } |
76 int GetBackgroundResourceId(bool* custom_image) const override { | 76 int GetBackgroundResourceId(bool* custom_image) const override { |
77 *custom_image = false; | 77 *custom_image = false; |
78 return IDR_THEME_TAB_BACKGROUND; | 78 return IDR_THEME_TAB_BACKGROUND; |
79 } | 79 } |
80 void UpdateTabAccessibilityState(const Tab* tab, | 80 void UpdateTabAccessibilityState(const Tab* tab, |
81 ui::AXNodeData* node_data) override{}; | 81 ui::AXNodeData* node_data) override {} |
82 base::string16 GetAccessibleTabName(const Tab* tab) const override { | 82 base::string16 GetAccessibleTabName(const Tab* tab) const override { |
83 return base::string16(); | 83 return base::string16(); |
84 } | 84 } |
85 | 85 |
86 private: | 86 private: |
87 ui::ListSelectionModel selection_model_; | 87 ui::ListSelectionModel selection_model_; |
88 bool active_tab_ = false; | 88 bool active_tab_ = false; |
89 bool paint_throbber_to_layer_ = true; | 89 bool paint_throbber_to_layer_ = true; |
90 | 90 |
91 DISALLOW_COPY_AND_ASSIGN(FakeTabController); | 91 DISALLOW_COPY_AND_ASSIGN(FakeTabController); |
(...skipping 395 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
487 } | 487 } |
488 | 488 |
489 TEST_F(TabTest, TitleHiddenWhenSmall) { | 489 TEST_F(TabTest, TitleHiddenWhenSmall) { |
490 FakeTabController tab_controller; | 490 FakeTabController tab_controller; |
491 Tab tab(&tab_controller, nullptr); | 491 Tab tab(&tab_controller, nullptr); |
492 tab.SetBounds(0, 0, 100, 50); | 492 tab.SetBounds(0, 0, 100, 50); |
493 EXPECT_GT(GetTitleWidth(tab), 0); | 493 EXPECT_GT(GetTitleWidth(tab), 0); |
494 tab.SetBounds(0, 0, 0, 50); | 494 tab.SetBounds(0, 0, 0, 50); |
495 EXPECT_EQ(0, GetTitleWidth(tab)); | 495 EXPECT_EQ(0, GetTitleWidth(tab)); |
496 } | 496 } |
OLD | NEW |