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

Side by Side Diff: chrome/browser/ui/cocoa/profiles/profile_chooser_controller.mm

Issue 2248873002: Convert WindowOpenDisposition to an enum class. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase. Created 4 years, 3 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/profiles/profile_chooser_controller.h" 5 #import "chrome/browser/ui/cocoa/profiles/profile_chooser_controller.h"
6 6
7 #import <Carbon/Carbon.h> // kVK_Return. 7 #import <Carbon/Carbon.h> // kVK_Return.
8 #import <Cocoa/Cocoa.h> 8 #import <Cocoa/Cocoa.h>
9 #include <stddef.h> 9 #include <stddef.h>
10 10
(...skipping 1081 matching lines...) Expand 10 before | Expand all | Expand 10 after
1092 } 1092 }
1093 1093
1094 - (IBAction)editProfile:(id)sender { 1094 - (IBAction)editProfile:(id)sender {
1095 avatarMenu_->EditProfile(avatarMenu_->GetActiveProfileIndex()); 1095 avatarMenu_->EditProfile(avatarMenu_->GetActiveProfileIndex());
1096 [self postActionPerformed:ProfileMetrics::PROFILE_DESKTOP_MENU_EDIT_IMAGE]; 1096 [self postActionPerformed:ProfileMetrics::PROFILE_DESKTOP_MENU_EDIT_IMAGE];
1097 [self postActionPerformed:ProfileMetrics::PROFILE_DESKTOP_MENU_EDIT_NAME]; 1097 [self postActionPerformed:ProfileMetrics::PROFILE_DESKTOP_MENU_EDIT_NAME];
1098 } 1098 }
1099 1099
1100 - (IBAction)switchToProfile:(id)sender { 1100 - (IBAction)switchToProfile:(id)sender {
1101 // Check the event flags to see if a new window should be created. 1101 // Check the event flags to see if a new window should be created.
1102 bool alwaysCreate = ui::WindowOpenDispositionFromNSEvent( 1102 bool alwaysCreate =
1103 [NSApp currentEvent]) == NEW_WINDOW; 1103 ui::WindowOpenDispositionFromNSEvent([NSApp currentEvent]) ==
1104 WindowOpenDisposition::NEW_WINDOW;
1104 avatarMenu_->SwitchToProfile([sender tag], alwaysCreate, 1105 avatarMenu_->SwitchToProfile([sender tag], alwaysCreate,
1105 ProfileMetrics::SWITCH_PROFILE_ICON); 1106 ProfileMetrics::SWITCH_PROFILE_ICON);
1106 } 1107 }
1107 1108
1108 - (IBAction)switchToGuest:(id)sender { 1109 - (IBAction)switchToGuest:(id)sender {
1109 PrefService* service = g_browser_process->local_state(); 1110 PrefService* service = g_browser_process->local_state();
1110 DCHECK(service); 1111 DCHECK(service);
1111 DCHECK(service->GetBoolean(prefs::kBrowserGuestModeEnabled)); 1112 DCHECK(service->GetBoolean(prefs::kBrowserGuestModeEnabled));
1112 profiles::SwitchToGuestProfile(ProfileManager::CreateCallback()); 1113 profiles::SwitchToGuestProfile(ProfileManager::CreateCallback());
1113 } 1114 }
(...skipping 1820 matching lines...) Expand 10 before | Expand all | Expand 10 after
2934 } 2935 }
2935 2936
2936 - (bool)shouldShowGoIncognito { 2937 - (bool)shouldShowGoIncognito {
2937 bool incognitoAvailable = 2938 bool incognitoAvailable =
2938 IncognitoModePrefs::GetAvailability(browser_->profile()->GetPrefs()) != 2939 IncognitoModePrefs::GetAvailability(browser_->profile()->GetPrefs()) !=
2939 IncognitoModePrefs::DISABLED; 2940 IncognitoModePrefs::DISABLED;
2940 return incognitoAvailable && !browser_->profile()->IsGuestSession(); 2941 return incognitoAvailable && !browser_->profile()->IsGuestSession();
2941 } 2942 }
2942 2943
2943 @end 2944 @end
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698