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 | 6 |
7 #import "chrome/browser/ui/cocoa/profiles/profile_chooser_controller.h" | 7 #import "chrome/browser/ui/cocoa/profiles/profile_chooser_controller.h" |
8 | 8 |
9 #include "base/mac/bundle_locations.h" | 9 #include "base/mac/bundle_locations.h" |
10 #include "base/prefs/pref_service.h" | 10 #include "base/prefs/pref_service.h" |
(...skipping 933 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
944 | 944 |
945 [super windowWillClose:notification]; | 945 [super windowWillClose:notification]; |
946 } | 946 } |
947 | 947 |
948 - (void)cleanUpEmbeddedViewContents { | 948 - (void)cleanUpEmbeddedViewContents { |
949 webContents_.reset(); | 949 webContents_.reset(); |
950 } | 950 } |
951 | 951 |
952 - (id)initWithBrowser:(Browser*)browser | 952 - (id)initWithBrowser:(Browser*)browser |
953 anchoredAt:(NSPoint)point | 953 anchoredAt:(NSPoint)point |
954 withMode:(profiles::BubbleViewMode)mode | 954 viewMode:(profiles::BubbleViewMode)viewMode |
955 withServiceType:(signin::GAIAServiceType)serviceType { | 955 tutorialMode:(profiles::TutorialMode)tutorialMode |
| 956 serviceType:(signin::GAIAServiceType)serviceType { |
956 base::scoped_nsobject<InfoBubbleWindow> window([[InfoBubbleWindow alloc] | 957 base::scoped_nsobject<InfoBubbleWindow> window([[InfoBubbleWindow alloc] |
957 initWithContentRect:ui::kWindowSizeDeterminedLater | 958 initWithContentRect:ui::kWindowSizeDeterminedLater |
958 styleMask:NSBorderlessWindowMask | 959 styleMask:NSBorderlessWindowMask |
959 backing:NSBackingStoreBuffered | 960 backing:NSBackingStoreBuffered |
960 defer:NO]); | 961 defer:NO]); |
961 | 962 |
962 if ((self = [super initWithWindow:window | 963 if ((self = [super initWithWindow:window |
963 parentWindow:browser->window()->GetNativeWindow() | 964 parentWindow:browser->window()->GetNativeWindow() |
964 anchoredAt:point])) { | 965 anchoredAt:point])) { |
965 browser_ = browser; | 966 browser_ = browser; |
966 viewMode_ = mode; | 967 viewMode_ = viewMode; |
967 tutorialMode_ = profiles::TUTORIAL_MODE_NONE; | 968 tutorialMode_ = tutorialMode; |
968 observer_.reset(new ActiveProfileObserverBridge(self, browser_)); | 969 observer_.reset(new ActiveProfileObserverBridge(self, browser_)); |
969 serviceType_ = serviceType; | 970 serviceType_ = serviceType; |
970 | 971 |
971 avatarMenu_.reset(new AvatarMenu( | 972 avatarMenu_.reset(new AvatarMenu( |
972 &g_browser_process->profile_manager()->GetProfileInfoCache(), | 973 &g_browser_process->profile_manager()->GetProfileInfoCache(), |
973 observer_.get(), | 974 observer_.get(), |
974 browser_)); | 975 browser_)); |
975 avatarMenu_->RebuildMenu(); | 976 avatarMenu_->RebuildMenu(); |
976 | 977 |
977 // Guest profiles do not have a token service. | 978 // Guest profiles do not have a token service. |
(...skipping 984 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1962 } | 1963 } |
1963 | 1964 |
1964 - (bool)shouldShowGoIncognito { | 1965 - (bool)shouldShowGoIncognito { |
1965 bool incognitoAvailable = | 1966 bool incognitoAvailable = |
1966 IncognitoModePrefs::GetAvailability(browser_->profile()->GetPrefs()) != | 1967 IncognitoModePrefs::GetAvailability(browser_->profile()->GetPrefs()) != |
1967 IncognitoModePrefs::DISABLED; | 1968 IncognitoModePrefs::DISABLED; |
1968 return incognitoAvailable && !browser_->profile()->IsGuestSession(); | 1969 return incognitoAvailable && !browser_->profile()->IsGuestSession(); |
1969 } | 1970 } |
1970 | 1971 |
1971 @end | 1972 @end |
OLD | NEW |