| 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 626 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 637 return false; | 637 return false; |
| 638 } | 638 } |
| 639 | 639 |
| 640 void TabStripModel::ExecuteContextMenuCommand( | 640 void TabStripModel::ExecuteContextMenuCommand( |
| 641 int context_index, ContextMenuCommand command_id) { | 641 int context_index, ContextMenuCommand command_id) { |
| 642 DCHECK(command_id > CommandFirst && command_id < CommandLast); | 642 DCHECK(command_id > CommandFirst && command_id < CommandLast); |
| 643 switch (command_id) { | 643 switch (command_id) { |
| 644 case CommandNewTab: | 644 case CommandNewTab: |
| 645 UserMetrics::RecordAction(UserMetricsAction("TabContextMenu_NewTab"), | 645 UserMetrics::RecordAction(UserMetricsAction("TabContextMenu_NewTab"), |
| 646 profile_); | 646 profile_); |
| 647 delegate()->AddBlankTabAt(context_index + 1, true); | 647 delegate()->AddBlankTab(true); |
| 648 break; | 648 break; |
| 649 case CommandReload: | 649 case CommandReload: |
| 650 UserMetrics::RecordAction(UserMetricsAction("TabContextMenu_Reload"), | 650 UserMetrics::RecordAction(UserMetricsAction("TabContextMenu_Reload"), |
| 651 profile_); | 651 profile_); |
| 652 GetContentsAt(context_index)->controller().Reload(true); | 652 GetContentsAt(context_index)->controller().Reload(true); |
| 653 break; | 653 break; |
| 654 case CommandDuplicate: | 654 case CommandDuplicate: |
| 655 UserMetrics::RecordAction(UserMetricsAction("TabContextMenu_Duplicate"), | 655 UserMetrics::RecordAction(UserMetricsAction("TabContextMenu_Duplicate"), |
| 656 profile_); | 656 profile_); |
| 657 delegate_->DuplicateContentsAt(context_index); | 657 delegate_->DuplicateContentsAt(context_index); |
| (...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 924 FOR_EACH_OBSERVER(TabStripModelObserver, observers_, | 924 FOR_EACH_OBSERVER(TabStripModelObserver, observers_, |
| 925 TabMoved(moved_data->contents, index, to_position)); | 925 TabMoved(moved_data->contents, index, to_position)); |
| 926 } | 926 } |
| 927 | 927 |
| 928 // static | 928 // static |
| 929 bool TabStripModel::OpenerMatches(const TabContentsData* data, | 929 bool TabStripModel::OpenerMatches(const TabContentsData* data, |
| 930 const NavigationController* opener, | 930 const NavigationController* opener, |
| 931 bool use_group) { | 931 bool use_group) { |
| 932 return data->opener == opener || (use_group && data->group == opener); | 932 return data->opener == opener || (use_group && data->group == opener); |
| 933 } | 933 } |
| OLD | NEW |