| 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 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 73 bool CanPaintThrobberToLayer() const override { | 73 bool CanPaintThrobberToLayer() const override { |
| 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::AXViewState* state) override{}; | 83 ui::AXNodeData* node_data) override{}; |
| 84 | 84 |
| 85 private: | 85 private: |
| 86 ui::ListSelectionModel selection_model_; | 86 ui::ListSelectionModel selection_model_; |
| 87 bool immersive_style_ = false; | 87 bool immersive_style_ = false; |
| 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); |
| 92 }; | 92 }; |
| 93 | 93 |
| (...skipping 394 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 488 } | 488 } |
| 489 | 489 |
| 490 TEST_F(TabTest, TitleHiddenWhenSmall) { | 490 TEST_F(TabTest, TitleHiddenWhenSmall) { |
| 491 FakeTabController tab_controller; | 491 FakeTabController tab_controller; |
| 492 Tab tab(&tab_controller, nullptr); | 492 Tab tab(&tab_controller, nullptr); |
| 493 tab.SetBounds(0, 0, 100, 50); | 493 tab.SetBounds(0, 0, 100, 50); |
| 494 EXPECT_GT(GetTitleWidth(tab), 0); | 494 EXPECT_GT(GetTitleWidth(tab), 0); |
| 495 tab.SetBounds(0, 0, 0, 50); | 495 tab.SetBounds(0, 0, 0, 50); |
| 496 EXPECT_EQ(0, GetTitleWidth(tab)); | 496 EXPECT_EQ(0, GetTitleWidth(tab)); |
| 497 } | 497 } |
| OLD | NEW |