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/tabs/tab_strip_model.h" | 5 #include "chrome/browser/ui/tabs/tab_strip_model.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <map> | 8 #include <map> |
9 #include <set> | 9 #include <set> |
10 #include <string> | 10 #include <string> |
(...skipping 948 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
959 void TabStripModel::ExecuteContextMenuCommand( | 959 void TabStripModel::ExecuteContextMenuCommand( |
960 int context_index, ContextMenuCommand command_id) { | 960 int context_index, ContextMenuCommand command_id) { |
961 DCHECK(command_id > CommandFirst && command_id < CommandLast); | 961 DCHECK(command_id > CommandFirst && command_id < CommandLast); |
962 switch (command_id) { | 962 switch (command_id) { |
963 case CommandNewTab: | 963 case CommandNewTab: |
964 content::RecordAction(UserMetricsAction("TabContextMenu_NewTab")); | 964 content::RecordAction(UserMetricsAction("TabContextMenu_NewTab")); |
965 UMA_HISTOGRAM_ENUMERATION("Tab.NewTab", | 965 UMA_HISTOGRAM_ENUMERATION("Tab.NewTab", |
966 TabStripModel::NEW_TAB_CONTEXT_MENU, | 966 TabStripModel::NEW_TAB_CONTEXT_MENU, |
967 TabStripModel::NEW_TAB_ENUM_COUNT); | 967 TabStripModel::NEW_TAB_ENUM_COUNT); |
968 delegate()->AddTabAt(GURL(), context_index + 1, true); | 968 delegate()->AddTabAt(GURL(), context_index + 1, true); |
| 969 // TODO(bruthig): |
969 break; | 970 break; |
970 | 971 |
971 case CommandReload: { | 972 case CommandReload: { |
972 content::RecordAction(UserMetricsAction("TabContextMenu_Reload")); | 973 content::RecordAction(UserMetricsAction("TabContextMenu_Reload")); |
973 std::vector<int> indices = GetIndicesForCommand(context_index); | 974 std::vector<int> indices = GetIndicesForCommand(context_index); |
974 for (size_t i = 0; i < indices.size(); ++i) { | 975 for (size_t i = 0; i < indices.size(); ++i) { |
975 WebContents* tab = GetWebContentsAt(indices[i]); | 976 WebContents* tab = GetWebContentsAt(indices[i]); |
976 if (tab) { | 977 if (tab) { |
977 CoreTabHelperDelegate* core_delegate = | 978 CoreTabHelperDelegate* core_delegate = |
978 CoreTabHelper::FromWebContents(tab)->delegate(); | 979 CoreTabHelper::FromWebContents(tab)->delegate(); |
(...skipping 463 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1442 | 1443 |
1443 void TabStripModel::FixOpenersAndGroupsReferencing(int index) { | 1444 void TabStripModel::FixOpenersAndGroupsReferencing(int index) { |
1444 WebContents* old_contents = GetWebContentsAtImpl(index); | 1445 WebContents* old_contents = GetWebContentsAtImpl(index); |
1445 for (WebContentsData* data : contents_data_) { | 1446 for (WebContentsData* data : contents_data_) { |
1446 if (data->group() == old_contents) | 1447 if (data->group() == old_contents) |
1447 data->set_group(contents_data_[index]->group()); | 1448 data->set_group(contents_data_[index]->group()); |
1448 if (data->opener() == old_contents) | 1449 if (data->opener() == old_contents) |
1449 data->set_opener(contents_data_[index]->opener()); | 1450 data->set_opener(contents_data_[index]->opener()); |
1450 } | 1451 } |
1451 } | 1452 } |
OLD | NEW |