| 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 <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 926 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 937 | 937 |
| 938 void TabStripModel::ExecuteContextMenuCommand( | 938 void TabStripModel::ExecuteContextMenuCommand( |
| 939 int context_index, ContextMenuCommand command_id) { | 939 int context_index, ContextMenuCommand command_id) { |
| 940 DCHECK(command_id > CommandFirst && command_id < CommandLast); | 940 DCHECK(command_id > CommandFirst && command_id < CommandLast); |
| 941 switch (command_id) { | 941 switch (command_id) { |
| 942 case CommandNewTab: | 942 case CommandNewTab: |
| 943 content::RecordAction(UserMetricsAction("TabContextMenu_NewTab")); | 943 content::RecordAction(UserMetricsAction("TabContextMenu_NewTab")); |
| 944 UMA_HISTOGRAM_ENUMERATION("Tab.NewTab", | 944 UMA_HISTOGRAM_ENUMERATION("Tab.NewTab", |
| 945 TabStripModel::NEW_TAB_CONTEXT_MENU, | 945 TabStripModel::NEW_TAB_CONTEXT_MENU, |
| 946 TabStripModel::NEW_TAB_ENUM_COUNT); | 946 TabStripModel::NEW_TAB_ENUM_COUNT); |
| 947 delegate()->AddBlankTabAt(context_index + 1, true); | 947 delegate()->AddURLTabAt(GURL(), context_index + 1, true); |
| 948 break; | 948 break; |
| 949 | 949 |
| 950 case CommandReload: { | 950 case CommandReload: { |
| 951 content::RecordAction(UserMetricsAction("TabContextMenu_Reload")); | 951 content::RecordAction(UserMetricsAction("TabContextMenu_Reload")); |
| 952 std::vector<int> indices = GetIndicesForCommand(context_index); | 952 std::vector<int> indices = GetIndicesForCommand(context_index); |
| 953 for (size_t i = 0; i < indices.size(); ++i) { | 953 for (size_t i = 0; i < indices.size(); ++i) { |
| 954 WebContents* tab = GetWebContentsAt(indices[i]); | 954 WebContents* tab = GetWebContentsAt(indices[i]); |
| 955 if (tab) { | 955 if (tab) { |
| 956 CoreTabHelperDelegate* core_delegate = | 956 CoreTabHelperDelegate* core_delegate = |
| 957 CoreTabHelper::FromWebContents(tab)->delegate(); | 957 CoreTabHelper::FromWebContents(tab)->delegate(); |
| (...skipping 437 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1395 void TabStripModel::ForgetOpenersAndGroupsReferencing( | 1395 void TabStripModel::ForgetOpenersAndGroupsReferencing( |
| 1396 const WebContents* tab) { | 1396 const WebContents* tab) { |
| 1397 for (WebContentsDataVector::const_iterator i = contents_data_.begin(); | 1397 for (WebContentsDataVector::const_iterator i = contents_data_.begin(); |
| 1398 i != contents_data_.end(); ++i) { | 1398 i != contents_data_.end(); ++i) { |
| 1399 if ((*i)->group() == tab) | 1399 if ((*i)->group() == tab) |
| 1400 (*i)->set_group(NULL); | 1400 (*i)->set_group(NULL); |
| 1401 if ((*i)->opener() == tab) | 1401 if ((*i)->opener() == tab) |
| 1402 (*i)->set_opener(NULL); | 1402 (*i)->set_opener(NULL); |
| 1403 } | 1403 } |
| 1404 } | 1404 } |
| OLD | NEW |