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

Unified Diff: chrome/browser/ui/browser_command_controller.cc

Issue 2876223003: cocoa: add some tab-manipulation menu items (Closed)
Patch Set: remove top separator Created 3 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/app/nibs/MainMenu.xib ('k') | chrome/browser/ui/browser_commands.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/browser_command_controller.cc
diff --git a/chrome/browser/ui/browser_command_controller.cc b/chrome/browser/ui/browser_command_controller.cc
index e917e1714c823428dc008522b8c9da25e9a191f0..9993b145fa02ba2ec3c46faf36da4273d6372c1f 100644
--- a/chrome/browser/ui/browser_command_controller.cc
+++ b/chrome/browser/ui/browser_command_controller.cc
@@ -645,6 +645,12 @@ void BrowserCommandController::ExecuteCommandWithDisposition(
case IDC_ROUTE_MEDIA:
RouteMedia(browser_);
break;
+ case IDC_WINDOW_MUTE_TAB:
+ MuteTab(browser_);
+ break;
+ case IDC_WINDOW_PIN_TAB:
+ PinTab(browser_);
+ break;
default:
LOG(WARNING) << "Received Unimplemented Command: " << id;
@@ -843,6 +849,9 @@ void BrowserCommandController::InitCommandState() {
IDC_DISTILL_PAGE, base::CommandLine::ForCurrentProcess()->HasSwitch(
switches::kEnableDomDistiller));
+ command_updater_.UpdateCommandEnabled(IDC_WINDOW_MUTE_TAB, normal_window);
+ command_updater_.UpdateCommandEnabled(IDC_WINDOW_PIN_TAB, normal_window);
+
// Initialize other commands whose state changes based on various conditions.
UpdateCommandsForFullscreenMode();
UpdateCommandsForContentRestrictionState();
@@ -918,6 +927,10 @@ void BrowserCommandController::UpdateCommandsForTabState() {
// Window management commands
command_updater_.UpdateCommandEnabled(IDC_DUPLICATE_TAB,
!browser_->is_app() && CanDuplicateTab(browser_));
+ command_updater_.UpdateCommandEnabled(IDC_WINDOW_MUTE_TAB,
+ !browser_->is_app());
+ command_updater_.UpdateCommandEnabled(IDC_WINDOW_PIN_TAB,
+ !browser_->is_app());
// Page-related commands
window()->SetStarredState(
« no previous file with comments | « chrome/app/nibs/MainMenu.xib ('k') | chrome/browser/ui/browser_commands.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698