Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(280)

Side by Side Diff: chrome/browser/ui/views/tabs/tab_unittest.cc

Issue 893843007: Experiment to hide close buttons of inactive tabs when using touch (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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 TouchWasUsedAsLastInput() override { return false; }
34 void SelectTab(Tab* tab) override {} 35 void SelectTab(Tab* tab) override {}
35 void ExtendSelectionTo(Tab* tab) override {} 36 void ExtendSelectionTo(Tab* tab) override {}
36 void ToggleSelected(Tab* tab) override {} 37 void ToggleSelected(Tab* tab) override {}
37 void AddSelectionFromAnchorTo(Tab* tab) override {} 38 void AddSelectionFromAnchorTo(Tab* tab) override {}
38 void CloseTab(Tab* tab, CloseTabSource source) override {} 39 void CloseTab(Tab* tab, CloseTabSource source) override {}
39 void ToggleTabAudioMute(Tab* tab) override {} 40 void ToggleTabAudioMute(Tab* tab) override {}
40 void ShowContextMenuForTab(Tab* tab, 41 void ShowContextMenuForTab(Tab* tab,
41 const gfx::Point& p, 42 const gfx::Point& p,
42 ui::MenuSourceType source_type) override {} 43 ui::MenuSourceType source_type) override {}
43 bool IsActiveTab(const Tab* tab) const override { return active_tab_; } 44 bool IsActiveTab(const Tab* tab) const override { return active_tab_; }
(...skipping 340 matching lines...) Expand 10 before | Expand all | Expand 10 after
384 EXPECT_EQ(50, tab.close_button_->bounds().height()); 385 EXPECT_EQ(50, tab.close_button_->bounds().height());
385 } 386 }
386 387
387 // Test in both a LTR and a RTL locale. Note: The fact that the UI code is 388 // 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 389 // 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 390 // 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 391 // 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 392 // there's no code in Tab that will erroneously subvert this automatic
392 // coordinate translation. http://crbug.com/384179 393 // coordinate translation. http://crbug.com/384179
393 INSTANTIATE_TEST_CASE_P(, TabTest, ::testing::Values(false, true)); 394 INSTANTIATE_TEST_CASE_P(, TabTest, ::testing::Values(false, true));
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698