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

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

Issue 1653113002: Fix favicon disappearing on pinned tabs (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: pkasting comments Created 4 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/fake_base_tab_strip_controller.h" 5 #include "chrome/browser/ui/views/tabs/fake_base_tab_strip_controller.h"
6 6
7 #include "chrome/browser/ui/views/tabs/tab_renderer_data.h" 7 #include "chrome/browser/ui/views/tabs/tab_renderer_data.h"
8 #include "chrome/browser/ui/views/tabs/tab_strip.h" 8 #include "chrome/browser/ui/views/tabs/tab_strip.h"
9 9
10 FakeBaseTabStripController::FakeBaseTabStripController() 10 FakeBaseTabStripController::FakeBaseTabStripController()
11 : tab_strip_(NULL), 11 : tab_strip_(NULL),
12 num_tabs_(0), 12 num_tabs_(0),
13 active_index_(-1) { 13 active_index_(-1) {
14 } 14 }
15 15
16 FakeBaseTabStripController::~FakeBaseTabStripController() { 16 FakeBaseTabStripController::~FakeBaseTabStripController() {
17 } 17 }
18 18
19 void FakeBaseTabStripController::AddTab(int index, bool is_active) { 19 void FakeBaseTabStripController::AddTab(int index, bool is_active) {
20 num_tabs_++; 20 num_tabs_++;
21 tab_strip_->AddTabAt(index, TabRendererData(), is_active); 21 tab_strip_->AddTabAt(index, TabRendererData(), is_active);
22 if (is_active) 22 if (is_active)
23 active_index_ = index; 23 active_index_ = index;
24 } 24 }
25 25
26 void FakeBaseTabStripController::AddPinnedTab(int index, bool is_active) {
27 TabRendererData data;
28 data.pinned = true;
29 num_tabs_++;
30 tab_strip_->AddTabAt(index, data, is_active);
31 if (is_active)
32 active_index_ = index;
33 }
34
26 void FakeBaseTabStripController::RemoveTab(int index) { 35 void FakeBaseTabStripController::RemoveTab(int index) {
27 num_tabs_--; 36 num_tabs_--;
28 tab_strip_->RemoveTabAt(index); 37 tab_strip_->RemoveTabAt(index);
29 if (active_index_ == index) 38 if (active_index_ == index)
30 active_index_ = -1; 39 active_index_ = -1;
31 } 40 }
32 41
33 const ui::ListSelectionModel& 42 const ui::ListSelectionModel&
34 FakeBaseTabStripController::GetSelectionModel() const { 43 FakeBaseTabStripController::GetSelectionModel() const {
35 return selection_model_; 44 return selection_model_;
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
132 141
133 void FakeBaseTabStripController::OnStartedDraggingTabs() { 142 void FakeBaseTabStripController::OnStartedDraggingTabs() {
134 } 143 }
135 144
136 void FakeBaseTabStripController::OnStoppedDraggingTabs() { 145 void FakeBaseTabStripController::OnStoppedDraggingTabs() {
137 } 146 }
138 147
139 void FakeBaseTabStripController::CheckFileSupported(const GURL& url) { 148 void FakeBaseTabStripController::CheckFileSupported(const GURL& url) {
140 tab_strip_->FileSupported(url, true); 149 tab_strip_->FileSupported(url, true);
141 } 150 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/tabs/fake_base_tab_strip_controller.h ('k') | chrome/browser/ui/views/tabs/media_indicator_button.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698