| 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 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 46 DCHECK(browser); | 46 DCHECK(browser); |
| 47 | 47 |
| 48 // On Windows this logic happens in bookmark_bar_view.cc. This simply updates | 48 // On Windows this logic happens in bookmark_bar_view.cc. This simply updates |
| 49 // the menu item; it does not display the bookmark bar itself. | 49 // the menu item; it does not display the bookmark bar itself. |
| 50 if (tag == IDC_SHOW_BOOKMARK_BAR) { | 50 if (tag == IDC_SHOW_BOOKMARK_BAR) { |
| 51 SetToggleState(browser->window()->IsBookmarkBarVisible(), item); | 51 SetToggleState(browser->window()->IsBookmarkBarVisible(), item); |
| 52 return; | 52 return; |
| 53 } | 53 } |
| 54 | 54 |
| 55 if (tag == IDC_TOGGLE_FULLSCREEN_TOOLBAR) { | 55 if (tag == IDC_TOGGLE_FULLSCREEN_TOOLBAR) { |
| 56 SetToggleState(browser->window()->ShouldHideFullscreenToolbar(), item); | 56 BrowserWindowController* controller = |
| 57 [browser->window()->GetNativeWindow() windowController]; |
| 58 SetToggleState([controller shouldHideFullscreenToolbar], item); |
| 57 return; | 59 return; |
| 58 } | 60 } |
| 59 | 61 |
| 60 // Update the checked/unchecked state of items in the encoding menu. | 62 // Update the checked/unchecked state of items in the encoding menu. |
| 61 // On Windows, this logic is part of |EncodingMenuModel| in | 63 // On Windows, this logic is part of |EncodingMenuModel| in |
| 62 // browser/ui/views/toolbar_view.h. | 64 // browser/ui/views/toolbar_view.h. |
| 63 EncodingMenuController encoding_controller; | 65 EncodingMenuController encoding_controller; |
| 64 if (!encoding_controller.DoesCommandBelongToEncodingMenu(tag)) | 66 if (!encoding_controller.DoesCommandBelongToEncodingMenu(tag)) |
| 65 return; | 67 return; |
| 66 | 68 |
| (...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 261 // the background" in this case. | 263 // the background" in this case. |
| 262 modifierFlags &= ~NSCommandKeyMask; | 264 modifierFlags &= ~NSCommandKeyMask; |
| 263 } | 265 } |
| 264 chrome::ExecuteCommandWithDisposition( | 266 chrome::ExecuteCommandWithDisposition( |
| 265 FindBrowserForSender(sender, window), command, | 267 FindBrowserForSender(sender, window), command, |
| 266 ui::WindowOpenDispositionFromNSEventWithFlags([NSApp currentEvent], | 268 ui::WindowOpenDispositionFromNSEventWithFlags([NSApp currentEvent], |
| 267 modifierFlags)); | 269 modifierFlags)); |
| 268 } | 270 } |
| 269 | 271 |
| 270 @end | 272 @end |
| OLD | NEW |