| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/tabs/tab_strip_model.h" | 5 #include "chrome/browser/tabs/tab_strip_model.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/stl_util-inl.h" | 10 #include "base/stl_util-inl.h" |
| (...skipping 445 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 456 | 456 |
| 457 bool TabStripModel::IsTabPinned(int index) const { | 457 bool TabStripModel::IsTabPinned(int index) const { |
| 458 return contents_data_[index]->pinned; | 458 return contents_data_[index]->pinned; |
| 459 } | 459 } |
| 460 | 460 |
| 461 bool TabStripModel::IsMiniTab(int index) const { | 461 bool TabStripModel::IsMiniTab(int index) const { |
| 462 return IsTabPinned(index) || IsAppTab(index); | 462 return IsTabPinned(index) || IsAppTab(index); |
| 463 } | 463 } |
| 464 | 464 |
| 465 bool TabStripModel::IsAppTab(int index) const { | 465 bool TabStripModel::IsAppTab(int index) const { |
| 466 return GetTabContentsAt(index)->is_app(); | 466 TabContents* contents = GetTabContentsAt(index); |
| 467 return contents && contents->is_app(); |
| 467 } | 468 } |
| 468 | 469 |
| 469 bool TabStripModel::IsToolbarVisible(int index) const { | 470 bool TabStripModel::IsToolbarVisible(int index) const { |
| 470 Extension* extension_app = GetTabContentsAt(index)->extension_app(); | 471 Extension* extension_app = GetTabContentsAt(index)->extension_app(); |
| 471 if (!extension_app) | 472 if (!extension_app) |
| 472 return true; | 473 return true; |
| 473 | 474 |
| 474 ExtensionsService* service = profile()->GetExtensionsService(); | 475 ExtensionsService* service = profile()->GetExtensionsService(); |
| 475 ExtensionPrefs* prefs = service->extension_prefs(); | 476 ExtensionPrefs* prefs = service->extension_prefs(); |
| 476 return prefs->AreAppTabToolbarsVisible(extension_app->id()); | 477 return prefs->AreAppTabToolbarsVisible(extension_app->id()); |
| (...skipping 586 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1063 FOR_EACH_OBSERVER(TabStripModelObserver, observers_, | 1064 FOR_EACH_OBSERVER(TabStripModelObserver, observers_, |
| 1064 TabMoved(moved_data->contents, index, to_position)); | 1065 TabMoved(moved_data->contents, index, to_position)); |
| 1065 } | 1066 } |
| 1066 | 1067 |
| 1067 // static | 1068 // static |
| 1068 bool TabStripModel::OpenerMatches(const TabContentsData* data, | 1069 bool TabStripModel::OpenerMatches(const TabContentsData* data, |
| 1069 const NavigationController* opener, | 1070 const NavigationController* opener, |
| 1070 bool use_group) { | 1071 bool use_group) { |
| 1071 return data->opener == opener || (use_group && data->group == opener); | 1072 return data->opener == opener || (use_group && data->group == opener); |
| 1072 } | 1073 } |
| OLD | NEW |