| 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 "base/auto_reset.h" | 7 #include "base/auto_reset.h" |
| 8 #include "base/bind.h" | 8 #include "base/bind.h" |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 #include "chrome/browser/command_updater.h" | 24 #include "chrome/browser/command_updater.h" |
| 25 #include "chrome/browser/download/download_service.h" | 25 #include "chrome/browser/download/download_service.h" |
| 26 #include "chrome/browser/download/download_service_factory.h" | 26 #include "chrome/browser/download/download_service_factory.h" |
| 27 #include "chrome/browser/extensions/extension_service.h" | 27 #include "chrome/browser/extensions/extension_service.h" |
| 28 #include "chrome/browser/extensions/extension_system.h" | 28 #include "chrome/browser/extensions/extension_system.h" |
| 29 #include "chrome/browser/first_run/first_run.h" | 29 #include "chrome/browser/first_run/first_run.h" |
| 30 #include "chrome/browser/lifetime/application_lifetime.h" | 30 #include "chrome/browser/lifetime/application_lifetime.h" |
| 31 #include "chrome/browser/printing/print_dialog_cloud.h" | 31 #include "chrome/browser/printing/print_dialog_cloud.h" |
| 32 #include "chrome/browser/profiles/profile_info_cache_observer.h" | 32 #include "chrome/browser/profiles/profile_info_cache_observer.h" |
| 33 #include "chrome/browser/profiles/profile_manager.h" | 33 #include "chrome/browser/profiles/profile_manager.h" |
| 34 #include "chrome/browser/profiles/profiles_state.h" |
| 34 #include "chrome/browser/service/service_process_control.h" | 35 #include "chrome/browser/service/service_process_control.h" |
| 35 #include "chrome/browser/sessions/session_restore.h" | 36 #include "chrome/browser/sessions/session_restore.h" |
| 36 #include "chrome/browser/sessions/session_service.h" | 37 #include "chrome/browser/sessions/session_service.h" |
| 37 #include "chrome/browser/sessions/session_service_factory.h" | 38 #include "chrome/browser/sessions/session_service_factory.h" |
| 38 #include "chrome/browser/sessions/tab_restore_service.h" | 39 #include "chrome/browser/sessions/tab_restore_service.h" |
| 39 #include "chrome/browser/sessions/tab_restore_service_factory.h" | 40 #include "chrome/browser/sessions/tab_restore_service_factory.h" |
| 40 #include "chrome/browser/signin/signin_manager.h" | 41 #include "chrome/browser/signin/signin_manager.h" |
| 41 #include "chrome/browser/signin/signin_manager_factory.h" | 42 #include "chrome/browser/signin/signin_manager_factory.h" |
| 42 #include "chrome/browser/sync/profile_sync_service.h" | 43 #include "chrome/browser/sync/profile_sync_service.h" |
| 43 #include "chrome/browser/sync/sync_ui_util.h" | 44 #include "chrome/browser/sync/sync_ui_util.h" |
| (...skipping 1074 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1118 menuState_->UpdateCommandEnabled(IDC_FEEDBACK, true); | 1119 menuState_->UpdateCommandEnabled(IDC_FEEDBACK, true); |
| 1119 menuState_->UpdateCommandEnabled(IDC_SHOW_SYNC_SETUP, true); | 1120 menuState_->UpdateCommandEnabled(IDC_SHOW_SYNC_SETUP, true); |
| 1120 menuState_->UpdateCommandEnabled(IDC_TASK_MANAGER, true); | 1121 menuState_->UpdateCommandEnabled(IDC_TASK_MANAGER, true); |
| 1121 } | 1122 } |
| 1122 | 1123 |
| 1123 // Conditionally adds the Profile menu to the main menu bar. | 1124 // Conditionally adds the Profile menu to the main menu bar. |
| 1124 - (void)initProfileMenu { | 1125 - (void)initProfileMenu { |
| 1125 NSMenu* mainMenu = [NSApp mainMenu]; | 1126 NSMenu* mainMenu = [NSApp mainMenu]; |
| 1126 NSMenuItem* profileMenu = [mainMenu itemWithTag:IDC_PROFILE_MAIN_MENU]; | 1127 NSMenuItem* profileMenu = [mainMenu itemWithTag:IDC_PROFILE_MAIN_MENU]; |
| 1127 | 1128 |
| 1128 if (!ProfileManager::IsMultipleProfilesEnabled()) { | 1129 if (!profiles::IsMultipleProfilesEnabled()) { |
| 1129 [mainMenu removeItem:profileMenu]; | 1130 [mainMenu removeItem:profileMenu]; |
| 1130 return; | 1131 return; |
| 1131 } | 1132 } |
| 1132 | 1133 |
| 1133 // The controller will unhide the menu if necessary. | 1134 // The controller will unhide the menu if necessary. |
| 1134 [profileMenu setHidden:YES]; | 1135 [profileMenu setHidden:YES]; |
| 1135 | 1136 |
| 1136 profileMenuController_.reset( | 1137 profileMenuController_.reset( |
| 1137 [[ProfileMenuController alloc] initWithMainMenuItem:profileMenu]); | 1138 [[ProfileMenuController alloc] initWithMainMenuItem:profileMenu]); |
| 1138 } | 1139 } |
| (...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1381 | 1382 |
| 1382 //--------------------------------------------------------------------------- | 1383 //--------------------------------------------------------------------------- |
| 1383 | 1384 |
| 1384 namespace app_controller_mac { | 1385 namespace app_controller_mac { |
| 1385 | 1386 |
| 1386 bool IsOpeningNewWindow() { | 1387 bool IsOpeningNewWindow() { |
| 1387 return g_is_opening_new_window; | 1388 return g_is_opening_new_window; |
| 1388 } | 1389 } |
| 1389 | 1390 |
| 1390 } // namespace app_controller_mac | 1391 } // namespace app_controller_mac |
| OLD | NEW |