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 926 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
937 | 937 |
938 [super windowWillClose:notification]; | 938 [super windowWillClose:notification]; |
939 } | 939 } |
940 | 940 |
941 - (void)cleanUpEmbeddedViewContents { | 941 - (void)cleanUpEmbeddedViewContents { |
942 webContents_.reset(); | 942 webContents_.reset(); |
943 } | 943 } |
944 | 944 |
945 - (id)initWithBrowser:(Browser*)browser | 945 - (id)initWithBrowser:(Browser*)browser |
946 anchoredAt:(NSPoint)point | 946 anchoredAt:(NSPoint)point |
947 withMode:(profiles::BubbleViewMode)mode | 947 withViewMode:(profiles::BubbleViewMode)viewMode |
| 948 withTutorialMode:(profiles::TutorialMode)tutorialMode |
948 withServiceType:(signin::GAIAServiceType)serviceType { | 949 withServiceType:(signin::GAIAServiceType)serviceType { |
949 base::scoped_nsobject<InfoBubbleWindow> window([[InfoBubbleWindow alloc] | 950 base::scoped_nsobject<InfoBubbleWindow> window([[InfoBubbleWindow alloc] |
950 initWithContentRect:ui::kWindowSizeDeterminedLater | 951 initWithContentRect:ui::kWindowSizeDeterminedLater |
951 styleMask:NSBorderlessWindowMask | 952 styleMask:NSBorderlessWindowMask |
952 backing:NSBackingStoreBuffered | 953 backing:NSBackingStoreBuffered |
953 defer:NO]); | 954 defer:NO]); |
954 | 955 |
955 if ((self = [super initWithWindow:window | 956 if ((self = [super initWithWindow:window |
956 parentWindow:browser->window()->GetNativeWindow() | 957 parentWindow:browser->window()->GetNativeWindow() |
957 anchoredAt:point])) { | 958 anchoredAt:point])) { |
958 browser_ = browser; | 959 browser_ = browser; |
959 viewMode_ = mode; | 960 viewMode_ = viewMode; |
960 tutorialMode_ = profiles::TUTORIAL_MODE_NONE; | 961 tutorialMode_ = tutorialMode; |
961 observer_.reset(new ActiveProfileObserverBridge(self, browser_)); | 962 observer_.reset(new ActiveProfileObserverBridge(self, browser_)); |
962 serviceType_ = serviceType; | 963 serviceType_ = serviceType; |
963 | 964 |
964 avatarMenu_.reset(new AvatarMenu( | 965 avatarMenu_.reset(new AvatarMenu( |
965 &g_browser_process->profile_manager()->GetProfileInfoCache(), | 966 &g_browser_process->profile_manager()->GetProfileInfoCache(), |
966 observer_.get(), | 967 observer_.get(), |
967 browser_)); | 968 browser_)); |
968 avatarMenu_->RebuildMenu(); | 969 avatarMenu_->RebuildMenu(); |
969 | 970 |
970 // Guest profiles do not have a token service. | 971 // Guest profiles do not have a token service. |
(...skipping 979 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1950 } | 1951 } |
1951 | 1952 |
1952 - (bool)shouldShowGoIncognito { | 1953 - (bool)shouldShowGoIncognito { |
1953 bool incognitoAvailable = | 1954 bool incognitoAvailable = |
1954 IncognitoModePrefs::GetAvailability(browser_->profile()->GetPrefs()) != | 1955 IncognitoModePrefs::GetAvailability(browser_->profile()->GetPrefs()) != |
1955 IncognitoModePrefs::DISABLED; | 1956 IncognitoModePrefs::DISABLED; |
1956 return incognitoAvailable && !browser_->profile()->IsGuestSession(); | 1957 return incognitoAvailable && !browser_->profile()->IsGuestSession(); |
1957 } | 1958 } |
1958 | 1959 |
1959 @end | 1960 @end |
OLD | NEW |