| 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/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/browser_process.h" | 9 #include "chrome/browser/browser_process.h" |
| 10 #include "chrome/browser/extensions/tab_helper.h" | 10 #include "chrome/browser/extensions/tab_helper.h" |
| (...skipping 324 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 335 chrome::Navigate(¶ms); | 335 chrome::Navigate(¶ms); |
| 336 } | 336 } |
| 337 | 337 |
| 338 bool BrowserTabStripController::IsCompatibleWith(TabStrip* other) const { | 338 bool BrowserTabStripController::IsCompatibleWith(TabStrip* other) const { |
| 339 Profile* other_profile = | 339 Profile* other_profile = |
| 340 static_cast<BrowserTabStripController*>(other->controller())->profile(); | 340 static_cast<BrowserTabStripController*>(other->controller())->profile(); |
| 341 return other_profile == profile(); | 341 return other_profile == profile(); |
| 342 } | 342 } |
| 343 | 343 |
| 344 void BrowserTabStripController::CreateNewTab() { | 344 void BrowserTabStripController::CreateNewTab() { |
| 345 model_->delegate()->AddBlankTab(true); | 345 model_->delegate()->AddBlankTabAt(-1, true); |
| 346 } | 346 } |
| 347 | 347 |
| 348 void BrowserTabStripController::ClickActiveTab(int index) { | 348 void BrowserTabStripController::ClickActiveTab(int index) { |
| 349 DCHECK(model_->active_index() == index); | 349 DCHECK(model_->active_index() == index); |
| 350 model_->ActiveTabClicked(index); | 350 model_->ActiveTabClicked(index); |
| 351 } | 351 } |
| 352 | 352 |
| 353 bool BrowserTabStripController::IsIncognito() { | 353 bool BrowserTabStripController::IsIncognito() { |
| 354 return browser_->profile()->IsOffTheRecord(); | 354 return browser_->profile()->IsOffTheRecord(); |
| 355 } | 355 } |
| (...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 521 SetTabRendererDataFromModel(contents->web_contents(), index, &data, NEW_TAB); | 521 SetTabRendererDataFromModel(contents->web_contents(), index, &data, NEW_TAB); |
| 522 tabstrip_->AddTabAt(index, data, is_active); | 522 tabstrip_->AddTabAt(index, data, is_active); |
| 523 } | 523 } |
| 524 | 524 |
| 525 void BrowserTabStripController::UpdateLayoutType() { | 525 void BrowserTabStripController::UpdateLayoutType() { |
| 526 bool adjust_layout = false; | 526 bool adjust_layout = false; |
| 527 TabStripLayoutType layout_type = | 527 TabStripLayoutType layout_type = |
| 528 DetermineTabStripLayout(g_browser_process->local_state(), &adjust_layout); | 528 DetermineTabStripLayout(g_browser_process->local_state(), &adjust_layout); |
| 529 tabstrip_->SetLayoutType(layout_type, adjust_layout); | 529 tabstrip_->SetLayoutType(layout_type, adjust_layout); |
| 530 } | 530 } |
| OLD | NEW |