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 642 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
653 // Close doesn't effect mini-tabs. | 653 // Close doesn't effect mini-tabs. |
654 return count() != IndexOfFirstNonMiniTab() && | 654 return count() != IndexOfFirstNonMiniTab() && |
655 context_index < (count() - 1); | 655 context_index < (count() - 1); |
656 case CommandDuplicate: | 656 case CommandDuplicate: |
657 return delegate_->CanDuplicateContentsAt(context_index); | 657 return delegate_->CanDuplicateContentsAt(context_index); |
658 case CommandRestoreTab: | 658 case CommandRestoreTab: |
659 return delegate_->CanRestoreTab(); | 659 return delegate_->CanRestoreTab(); |
660 case CommandTogglePinned: | 660 case CommandTogglePinned: |
661 return !IsAppTab(context_index); | 661 return !IsAppTab(context_index); |
662 case CommandBookmarkAllTabs: | 662 case CommandBookmarkAllTabs: |
663 return delegate_->CanBookmarkAllTabs(); | 663 return browser_defaults::bookmarks_enabled && |
| 664 delegate_->CanBookmarkAllTabs(); |
664 case CommandUseVerticalTabs: | 665 case CommandUseVerticalTabs: |
665 return true; | 666 return true; |
666 default: | 667 default: |
667 NOTREACHED(); | 668 NOTREACHED(); |
668 } | 669 } |
669 return false; | 670 return false; |
670 } | 671 } |
671 | 672 |
672 bool TabStripModel::IsContextMenuCommandChecked( | 673 bool TabStripModel::IsContextMenuCommandChecked( |
673 int context_index, | 674 int context_index, |
(...skipping 393 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1067 DCHECK(ContainsIndex(index)); | 1068 DCHECK(ContainsIndex(index)); |
1068 | 1069 |
1069 TabContents* old_contents = GetContentsAt(index); | 1070 TabContents* old_contents = GetContentsAt(index); |
1070 | 1071 |
1071 contents_data_[index]->contents = new_contents; | 1072 contents_data_[index]->contents = new_contents; |
1072 | 1073 |
1073 FOR_EACH_OBSERVER(TabStripModelObserver, observers_, | 1074 FOR_EACH_OBSERVER(TabStripModelObserver, observers_, |
1074 TabReplacedAt(old_contents, new_contents, index, type)); | 1075 TabReplacedAt(old_contents, new_contents, index, type)); |
1075 return old_contents; | 1076 return old_contents; |
1076 } | 1077 } |
OLD | NEW |