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

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

Issue 6913026: Compact Navigation prototype (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Clang build fix. After commit/revert. Created 9 years, 7 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/browser_tab_strip_controller.h" 5 #include "chrome/browser/ui/views/tabs/browser_tab_strip_controller.h"
6 6
7 #include "base/auto_reset.h" 7 #include "base/auto_reset.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "chrome/browser/extensions/extension_tab_helper.h" 9 #include "chrome/browser/extensions/extension_tab_helper.h"
10 #include "chrome/browser/favicon/favicon_tab_helper.h" 10 #include "chrome/browser/favicon/favicon_tab_helper.h"
(...skipping 291 matching lines...) Expand 10 before | Expand all | Expand 10 after
302 static_cast<BrowserTabStripController*>(other->controller())->profile(); 302 static_cast<BrowserTabStripController*>(other->controller())->profile();
303 return other_profile == profile(); 303 return other_profile == profile();
304 } 304 }
305 305
306 void BrowserTabStripController::CreateNewTab() { 306 void BrowserTabStripController::CreateNewTab() {
307 UserMetrics::RecordAction(UserMetricsAction("NewTab_Button")); 307 UserMetrics::RecordAction(UserMetricsAction("NewTab_Button"));
308 308
309 model_->delegate()->AddBlankTab(true); 309 model_->delegate()->AddBlankTab(true);
310 } 310 }
311 311
312 void BrowserTabStripController::ClickActiveTab(int index) {
313 DCHECK(model_->active_index() == index);
314 model_->ActiveTabClicked(index);
315 }
316
312 //////////////////////////////////////////////////////////////////////////////// 317 ////////////////////////////////////////////////////////////////////////////////
313 // BrowserTabStripController, TabStripModelObserver implementation: 318 // BrowserTabStripController, TabStripModelObserver implementation:
314 319
315 void BrowserTabStripController::TabInsertedAt(TabContentsWrapper* contents, 320 void BrowserTabStripController::TabInsertedAt(TabContentsWrapper* contents,
316 int model_index, 321 int model_index,
317 bool active) { 322 bool active) {
318 DCHECK(contents); 323 DCHECK(contents);
319 DCHECK(model_index == TabStripModel::kNoTab || 324 DCHECK(model_index == TabStripModel::kNoTab ||
320 model_->ContainsIndex(model_index)); 325 model_->ContainsIndex(model_index));
321 326
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after
466 DCHECK(type.value == NotificationType::TAB_CLOSEABLE_STATE_CHANGED); 471 DCHECK(type.value == NotificationType::TAB_CLOSEABLE_STATE_CHANGED);
467 // Note that this notification may be fired during a model mutation and 472 // Note that this notification may be fired during a model mutation and
468 // possibly before the tabstrip has processed the change. 473 // possibly before the tabstrip has processed the change.
469 // Here, we just re-layout each existing tab to reflect the change in its 474 // Here, we just re-layout each existing tab to reflect the change in its
470 // closeable state, and then schedule paint for entire tabstrip. 475 // closeable state, and then schedule paint for entire tabstrip.
471 for (int i = 0; i < tabstrip_->tab_count(); ++i) { 476 for (int i = 0; i < tabstrip_->tab_count(); ++i) {
472 tabstrip_->base_tab_at_tab_index(i)->Layout(); 477 tabstrip_->base_tab_at_tab_index(i)->Layout();
473 } 478 }
474 tabstrip_->SchedulePaint(); 479 tabstrip_->SchedulePaint();
475 } 480 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/tabs/browser_tab_strip_controller.h ('k') | chrome/browser/ui/views/tabs/tab_controller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698