Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(86)

Side by Side Diff: chrome/browser/ui/tabs/tab_strip_model.cc

Issue 757033005: Make tab audible and muted states and cause available for an extension API (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Document cause within method declaration Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 1027 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 mute = !chrome::AreAllTabsMuted(*this, indices);
1042 if (mute) 1042 if (mute)
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), mute,
1049 chrome::kMutedToggleCauseUser);
1049 } 1050 }
1050 break; 1051 break;
1051 } 1052 }
1052 1053
1053 case CommandBookmarkAllTabs: { 1054 case CommandBookmarkAllTabs: {
1054 content::RecordAction( 1055 content::RecordAction(
1055 UserMetricsAction("TabContextMenu_BookmarkAllTabs")); 1056 UserMetricsAction("TabContextMenu_BookmarkAllTabs"));
1056 1057
1057 delegate_->BookmarkAllTabs(); 1058 delegate_->BookmarkAllTabs();
1058 break; 1059 break;
(...skipping 370 matching lines...) Expand 10 before | Expand all | Expand 10 after
1429 void TabStripModel::ForgetOpenersAndGroupsReferencing( 1430 void TabStripModel::ForgetOpenersAndGroupsReferencing(
1430 const WebContents* tab) { 1431 const WebContents* tab) {
1431 for (WebContentsDataVector::const_iterator i = contents_data_.begin(); 1432 for (WebContentsDataVector::const_iterator i = contents_data_.begin();
1432 i != contents_data_.end(); ++i) { 1433 i != contents_data_.end(); ++i) {
1433 if ((*i)->group() == tab) 1434 if ((*i)->group() == tab)
1434 (*i)->set_group(NULL); 1435 (*i)->set_group(NULL);
1435 if ((*i)->opener() == tab) 1436 if ((*i)->opener() == tab)
1436 (*i)->set_opener(NULL); 1437 (*i)->set_opener(NULL);
1437 } 1438 }
1438 } 1439 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/cocoa/tabs/tab_strip_controller.mm ('k') | chrome/browser/ui/tabs/tab_utils.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698