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

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

Issue 467853002: Suppress the upgrade tutorial for new profile (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 4 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 | Annotate | Revision Log
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 <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"
11 #include "base/strings/sys_string_conversions.h" 11 #include "base/strings/sys_string_conversions.h"
12 #include "base/strings/utf_string_conversions.h" 12 #include "base/strings/utf_string_conversions.h"
13 #include "chrome/browser/browser_process.h" 13 #include "chrome/browser/browser_process.h"
14 #include "chrome/browser/chrome_notification_types.h" 14 #include "chrome/browser/chrome_notification_types.h"
15 #include "chrome/browser/first_run/first_run.h"
16 #include "chrome/browser/lifetime/application_lifetime.h" 15 #include "chrome/browser/lifetime/application_lifetime.h"
17 #include "chrome/browser/prefs/incognito_mode_prefs.h" 16 #include "chrome/browser/prefs/incognito_mode_prefs.h"
18 #include "chrome/browser/profiles/avatar_menu.h" 17 #include "chrome/browser/profiles/avatar_menu.h"
19 #include "chrome/browser/profiles/avatar_menu_observer.h" 18 #include "chrome/browser/profiles/avatar_menu_observer.h"
20 #include "chrome/browser/profiles/profile_avatar_icon_util.h" 19 #include "chrome/browser/profiles/profile_avatar_icon_util.h"
21 #include "chrome/browser/profiles/profile_info_cache.h" 20 #include "chrome/browser/profiles/profile_info_cache.h"
22 #include "chrome/browser/profiles/profile_manager.h" 21 #include "chrome/browser/profiles/profile_manager.h"
23 #include "chrome/browser/profiles/profile_metrics.h" 22 #include "chrome/browser/profiles/profile_metrics.h"
24 #include "chrome/browser/profiles/profile_window.h" 23 #include "chrome/browser/profiles/profile_window.h"
25 #include "chrome/browser/profiles/profiles_state.h" 24 #include "chrome/browser/profiles/profiles_state.h"
(...skipping 1132 matching lines...) Expand 10 before | Expand all | Expand 10 after
1158 return [self tutorialViewWithMode:profiles::TUTORIAL_MODE_CONFIRM_SIGNIN 1157 return [self tutorialViewWithMode:profiles::TUTORIAL_MODE_CONFIRM_SIGNIN
1159 titleMessage:titleMessage 1158 titleMessage:titleMessage
1160 contentMessage:contentMessage 1159 contentMessage:contentMessage
1161 linkMessage:linkMessage 1160 linkMessage:linkMessage
1162 buttonMessage:buttonMessage 1161 buttonMessage:buttonMessage
1163 linkAction:@selector(configureSyncSettings:) 1162 linkAction:@selector(configureSyncSettings:)
1164 buttonAction:@selector(syncSettingsConfirmed:)]; 1163 buttonAction:@selector(syncSettingsConfirmed:)];
1165 } 1164 }
1166 1165
1167 - (NSView*)buildWelcomeUpgradeTutorialViewIfNeeded { 1166 - (NSView*)buildWelcomeUpgradeTutorialViewIfNeeded {
1168 if (first_run::IsChromeFirstRun())
1169 return nil;
1170
1171 Profile* profile = browser_->profile(); 1167 Profile* profile = browser_->profile();
1172 const AvatarMenu::Item& avatarItem = 1168 const AvatarMenu::Item& avatarItem =
1173 avatarMenu_->GetItemAt(avatarMenu_->GetActiveProfileIndex()); 1169 avatarMenu_->GetItemAt(avatarMenu_->GetActiveProfileIndex());
1174 if (!avatarItem.signed_in) { 1170 if (!avatarItem.signed_in) {
1175 profile->GetPrefs()->SetInteger( 1171 profile->GetPrefs()->SetInteger(
1176 prefs::kProfileAvatarTutorialShown, kUpgradeWelcomeTutorialShowMax + 1); 1172 prefs::kProfileAvatarTutorialShown, kUpgradeWelcomeTutorialShowMax + 1);
1177 return nil; 1173 return nil;
1178 } 1174 }
1179 1175
1180 const int showCount = profile->GetPrefs()->GetInteger( 1176 const int showCount = profile->GetPrefs()->GetInteger(
(...skipping 780 matching lines...) Expand 10 before | Expand all | Expand 10 after
1961 } 1957 }
1962 1958
1963 - (bool)shouldShowGoIncognito { 1959 - (bool)shouldShowGoIncognito {
1964 bool incognitoAvailable = 1960 bool incognitoAvailable =
1965 IncognitoModePrefs::GetAvailability(browser_->profile()->GetPrefs()) != 1961 IncognitoModePrefs::GetAvailability(browser_->profile()->GetPrefs()) !=
1966 IncognitoModePrefs::DISABLED; 1962 IncognitoModePrefs::DISABLED;
1967 return incognitoAvailable && !browser_->profile()->IsGuestSession(); 1963 return incognitoAvailable && !browser_->profile()->IsGuestSession();
1968 } 1964 }
1969 1965
1970 @end 1966 @end
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698