• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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
3 // found in the LICENSE file.
4 
5 #include "chrome/browser/ui/views/tabs/fake_base_tab_strip_controller.h"
6 
7 #include "chrome/browser/ui/views/tabs/tab_renderer_data.h"
8 #include "chrome/browser/ui/views/tabs/tab_strip.h"
9 
FakeBaseTabStripController()10 FakeBaseTabStripController::FakeBaseTabStripController()
11     : tab_strip_(NULL),
12       num_tabs_(0),
13       active_index_(-1) {
14 }
15 
~FakeBaseTabStripController()16 FakeBaseTabStripController::~FakeBaseTabStripController() {
17 }
18 
AddTab(int index,bool is_active)19 void FakeBaseTabStripController::AddTab(int index, bool is_active) {
20   num_tabs_++;
21   tab_strip_->AddTabAt(index, TabRendererData(), is_active);
22   if (is_active)
23     active_index_ = index;
24 }
25 
RemoveTab(int index)26 void FakeBaseTabStripController::RemoveTab(int index) {
27   num_tabs_--;
28   tab_strip_->RemoveTabAt(index);
29   if (active_index_ == index)
30     active_index_ = -1;
31 }
32 
GetSelectionModel()33 const ui::ListSelectionModel& FakeBaseTabStripController::GetSelectionModel() {
34   return selection_model_;
35 }
36 
GetCount() const37 int FakeBaseTabStripController::GetCount() const {
38   return num_tabs_;
39 }
40 
IsValidIndex(int index) const41 bool FakeBaseTabStripController::IsValidIndex(int index) const {
42   return index >= 0 && index < num_tabs_;
43 }
44 
IsActiveTab(int index) const45 bool FakeBaseTabStripController::IsActiveTab(int index) const {
46   if (!IsValidIndex(index))
47     return false;
48   return active_index_ == index;
49 }
50 
GetActiveIndex() const51 int FakeBaseTabStripController::GetActiveIndex() const {
52   return active_index_;
53 }
54 
IsTabSelected(int index) const55 bool FakeBaseTabStripController::IsTabSelected(int index) const {
56   return false;
57 }
58 
IsTabPinned(int index) const59 bool FakeBaseTabStripController::IsTabPinned(int index) const {
60   return false;
61 }
62 
IsNewTabPage(int index) const63 bool FakeBaseTabStripController::IsNewTabPage(int index) const {
64   return false;
65 }
66 
SelectTab(int index)67 void FakeBaseTabStripController::SelectTab(int index) {
68 }
69 
ExtendSelectionTo(int index)70 void FakeBaseTabStripController::ExtendSelectionTo(int index) {
71 }
72 
ToggleSelected(int index)73 void FakeBaseTabStripController::ToggleSelected(int index) {
74 }
75 
AddSelectionFromAnchorTo(int index)76 void FakeBaseTabStripController::AddSelectionFromAnchorTo(int index) {
77 }
78 
CloseTab(int index,CloseTabSource source)79 void FakeBaseTabStripController::CloseTab(int index, CloseTabSource source) {
80 }
81 
ShowContextMenuForTab(Tab * tab,const gfx::Point & p,ui::MenuSourceType source_type)82 void FakeBaseTabStripController::ShowContextMenuForTab(
83     Tab* tab,
84     const gfx::Point& p,
85     ui::MenuSourceType source_type) {
86 }
87 
UpdateLoadingAnimations()88 void FakeBaseTabStripController::UpdateLoadingAnimations() {
89 }
90 
HasAvailableDragActions() const91 int FakeBaseTabStripController::HasAvailableDragActions() const {
92   return 0;
93 }
94 
OnDropIndexUpdate(int index,bool drop_before)95 void FakeBaseTabStripController::OnDropIndexUpdate(int index,
96                                                    bool drop_before) {
97 }
98 
PerformDrop(bool drop_before,int index,const GURL & url)99 void FakeBaseTabStripController::PerformDrop(bool drop_before,
100                                              int index,
101                                              const GURL& url) {
102 }
103 
IsCompatibleWith(TabStrip * other) const104 bool FakeBaseTabStripController::IsCompatibleWith(TabStrip* other) const {
105   return false;
106 }
107 
CreateNewTab()108 void FakeBaseTabStripController::CreateNewTab() {
109 }
110 
CreateNewTabWithLocation(const base::string16 & location)111 void FakeBaseTabStripController::CreateNewTabWithLocation(
112     const base::string16& location) {
113 }
114 
IsIncognito()115 bool FakeBaseTabStripController::IsIncognito() {
116   return false;
117 }
118 
StackedLayoutMaybeChanged()119 void FakeBaseTabStripController::StackedLayoutMaybeChanged() {
120 }
121 
OnStartedDraggingTabs()122 void FakeBaseTabStripController::OnStartedDraggingTabs() {
123 }
124 
OnStoppedDraggingTabs()125 void FakeBaseTabStripController::OnStoppedDraggingTabs() {
126 }
127 
CheckFileSupported(const GURL & url)128 void FakeBaseTabStripController::CheckFileSupported(const GURL& url) {
129   tab_strip_->FileSupported(url, true);
130 }
131