OLD | NEW |
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 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
177 case IDC_SHOW_SIGNIN: { | 177 case IDC_SHOW_SIGNIN: { |
178 Profile* original_profile = browser->profile()->GetOriginalProfile(); | 178 Profile* original_profile = browser->profile()->GetOriginalProfile(); |
179 [AppController updateSigninItem:item | 179 [AppController updateSigninItem:item |
180 shouldShow:enable | 180 shouldShow:enable |
181 currentProfile:original_profile]; | 181 currentProfile:original_profile]; |
182 break; | 182 break; |
183 } | 183 } |
184 case IDC_BOOKMARK_PAGE: { | 184 case IDC_BOOKMARK_PAGE: { |
185 // Extensions have the ability to hide the bookmark page menu item. | 185 // Extensions have the ability to hide the bookmark page menu item. |
186 // This only affects the bookmark page menu item under the main menu. | 186 // This only affects the bookmark page menu item under the main menu. |
187 // The bookmark page menu item under the wrench menu has its | 187 // The bookmark page menu item under the app menu has its visibility |
188 // visibility controlled by AppMenuModel. | 188 // controlled by AppMenuModel. |
189 bool shouldHide = | 189 bool shouldHide = |
190 chrome::ShouldRemoveBookmarkThisPageUI(browser->profile()); | 190 chrome::ShouldRemoveBookmarkThisPageUI(browser->profile()); |
191 NSMenuItem* menuItem = base::mac::ObjCCast<NSMenuItem>(item); | 191 NSMenuItem* menuItem = base::mac::ObjCCast<NSMenuItem>(item); |
192 [menuItem setHidden:shouldHide]; | 192 [menuItem setHidden:shouldHide]; |
193 break; | 193 break; |
194 } | 194 } |
195 case IDC_BOOKMARK_ALL_TABS: { | 195 case IDC_BOOKMARK_ALL_TABS: { |
196 // Extensions have the ability to hide the bookmark all tabs menu | 196 // Extensions have the ability to hide the bookmark all tabs menu |
197 // item. This only affects the bookmark page menu item under the main | 197 // item. This only affects the bookmark page menu item under the main |
198 // menu. The bookmark page menu item under the wrench menu has its | 198 // menu. The bookmark page menu item under the app menu has its |
199 // visibility controlled by AppMenuModel. | 199 // visibility controlled by AppMenuModel. |
200 bool shouldHide = | 200 bool shouldHide = |
201 chrome::ShouldRemoveBookmarkOpenPagesUI(browser->profile()); | 201 chrome::ShouldRemoveBookmarkOpenPagesUI(browser->profile()); |
202 NSMenuItem* menuItem = base::mac::ObjCCast<NSMenuItem>(item); | 202 NSMenuItem* menuItem = base::mac::ObjCCast<NSMenuItem>(item); |
203 [menuItem setHidden:shouldHide]; | 203 [menuItem setHidden:shouldHide]; |
204 break; | 204 break; |
205 } | 205 } |
206 case IDC_TOGGLE_FULLSCREEN_TOOLBAR: { | 206 case IDC_TOGGLE_FULLSCREEN_TOOLBAR: { |
207 // TODO(spqchan): Implement a preferences for this command and replace | 207 // TODO(spqchan): Implement a preferences for this command and replace |
208 // the Presentation Mode menu item with item. | 208 // the Presentation Mode menu item with item. |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
258 // the background" in this case. | 258 // the background" in this case. |
259 modifierFlags &= ~NSCommandKeyMask; | 259 modifierFlags &= ~NSCommandKeyMask; |
260 } | 260 } |
261 chrome::ExecuteCommandWithDisposition( | 261 chrome::ExecuteCommandWithDisposition( |
262 FindBrowserForSender(sender, window), command, | 262 FindBrowserForSender(sender, window), command, |
263 ui::WindowOpenDispositionFromNSEventWithFlags([NSApp currentEvent], | 263 ui::WindowOpenDispositionFromNSEventWithFlags([NSApp currentEvent], |
264 modifierFlags)); | 264 modifierFlags)); |
265 } | 265 } |
266 | 266 |
267 @end | 267 @end |
OLD | NEW |