OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/apps/app_shim_menu_controller_mac.h" | 5 #import "chrome/browser/ui/cocoa/apps/app_shim_menu_controller_mac.h" |
6 | 6 |
7 #include "apps/app_shim/extension_app_shim_handler_mac.h" | 7 #include "apps/app_shim/extension_app_shim_handler_mac.h" |
8 #include "apps/app_window.h" | 8 #include "apps/app_window.h" |
9 #include "apps/app_window_registry.h" | 9 #include "apps/app_window_registry.h" |
10 #include "base/strings/sys_string_conversions.h" | 10 #include "base/strings/sys_string_conversions.h" |
11 #include "base/strings/utf_string_conversions.h" | 11 #include "base/strings/utf_string_conversions.h" |
12 #include "chrome/app/chrome_command_ids.h" | 12 #include "chrome/app/chrome_command_ids.h" |
13 #import "chrome/browser/ui/cocoa/apps/native_app_window_cocoa.h" | 13 #import "chrome/browser/ui/cocoa/apps/native_app_window_cocoa.h" |
| 14 #include "chrome/grit/generated_resources.h" |
14 #include "extensions/common/extension.h" | 15 #include "extensions/common/extension.h" |
15 #include "grit/generated_resources.h" | |
16 #include "ui/base/l10n/l10n_util.h" | 16 #include "ui/base/l10n/l10n_util.h" |
17 #include "ui/base/l10n/l10n_util_mac.h" | 17 #include "ui/base/l10n/l10n_util_mac.h" |
18 | 18 |
19 namespace { | 19 namespace { |
20 | 20 |
21 // Gets an item from the main menu given the tag of the top level item | 21 // Gets an item from the main menu given the tag of the top level item |
22 // |menu_tag| and the tag of the item |item_tag|. | 22 // |menu_tag| and the tag of the item |item_tag|. |
23 NSMenuItem* GetItemByTag(NSInteger menu_tag, NSInteger item_tag) { | 23 NSMenuItem* GetItemByTag(NSInteger menu_tag, NSInteger item_tag) { |
24 return [[[[NSApp mainMenu] itemWithTag:menu_tag] submenu] | 24 return [[[[NSApp mainMenu] itemWithTag:menu_tag] submenu] |
25 itemWithTag:item_tag]; | 25 itemWithTag:item_tag]; |
(...skipping 351 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
377 | 377 |
378 - (void)focusCurrentPlatformApp { | 378 - (void)focusCurrentPlatformApp { |
379 apps::AppWindow* appWindow = | 379 apps::AppWindow* appWindow = |
380 apps::AppWindowRegistry::GetAppWindowForNativeWindowAnyProfile( | 380 apps::AppWindowRegistry::GetAppWindowForNativeWindowAnyProfile( |
381 [NSApp keyWindow]); | 381 [NSApp keyWindow]); |
382 if (appWindow) | 382 if (appWindow) |
383 apps::ExtensionAppShimHandler::FocusAppForWindow(appWindow); | 383 apps::ExtensionAppShimHandler::FocusAppForWindow(appWindow); |
384 } | 384 } |
385 | 385 |
386 @end | 386 @end |
OLD | NEW |