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

Side by Side Diff: chrome/browser/ui/views/tabs/browser_tab_strip_controller.cc

Issue 591963002: Tab audio mute control (views UI), behind a switch (off by default). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed mpearson's comments; added a few CloseTab UMA's. Created 6 years, 3 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/views/tabs/browser_tab_strip_controller.h" 5 #include "chrome/browser/ui/views/tabs/browser_tab_strip_controller.h"
6 6
7 #include "base/auto_reset.h" 7 #include "base/auto_reset.h"
8 #include "base/prefs/pref_service.h" 8 #include "base/prefs/pref_service.h"
9 #include "base/task_runner_util.h" 9 #include "base/task_runner_util.h"
10 #include "base/threading/sequenced_worker_pool.h" 10 #include "base/threading/sequenced_worker_pool.h"
(...skipping 282 matching lines...) Expand 10 before | Expand all | Expand 10 after
293 CloseTabSource source) { 293 CloseTabSource source) {
294 // Cancel any pending tab transition. 294 // Cancel any pending tab transition.
295 hover_tab_selector_.CancelTabTransition(); 295 hover_tab_selector_.CancelTabTransition();
296 296
297 tabstrip_->PrepareForCloseAt(model_index, source); 297 tabstrip_->PrepareForCloseAt(model_index, source);
298 model_->CloseWebContentsAt(model_index, 298 model_->CloseWebContentsAt(model_index,
299 TabStripModel::CLOSE_USER_GESTURE | 299 TabStripModel::CLOSE_USER_GESTURE |
300 TabStripModel::CLOSE_CREATE_HISTORICAL_TAB); 300 TabStripModel::CLOSE_CREATE_HISTORICAL_TAB);
301 } 301 }
302 302
303 void BrowserTabStripController::ToggleTabAudioMute(int model_index) {
304 model_->SetTabAudioMuted(model_index, !model_->IsTabAudioMuted(model_index));
305 }
306
303 void BrowserTabStripController::ShowContextMenuForTab( 307 void BrowserTabStripController::ShowContextMenuForTab(
304 Tab* tab, 308 Tab* tab,
305 const gfx::Point& p, 309 const gfx::Point& p,
306 ui::MenuSourceType source_type) { 310 ui::MenuSourceType source_type) {
307 context_menu_contents_.reset(new TabContextMenuContents(tab, this)); 311 context_menu_contents_.reset(new TabContextMenuContents(tab, this));
308 context_menu_contents_->RunMenuAt(p, source_type); 312 context_menu_contents_->RunMenuAt(p, source_type);
309 } 313 }
310 314
311 void BrowserTabStripController::UpdateLoadingAnimations() { 315 void BrowserTabStripController::UpdateLoadingAnimations() {
312 // Don't use the model count here as it's possible for this to be invoked 316 // Don't use the model count here as it's possible for this to be invoked
(...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after
579 url, 583 url,
580 mime_type.empty() || 584 mime_type.empty() ||
581 net::IsSupportedMimeType(mime_type) || 585 net::IsSupportedMimeType(mime_type) ||
582 content::PluginService::GetInstance()->GetPluginInfo( 586 content::PluginService::GetInstance()->GetPluginInfo(
583 -1, // process ID 587 -1, // process ID
584 MSG_ROUTING_NONE, // routing ID 588 MSG_ROUTING_NONE, // routing ID
585 model_->profile()->GetResourceContext(), 589 model_->profile()->GetResourceContext(),
586 url, GURL(), mime_type, false, 590 url, GURL(), mime_type, false,
587 NULL, &plugin, NULL)); 591 NULL, &plugin, NULL));
588 } 592 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698