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

Side by Side 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 unified diff | 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 »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/browser_command_controller.h" 5 #include "chrome/browser/ui/browser_command_controller.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <string> 9 #include <string>
10 10
(...skipping 627 matching lines...) Expand 10 before | Expand all | Expand 10 after
638 launchable->Launch(mash::mojom::kWindow, 638 launchable->Launch(mash::mojom::kWindow,
639 mash::mojom::LaunchMode::DEFAULT); 639 mash::mojom::LaunchMode::DEFAULT);
640 } else { 640 } else {
641 ash::accelerators::ToggleTouchHudProjection(); 641 ash::accelerators::ToggleTouchHudProjection();
642 } 642 }
643 break; 643 break;
644 #endif 644 #endif
645 case IDC_ROUTE_MEDIA: 645 case IDC_ROUTE_MEDIA:
646 RouteMedia(browser_); 646 RouteMedia(browser_);
647 break; 647 break;
648 case IDC_WINDOW_MUTE_TAB:
649 MuteTab(browser_);
650 break;
651 case IDC_WINDOW_PIN_TAB:
652 PinTab(browser_);
653 break;
648 654
649 default: 655 default:
650 LOG(WARNING) << "Received Unimplemented Command: " << id; 656 LOG(WARNING) << "Received Unimplemented Command: " << id;
651 break; 657 break;
652 } 658 }
653 } 659 }
654 660
655 //////////////////////////////////////////////////////////////////////////////// 661 ////////////////////////////////////////////////////////////////////////////////
656 // BrowserCommandController, SigninPrefObserver implementation: 662 // BrowserCommandController, SigninPrefObserver implementation:
657 663
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after
836 842
837 // These are always enabled; the menu determines their menu item visibility. 843 // These are always enabled; the menu determines their menu item visibility.
838 command_updater_.UpdateCommandEnabled(IDC_UPGRADE_DIALOG, true); 844 command_updater_.UpdateCommandEnabled(IDC_UPGRADE_DIALOG, true);
839 command_updater_.UpdateCommandEnabled(IDC_VIEW_INCOMPATIBILITIES, true); 845 command_updater_.UpdateCommandEnabled(IDC_VIEW_INCOMPATIBILITIES, true);
840 846
841 // Distill current page. 847 // Distill current page.
842 command_updater_.UpdateCommandEnabled( 848 command_updater_.UpdateCommandEnabled(
843 IDC_DISTILL_PAGE, base::CommandLine::ForCurrentProcess()->HasSwitch( 849 IDC_DISTILL_PAGE, base::CommandLine::ForCurrentProcess()->HasSwitch(
844 switches::kEnableDomDistiller)); 850 switches::kEnableDomDistiller));
845 851
852 command_updater_.UpdateCommandEnabled(IDC_WINDOW_MUTE_TAB, normal_window);
853 command_updater_.UpdateCommandEnabled(IDC_WINDOW_PIN_TAB, normal_window);
854
846 // Initialize other commands whose state changes based on various conditions. 855 // Initialize other commands whose state changes based on various conditions.
847 UpdateCommandsForFullscreenMode(); 856 UpdateCommandsForFullscreenMode();
848 UpdateCommandsForContentRestrictionState(); 857 UpdateCommandsForContentRestrictionState();
849 UpdateCommandsForBookmarkEditing(); 858 UpdateCommandsForBookmarkEditing();
850 UpdateCommandsForIncognitoAvailability(); 859 UpdateCommandsForIncognitoAvailability();
851 } 860 }
852 861
853 // static 862 // static
854 void BrowserCommandController::UpdateSharedCommandsForIncognitoAvailability( 863 void BrowserCommandController::UpdateSharedCommandsForIncognitoAvailability(
855 CommandUpdater* command_updater, 864 CommandUpdater* command_updater,
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
911 command_updater_.UpdateCommandEnabled(IDC_FORWARD, CanGoForward(browser_)); 920 command_updater_.UpdateCommandEnabled(IDC_FORWARD, CanGoForward(browser_));
912 command_updater_.UpdateCommandEnabled(IDC_RELOAD, CanReload(browser_)); 921 command_updater_.UpdateCommandEnabled(IDC_RELOAD, CanReload(browser_));
913 command_updater_.UpdateCommandEnabled(IDC_RELOAD_BYPASSING_CACHE, 922 command_updater_.UpdateCommandEnabled(IDC_RELOAD_BYPASSING_CACHE,
914 CanReload(browser_)); 923 CanReload(browser_));
915 command_updater_.UpdateCommandEnabled(IDC_RELOAD_CLEARING_CACHE, 924 command_updater_.UpdateCommandEnabled(IDC_RELOAD_CLEARING_CACHE,
916 CanReload(browser_)); 925 CanReload(browser_));
917 926
918 // Window management commands 927 // Window management commands
919 command_updater_.UpdateCommandEnabled(IDC_DUPLICATE_TAB, 928 command_updater_.UpdateCommandEnabled(IDC_DUPLICATE_TAB,
920 !browser_->is_app() && CanDuplicateTab(browser_)); 929 !browser_->is_app() && CanDuplicateTab(browser_));
930 command_updater_.UpdateCommandEnabled(IDC_WINDOW_MUTE_TAB,
931 !browser_->is_app());
932 command_updater_.UpdateCommandEnabled(IDC_WINDOW_PIN_TAB,
933 !browser_->is_app());
921 934
922 // Page-related commands 935 // Page-related commands
923 window()->SetStarredState( 936 window()->SetStarredState(
924 BookmarkTabHelper::FromWebContents(current_web_contents)->is_starred()); 937 BookmarkTabHelper::FromWebContents(current_web_contents)->is_starred());
925 window()->ZoomChangedForActiveTab(false); 938 window()->ZoomChangedForActiveTab(false);
926 command_updater_.UpdateCommandEnabled(IDC_VIEW_SOURCE, 939 command_updater_.UpdateCommandEnabled(IDC_VIEW_SOURCE,
927 CanViewSource(browser_)); 940 CanViewSource(browser_));
928 command_updater_.UpdateCommandEnabled(IDC_EMAIL_PAGE_LOCATION, 941 command_updater_.UpdateCommandEnabled(IDC_EMAIL_PAGE_LOCATION,
929 CanEmailPageLocation(browser_)); 942 CanEmailPageLocation(browser_));
930 if (browser_->is_devtools()) 943 if (browser_->is_devtools())
(...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after
1150 1163
1151 BrowserWindow* BrowserCommandController::window() { 1164 BrowserWindow* BrowserCommandController::window() {
1152 return browser_->window(); 1165 return browser_->window();
1153 } 1166 }
1154 1167
1155 Profile* BrowserCommandController::profile() { 1168 Profile* BrowserCommandController::profile() {
1156 return browser_->profile(); 1169 return browser_->profile();
1157 } 1170 }
1158 1171
1159 } // namespace chrome 1172 } // namespace chrome
OLDNEW
« 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