OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/app_controller_mac.h" | 5 #import "chrome/browser/app_controller_mac.h" |
6 | 6 |
| 7 #include "apps/app_shim/app_shim_mac.h" |
7 #include "apps/app_shim/extension_app_shim_handler_mac.h" | 8 #include "apps/app_shim/extension_app_shim_handler_mac.h" |
8 #include "apps/shell_window_registry.h" | 9 #include "apps/shell_window_registry.h" |
9 #include "base/auto_reset.h" | 10 #include "base/auto_reset.h" |
10 #include "base/bind.h" | 11 #include "base/bind.h" |
11 #include "base/command_line.h" | 12 #include "base/command_line.h" |
12 #include "base/files/file_path.h" | 13 #include "base/files/file_path.h" |
13 #include "base/mac/foundation_util.h" | 14 #include "base/mac/foundation_util.h" |
14 #include "base/mac/mac_util.h" | 15 #include "base/mac/mac_util.h" |
15 #include "base/message_loop/message_loop.h" | 16 #include "base/message_loop/message_loop.h" |
16 #include "base/prefs/pref_service.h" | 17 #include "base/prefs/pref_service.h" |
(...skipping 619 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
636 // It is safe to access the default profile here. | 637 // It is safe to access the default profile here. |
637 - (void)applicationDidFinishLaunching:(NSNotification*)notify { | 638 - (void)applicationDidFinishLaunching:(NSNotification*)notify { |
638 // Notify BrowserList to keep the application running so it doesn't go away | 639 // Notify BrowserList to keep the application running so it doesn't go away |
639 // when all the browser windows get closed. | 640 // when all the browser windows get closed. |
640 chrome::StartKeepAlive(); | 641 chrome::StartKeepAlive(); |
641 | 642 |
642 [self setUpdateCheckInterval]; | 643 [self setUpdateCheckInterval]; |
643 | 644 |
644 // Start managing the menu for app windows. This needs to be done here because | 645 // Start managing the menu for app windows. This needs to be done here because |
645 // main menu item titles are not yet initialized in awakeFromNib. | 646 // main menu item titles are not yet initialized in awakeFromNib. |
646 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kEnableAppShims)) | 647 if (apps::IsAppShimsEnabled()) |
647 appShimMenuController_.reset([[AppShimMenuController alloc] init]); | 648 appShimMenuController_.reset([[AppShimMenuController alloc] init]); |
648 | 649 |
649 // Build up the encoding menu, the order of the items differs based on the | 650 // Build up the encoding menu, the order of the items differs based on the |
650 // current locale (see http://crbug.com/7647 for details). | 651 // current locale (see http://crbug.com/7647 for details). |
651 // We need a valid g_browser_process to get the profile which is why we can't | 652 // We need a valid g_browser_process to get the profile which is why we can't |
652 // call this from awakeFromNib. | 653 // call this from awakeFromNib. |
653 NSMenu* viewMenu = [[[NSApp mainMenu] itemWithTag:IDC_VIEW_MENU] submenu]; | 654 NSMenu* viewMenu = [[[NSApp mainMenu] itemWithTag:IDC_VIEW_MENU] submenu]; |
654 NSMenuItem* encodingMenuItem = [viewMenu itemWithTag:IDC_ENCODING_MENU]; | 655 NSMenuItem* encodingMenuItem = [viewMenu itemWithTag:IDC_ENCODING_MENU]; |
655 NSMenu* encodingMenu = [encodingMenuItem submenu]; | 656 NSMenu* encodingMenu = [encodingMenuItem submenu]; |
656 EncodingMenuControllerDelegate::BuildEncodingMenu([self lastProfile], | 657 EncodingMenuControllerDelegate::BuildEncodingMenu([self lastProfile], |
(...skipping 759 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1416 | 1417 |
1417 //--------------------------------------------------------------------------- | 1418 //--------------------------------------------------------------------------- |
1418 | 1419 |
1419 namespace app_controller_mac { | 1420 namespace app_controller_mac { |
1420 | 1421 |
1421 bool IsOpeningNewWindow() { | 1422 bool IsOpeningNewWindow() { |
1422 return g_is_opening_new_window; | 1423 return g_is_opening_new_window; |
1423 } | 1424 } |
1424 | 1425 |
1425 } // namespace app_controller_mac | 1426 } // namespace app_controller_mac |
OLD | NEW |