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 891 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
902 | 902 |
903 case CommandReload: { | 903 case CommandReload: { |
904 content::RecordAction(UserMetricsAction("TabContextMenu_Reload")); | 904 content::RecordAction(UserMetricsAction("TabContextMenu_Reload")); |
905 std::vector<int> indices = GetIndicesForCommand(context_index); | 905 std::vector<int> indices = GetIndicesForCommand(context_index); |
906 for (size_t i = 0; i < indices.size(); ++i) { | 906 for (size_t i = 0; i < indices.size(); ++i) { |
907 WebContents* tab = GetWebContentsAt(indices[i]); | 907 WebContents* tab = GetWebContentsAt(indices[i]); |
908 if (tab) { | 908 if (tab) { |
909 CoreTabHelperDelegate* core_delegate = | 909 CoreTabHelperDelegate* core_delegate = |
910 CoreTabHelper::FromWebContents(tab)->delegate(); | 910 CoreTabHelper::FromWebContents(tab)->delegate(); |
911 if (!core_delegate || core_delegate->CanReloadContents(tab)) | 911 if (!core_delegate || core_delegate->CanReloadContents(tab)) |
912 tab->GetController().Reload(true); | 912 tab->GetController().Reload(content::ReloadType::NORMAL, true); |
913 } | 913 } |
914 } | 914 } |
915 break; | 915 break; |
916 } | 916 } |
917 | 917 |
918 case CommandDuplicate: { | 918 case CommandDuplicate: { |
919 content::RecordAction(UserMetricsAction("TabContextMenu_Duplicate")); | 919 content::RecordAction(UserMetricsAction("TabContextMenu_Duplicate")); |
920 std::vector<int> indices = GetIndicesForCommand(context_index); | 920 std::vector<int> indices = GetIndicesForCommand(context_index); |
921 // Copy the WebContents off as the indices will change as tabs are | 921 // Copy the WebContents off as the indices will change as tabs are |
922 // duplicated. | 922 // duplicated. |
(...skipping 439 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1362 | 1362 |
1363 void TabStripModel::FixOpenersAndGroupsReferencing(int index) { | 1363 void TabStripModel::FixOpenersAndGroupsReferencing(int index) { |
1364 WebContents* old_contents = GetWebContentsAtImpl(index); | 1364 WebContents* old_contents = GetWebContentsAtImpl(index); |
1365 for (auto& data : contents_data_) { | 1365 for (auto& data : contents_data_) { |
1366 if (data->group() == old_contents) | 1366 if (data->group() == old_contents) |
1367 data->set_group(contents_data_[index]->group()); | 1367 data->set_group(contents_data_[index]->group()); |
1368 if (data->opener() == old_contents) | 1368 if (data->opener() == old_contents) |
1369 data->set_opener(contents_data_[index]->opener()); | 1369 data->set_opener(contents_data_[index]->opener()); |
1370 } | 1370 } |
1371 } | 1371 } |
OLD | NEW |