OLD | NEW |
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 <Cocoa/Cocoa.h> | 5 #import <Cocoa/Cocoa.h> |
6 #import <Carbon/Carbon.h> // kVK_Return. | 6 #import <Carbon/Carbon.h> // kVK_Return. |
7 | 7 |
8 #import "chrome/browser/ui/cocoa/profiles/profile_chooser_controller.h" | 8 #import "chrome/browser/ui/cocoa/profiles/profile_chooser_controller.h" |
9 | 9 |
10 #include "base/mac/bundle_locations.h" | 10 #include "base/mac/bundle_locations.h" |
(...skipping 1227 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1238 case profiles::BUBBLE_VIEW_MODE_FAST_PROFILE_CHOOSER: | 1238 case profiles::BUBBLE_VIEW_MODE_FAST_PROFILE_CHOOSER: |
1239 case profiles::BUBBLE_VIEW_MODE_ACCOUNT_MANAGEMENT: | 1239 case profiles::BUBBLE_VIEW_MODE_ACCOUNT_MANAGEMENT: |
1240 subView = [self buildProfileChooserView]; | 1240 subView = [self buildProfileChooserView]; |
1241 break; | 1241 break; |
1242 } | 1242 } |
1243 | 1243 |
1244 // Clears tutorial mode for all non-profile-chooser views. | 1244 // Clears tutorial mode for all non-profile-chooser views. |
1245 if (viewMode_ != profiles::BUBBLE_VIEW_MODE_PROFILE_CHOOSER) | 1245 if (viewMode_ != profiles::BUBBLE_VIEW_MODE_PROFILE_CHOOSER) |
1246 tutorialMode_ = profiles::TUTORIAL_MODE_NONE; | 1246 tutorialMode_ = profiles::TUTORIAL_MODE_NONE; |
1247 | 1247 |
| 1248 if (viewMode_ == profiles::BUBBLE_VIEW_MODE_GAIA_SIGNIN || |
| 1249 viewMode_ == profiles::BUBBLE_VIEW_MODE_GAIA_ADD_ACCOUNT || |
| 1250 viewMode_ == profiles::BUBBLE_VIEW_MODE_GAIA_REAUTH || |
| 1251 tutorialMode_ == profiles::TUTORIAL_MODE_CONFIRM_SIGNIN) { |
| 1252 [self setShouldCloseOnResignKey:NO]; |
| 1253 } else { |
| 1254 [self setShouldCloseOnResignKey:YES]; |
| 1255 } |
| 1256 |
1248 // Add a dummy, empty element so that we don't initially display any | 1257 // Add a dummy, empty element so that we don't initially display any |
1249 // focus rings. | 1258 // focus rings. |
1250 NSButton* dummyFocusButton = | 1259 NSButton* dummyFocusButton = |
1251 [[[DummyWindowFocusButton alloc] initWithFrame:NSZeroRect] autorelease]; | 1260 [[[DummyWindowFocusButton alloc] initWithFrame:NSZeroRect] autorelease]; |
1252 [dummyFocusButton setNextKeyView:subView]; | 1261 [dummyFocusButton setNextKeyView:subView]; |
1253 [[self window] makeFirstResponder:dummyFocusButton]; | 1262 [[self window] makeFirstResponder:dummyFocusButton]; |
1254 | 1263 |
1255 [contentView addSubview:subView]; | 1264 [contentView addSubview:subView]; |
1256 [contentView addSubview:dummyFocusButton]; | 1265 [contentView addSubview:dummyFocusButton]; |
1257 SetWindowSize([self window], | 1266 SetWindowSize([self window], |
(...skipping 1057 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2315 } | 2324 } |
2316 | 2325 |
2317 - (bool)shouldShowGoIncognito { | 2326 - (bool)shouldShowGoIncognito { |
2318 bool incognitoAvailable = | 2327 bool incognitoAvailable = |
2319 IncognitoModePrefs::GetAvailability(browser_->profile()->GetPrefs()) != | 2328 IncognitoModePrefs::GetAvailability(browser_->profile()->GetPrefs()) != |
2320 IncognitoModePrefs::DISABLED; | 2329 IncognitoModePrefs::DISABLED; |
2321 return incognitoAvailable && !browser_->profile()->IsGuestSession(); | 2330 return incognitoAvailable && !browser_->profile()->IsGuestSession(); |
2322 } | 2331 } |
2323 | 2332 |
2324 @end | 2333 @end |
OLD | NEW |