Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(77)

Side by Side Diff: chrome/browser/app_controller_mac.mm

Issue 18615010: Refactor utility methods out of the ProfileManager (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: unbreak rebase and added new static fn from trunk Created 7 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | chrome/browser/automation/testing_automation_provider.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
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
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/automation/testing_automation_provider.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698