| 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/i18n/rtl.h" | 7 #include "base/i18n/rtl.h" |
| 8 #include "base/strings/utf_string_conversions.h" | 8 #include "base/strings/utf_string_conversions.h" |
| 9 #include "chrome/browser/ui/tabs/tab_utils.h" | 9 #include "chrome/browser/ui/tabs/tab_utils.h" |
| 10 #include "chrome/browser/ui/views/tabs/media_indicator_button.h" | 10 #include "chrome/browser/ui/views/tabs/media_indicator_button.h" |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 } | 24 } |
| 25 ~FakeTabController() override {} | 25 ~FakeTabController() override {} |
| 26 | 26 |
| 27 void set_immersive_style(bool value) { immersive_style_ = value; } | 27 void set_immersive_style(bool value) { immersive_style_ = value; } |
| 28 void set_active_tab(bool value) { active_tab_ = value; } | 28 void set_active_tab(bool value) { active_tab_ = value; } |
| 29 | 29 |
| 30 const ui::ListSelectionModel& GetSelectionModel() override { | 30 const ui::ListSelectionModel& GetSelectionModel() override { |
| 31 return selection_model_; | 31 return selection_model_; |
| 32 } | 32 } |
| 33 bool SupportsMultipleSelection() override { return false; } | 33 bool SupportsMultipleSelection() override { return false; } |
| 34 bool ShouldHideCloseButtonForInactiveTab(const Tab* tab) override { |
| 35 return false; |
| 36 } |
| 34 void SelectTab(Tab* tab) override {} | 37 void SelectTab(Tab* tab) override {} |
| 35 void ExtendSelectionTo(Tab* tab) override {} | 38 void ExtendSelectionTo(Tab* tab) override {} |
| 36 void ToggleSelected(Tab* tab) override {} | 39 void ToggleSelected(Tab* tab) override {} |
| 37 void AddSelectionFromAnchorTo(Tab* tab) override {} | 40 void AddSelectionFromAnchorTo(Tab* tab) override {} |
| 38 void CloseTab(Tab* tab, CloseTabSource source) override {} | 41 void CloseTab(Tab* tab, CloseTabSource source) override {} |
| 39 void ToggleTabAudioMute(Tab* tab) override {} | 42 void ToggleTabAudioMute(Tab* tab) override {} |
| 40 void ShowContextMenuForTab(Tab* tab, | 43 void ShowContextMenuForTab(Tab* tab, |
| 41 const gfx::Point& p, | 44 const gfx::Point& p, |
| 42 ui::MenuSourceType source_type) override {} | 45 ui::MenuSourceType source_type) override {} |
| 43 bool IsActiveTab(const Tab* tab) const override { return active_tab_; } | 46 bool IsActiveTab(const Tab* tab) const override { return active_tab_; } |
| (...skipping 340 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 384 EXPECT_EQ(50, tab.close_button_->bounds().height()); | 387 EXPECT_EQ(50, tab.close_button_->bounds().height()); |
| 385 } | 388 } |
| 386 | 389 |
| 387 // Test in both a LTR and a RTL locale. Note: The fact that the UI code is | 390 // Test in both a LTR and a RTL locale. Note: The fact that the UI code is |
| 388 // configured for an RTL locale does *not* change how the coordinates are | 391 // configured for an RTL locale does *not* change how the coordinates are |
| 389 // examined in the tests above because views::View and friends are supposed to | 392 // examined in the tests above because views::View and friends are supposed to |
| 390 // auto-mirror the widgets when painting. Thus, what we're testing here is that | 393 // auto-mirror the widgets when painting. Thus, what we're testing here is that |
| 391 // there's no code in Tab that will erroneously subvert this automatic | 394 // there's no code in Tab that will erroneously subvert this automatic |
| 392 // coordinate translation. http://crbug.com/384179 | 395 // coordinate translation. http://crbug.com/384179 |
| 393 INSTANTIATE_TEST_CASE_P(, TabTest, ::testing::Values(false, true)); | 396 INSTANTIATE_TEST_CASE_P(, TabTest, ::testing::Values(false, true)); |
| OLD | NEW |