| 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" |
| 11 #include "chrome/browser/media/router/media_router_feature.h" | 11 #include "chrome/browser/media/router/media_router_feature.h" |
| 12 #include "chrome/browser/profiles/profile.h" | 12 #include "chrome/browser/profiles/profile.h" |
| 13 #include "chrome/browser/ui/bookmarks/bookmark_utils.h" | 13 #include "chrome/browser/ui/bookmarks/bookmark_utils.h" |
| 14 #include "chrome/browser/ui/browser_commands.h" | 14 #include "chrome/browser/ui/browser_commands.h" |
| 15 #include "chrome/browser/ui/browser_finder.h" | 15 #include "chrome/browser/ui/browser_finder.h" |
| 16 #include "chrome/browser/ui/browser_window.h" | 16 #include "chrome/browser/ui/browser_window.h" |
| 17 #import "chrome/browser/ui/cocoa/browser_window_controller_private.h" | 17 #import "chrome/browser/ui/cocoa/browser_window_controller_private.h" |
| 18 #include "chrome/common/pref_names.h" | 18 #include "chrome/common/pref_names.h" |
| 19 #include "chrome/grit/generated_resources.h" | 19 #include "chrome/grit/generated_resources.h" |
| 20 #include "content/public/browser/user_metrics.h" | |
| 21 #include "content/public/browser/web_contents.h" | 20 #include "content/public/browser/web_contents.h" |
| 22 #import "ui/base/cocoa/cocoa_base_utils.h" | 21 #import "ui/base/cocoa/cocoa_base_utils.h" |
| 23 #include "ui/base/l10n/l10n_util.h" | 22 #include "ui/base/l10n/l10n_util.h" |
| 24 #include "ui/base/l10n/l10n_util_mac.h" | 23 #include "ui/base/l10n/l10n_util_mac.h" |
| 25 | 24 |
| 26 namespace { | 25 namespace { |
| 27 | 26 |
| 28 void SetToggleState(bool toggled, id item) { | 27 void SetToggleState(bool toggled, id item) { |
| 29 DCHECK([item respondsToSelector:@selector(state)] && | 28 DCHECK([item respondsToSelector:@selector(state)] && |
| 30 [item respondsToSelector:@selector(setState:)]); | 29 [item respondsToSelector:@selector(setState:)]); |
| (...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 211 // the background" in this case. | 210 // the background" in this case. |
| 212 modifierFlags &= ~NSCommandKeyMask; | 211 modifierFlags &= ~NSCommandKeyMask; |
| 213 } | 212 } |
| 214 chrome::ExecuteCommandWithDisposition( | 213 chrome::ExecuteCommandWithDisposition( |
| 215 FindBrowserForSender(sender, window), command, | 214 FindBrowserForSender(sender, window), command, |
| 216 ui::WindowOpenDispositionFromNSEventWithFlags([NSApp currentEvent], | 215 ui::WindowOpenDispositionFromNSEventWithFlags([NSApp currentEvent], |
| 217 modifierFlags)); | 216 modifierFlags)); |
| 218 } | 217 } |
| 219 | 218 |
| 220 @end | 219 @end |
| OLD | NEW |