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

Side by Side Diff: chrome/browser/ui/cocoa/browser_window_command_handler.mm

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/browser/ui/browser_commands.cc ('k') | chrome/browser/ui/tabs/tab_strip_model.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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 #import "chrome/browser/ui/cocoa/browser_window_command_handler.h" 5 #import "chrome/browser/ui/cocoa/browser_window_command_handler.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #import "base/mac/foundation_util.h" 8 #import "base/mac/foundation_util.h"
9 #include "chrome/app/chrome_command_ids.h" 9 #include "chrome/app/chrome_command_ids.h"
10 #import "chrome/browser/app_controller_mac.h" 10 #import "chrome/browser/app_controller_mac.h"
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 if (tag == IDC_SHOW_BOOKMARK_BAR) { 49 if (tag == IDC_SHOW_BOOKMARK_BAR) {
50 SetToggleState(browser->window()->IsBookmarkBarVisible(), item); 50 SetToggleState(browser->window()->IsBookmarkBarVisible(), item);
51 return; 51 return;
52 } 52 }
53 53
54 if (tag == IDC_TOGGLE_FULLSCREEN_TOOLBAR) { 54 if (tag == IDC_TOGGLE_FULLSCREEN_TOOLBAR) {
55 PrefService* prefs = browser->profile()->GetPrefs(); 55 PrefService* prefs = browser->profile()->GetPrefs();
56 SetToggleState(prefs->GetBoolean(prefs::kShowFullscreenToolbar), item); 56 SetToggleState(prefs->GetBoolean(prefs::kShowFullscreenToolbar), item);
57 return; 57 return;
58 } 58 }
59
60 if (tag == IDC_WINDOW_MUTE_TAB) {
61 TabStripModel* model = browser->tab_strip_model();
62 SetToggleState(!model->WillContextMenuMute(model->active_index()), item);
63 return;
64 }
65
66 if (tag == IDC_WINDOW_PIN_TAB) {
67 TabStripModel* model = browser->tab_strip_model();
68 SetToggleState(!model->WillContextMenuPin(model->active_index()), item);
69 return;
70 }
59 } 71 }
60 72
61 NSString* GetTitleForViewsFullscreenMenuItem(Browser* browser) { 73 NSString* GetTitleForViewsFullscreenMenuItem(Browser* browser) {
62 return l10n_util::GetNSString(browser->window()->IsFullscreen() 74 return l10n_util::GetNSString(browser->window()->IsFullscreen()
63 ? IDS_EXIT_FULLSCREEN_MAC 75 ? IDS_EXIT_FULLSCREEN_MAC
64 : IDS_ENTER_FULLSCREEN_MAC); 76 : IDS_ENTER_FULLSCREEN_MAC);
65 } 77 }
66 78
67 // Get the text for the "Enter/Exit Fullscreen" menu item. 79 // Get the text for the "Enter/Exit Fullscreen" menu item.
68 // TODO(jackhou): Remove the dependency on BrowserWindowController(Private). 80 // TODO(jackhou): Remove the dependency on BrowserWindowController(Private).
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after
210 // the background" in this case. 222 // the background" in this case.
211 modifierFlags &= ~NSCommandKeyMask; 223 modifierFlags &= ~NSCommandKeyMask;
212 } 224 }
213 chrome::ExecuteCommandWithDisposition( 225 chrome::ExecuteCommandWithDisposition(
214 FindBrowserForSender(sender, window), command, 226 FindBrowserForSender(sender, window), command,
215 ui::WindowOpenDispositionFromNSEventWithFlags([NSApp currentEvent], 227 ui::WindowOpenDispositionFromNSEventWithFlags([NSApp currentEvent],
216 modifierFlags)); 228 modifierFlags));
217 } 229 }
218 230
219 @end 231 @end
OLDNEW
« no previous file with comments | « chrome/browser/ui/browser_commands.cc ('k') | chrome/browser/ui/tabs/tab_strip_model.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698