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 1020 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1031 for (size_t i = indices.size(); i > 0; --i) { | 1031 for (size_t i = indices.size(); i > 0; --i) { |
1032 if (!IsAppTab(indices[i - 1])) | 1032 if (!IsAppTab(indices[i - 1])) |
1033 SetTabPinned(indices[i - 1], false); | 1033 SetTabPinned(indices[i - 1], false); |
1034 } | 1034 } |
1035 } | 1035 } |
1036 break; | 1036 break; |
1037 } | 1037 } |
1038 | 1038 |
1039 case CommandToggleTabAudioMuted: { | 1039 case CommandToggleTabAudioMuted: { |
1040 const std::vector<int>& indices = GetIndicesForCommand(context_index); | 1040 const std::vector<int>& indices = GetIndicesForCommand(context_index); |
1041 const bool mute = !chrome::AreAllTabsMuted(*this, indices); | 1041 const bool muted = !chrome::AreAllTabsMuted(*this, indices); |
1042 if (mute) | 1042 if (muted) |
1043 content::RecordAction(UserMetricsAction("TabContextMenu_MuteTabs")); | 1043 content::RecordAction(UserMetricsAction("TabContextMenu_MuteTabs")); |
1044 else | 1044 else |
1045 content::RecordAction(UserMetricsAction("TabContextMenu_UnmuteTabs")); | 1045 content::RecordAction(UserMetricsAction("TabContextMenu_UnmuteTabs")); |
1046 for (std::vector<int>::const_iterator i = indices.begin(); | 1046 for (std::vector<int>::const_iterator i = indices.begin(); |
1047 i != indices.end(); ++i) { | 1047 i != indices.end(); ++i) { |
1048 chrome::SetTabAudioMuted(GetWebContentsAt(*i), mute); | 1048 chrome::SetTabAudioMuted(GetWebContentsAt(*i), muted, "user"); |
1049 } | 1049 } |
1050 break; | 1050 break; |
1051 } | 1051 } |
1052 | 1052 |
1053 case CommandBookmarkAllTabs: { | 1053 case CommandBookmarkAllTabs: { |
1054 content::RecordAction( | 1054 content::RecordAction( |
1055 UserMetricsAction("TabContextMenu_BookmarkAllTabs")); | 1055 UserMetricsAction("TabContextMenu_BookmarkAllTabs")); |
1056 | 1056 |
1057 delegate_->BookmarkAllTabs(); | 1057 delegate_->BookmarkAllTabs(); |
1058 break; | 1058 break; |
(...skipping 370 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1429 void TabStripModel::ForgetOpenersAndGroupsReferencing( | 1429 void TabStripModel::ForgetOpenersAndGroupsReferencing( |
1430 const WebContents* tab) { | 1430 const WebContents* tab) { |
1431 for (WebContentsDataVector::const_iterator i = contents_data_.begin(); | 1431 for (WebContentsDataVector::const_iterator i = contents_data_.begin(); |
1432 i != contents_data_.end(); ++i) { | 1432 i != contents_data_.end(); ++i) { |
1433 if ((*i)->group() == tab) | 1433 if ((*i)->group() == tab) |
1434 (*i)->set_group(NULL); | 1434 (*i)->set_group(NULL); |
1435 if ((*i)->opener() == tab) | 1435 if ((*i)->opener() == tab) |
1436 (*i)->set_opener(NULL); | 1436 (*i)->set_opener(NULL); |
1437 } | 1437 } |
1438 } | 1438 } |
OLD | NEW |