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