Chromium Code Reviews| 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" | |
| 8 #include "apps/app_shim/extension_app_shim_handler_mac.h" | 7 #include "apps/app_shim/extension_app_shim_handler_mac.h" |
| 9 #include "apps/shell_window_registry.h" | 8 #include "apps/shell_window_registry.h" |
| 10 #include "base/auto_reset.h" | 9 #include "base/auto_reset.h" |
| 11 #include "base/bind.h" | 10 #include "base/bind.h" |
| 12 #include "base/command_line.h" | 11 #include "base/command_line.h" |
| 13 #include "base/files/file_path.h" | 12 #include "base/files/file_path.h" |
| 14 #include "base/mac/foundation_util.h" | 13 #include "base/mac/foundation_util.h" |
| 15 #include "base/mac/mac_util.h" | 14 #include "base/mac/mac_util.h" |
| 16 #include "base/message_loop/message_loop.h" | 15 #include "base/message_loop/message_loop.h" |
| 17 #include "base/prefs/pref_service.h" | 16 #include "base/prefs/pref_service.h" |
| (...skipping 656 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 674 // It is safe to access the default profile here. | 673 // It is safe to access the default profile here. |
| 675 - (void)applicationDidFinishLaunching:(NSNotification*)notify { | 674 - (void)applicationDidFinishLaunching:(NSNotification*)notify { |
| 676 // Notify BrowserList to keep the application running so it doesn't go away | 675 // Notify BrowserList to keep the application running so it doesn't go away |
| 677 // when all the browser windows get closed. | 676 // when all the browser windows get closed. |
| 678 chrome::StartKeepAlive(); | 677 chrome::StartKeepAlive(); |
| 679 | 678 |
| 680 [self setUpdateCheckInterval]; | 679 [self setUpdateCheckInterval]; |
| 681 | 680 |
| 682 // Start managing the menu for app windows. This needs to be done here because | 681 // Start managing the menu for app windows. This needs to be done here because |
| 683 // main menu item titles are not yet initialized in awakeFromNib. | 682 // main menu item titles are not yet initialized in awakeFromNib. |
| 684 if (apps::IsAppShimsEnabled()) | 683 appShimMenuController_.reset([[AppShimMenuController alloc] init]); |
|
Nico
2013/11/01 23:48:00
I suppose this becomes true some time after startu
jackhou1
2013/11/04 00:14:29
It's not quite as neat. I've uploaded two options
| |
| 685 appShimMenuController_.reset([[AppShimMenuController alloc] init]); | |
| 686 | 684 |
| 687 // Build up the encoding menu, the order of the items differs based on the | 685 // Build up the encoding menu, the order of the items differs based on the |
| 688 // current locale (see http://crbug.com/7647 for details). | 686 // current locale (see http://crbug.com/7647 for details). |
| 689 // We need a valid g_browser_process to get the profile which is why we can't | 687 // We need a valid g_browser_process to get the profile which is why we can't |
| 690 // call this from awakeFromNib. | 688 // call this from awakeFromNib. |
| 691 NSMenu* viewMenu = [[[NSApp mainMenu] itemWithTag:IDC_VIEW_MENU] submenu]; | 689 NSMenu* viewMenu = [[[NSApp mainMenu] itemWithTag:IDC_VIEW_MENU] submenu]; |
| 692 NSMenuItem* encodingMenuItem = [viewMenu itemWithTag:IDC_ENCODING_MENU]; | 690 NSMenuItem* encodingMenuItem = [viewMenu itemWithTag:IDC_ENCODING_MENU]; |
| 693 NSMenu* encodingMenu = [encodingMenuItem submenu]; | 691 NSMenu* encodingMenu = [encodingMenuItem submenu]; |
| 694 EncodingMenuControllerDelegate::BuildEncodingMenu([self lastProfile], | 692 EncodingMenuControllerDelegate::BuildEncodingMenu([self lastProfile], |
| 695 encodingMenu); | 693 encodingMenu); |
| (...skipping 781 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1477 | 1475 |
| 1478 //--------------------------------------------------------------------------- | 1476 //--------------------------------------------------------------------------- |
| 1479 | 1477 |
| 1480 namespace app_controller_mac { | 1478 namespace app_controller_mac { |
| 1481 | 1479 |
| 1482 bool IsOpeningNewWindow() { | 1480 bool IsOpeningNewWindow() { |
| 1483 return g_is_opening_new_window; | 1481 return g_is_opening_new_window; |
| 1484 } | 1482 } |
| 1485 | 1483 |
| 1486 } // namespace app_controller_mac | 1484 } // namespace app_controller_mac |
| OLD | NEW |