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

Side by Side Diff: chrome/browser/ui/views/profiles/profile_chooser_view.cc

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 #include "chrome/browser/ui/views/profiles/profile_chooser_view.h" 5 #include "chrome/browser/ui/views/profiles/profile_chooser_view.h"
6 6
7 #include "base/prefs/pref_service.h" 7 #include "base/prefs/pref_service.h"
8 #include "base/strings/utf_string_conversions.h" 8 #include "base/strings/utf_string_conversions.h"
9 #include "chrome/browser/browser_process.h" 9 #include "chrome/browser/browser_process.h"
10 #include "chrome/browser/first_run/first_run.h"
11 #include "chrome/browser/lifetime/application_lifetime.h" 10 #include "chrome/browser/lifetime/application_lifetime.h"
12 #include "chrome/browser/prefs/incognito_mode_prefs.h" 11 #include "chrome/browser/prefs/incognito_mode_prefs.h"
13 #include "chrome/browser/profiles/profile_avatar_icon_util.h" 12 #include "chrome/browser/profiles/profile_avatar_icon_util.h"
14 #include "chrome/browser/profiles/profile_info_cache.h" 13 #include "chrome/browser/profiles/profile_info_cache.h"
15 #include "chrome/browser/profiles/profile_manager.h" 14 #include "chrome/browser/profiles/profile_manager.h"
16 #include "chrome/browser/profiles/profile_metrics.h" 15 #include "chrome/browser/profiles/profile_metrics.h"
17 #include "chrome/browser/profiles/profile_window.h" 16 #include "chrome/browser/profiles/profile_window.h"
18 #include "chrome/browser/profiles/profiles_state.h" 17 #include "chrome/browser/profiles/profiles_state.h"
19 #include "chrome/browser/signin/profile_oauth2_token_service_factory.h" 18 #include "chrome/browser/signin/profile_oauth2_token_service_factory.h"
20 #include "chrome/browser/signin/signin_header_helper.h" 19 #include "chrome/browser/signin/signin_header_helper.h"
(...skipping 1362 matching lines...) Expand 10 before | Expand all | Expand 10 after
1383 1382
1384 TitleCard* title_card = new TitleCard( 1383 TitleCard* title_card = new TitleCard(
1385 l10n_util::GetStringUTF16(IDS_PROFILES_ACCOUNT_REMOVAL_TITLE), 1384 l10n_util::GetStringUTF16(IDS_PROFILES_ACCOUNT_REMOVAL_TITLE),
1386 this, &account_removal_cancel_button_); 1385 this, &account_removal_cancel_button_);
1387 return TitleCard::AddPaddedTitleCard(view, title_card, 1386 return TitleCard::AddPaddedTitleCard(view, title_card,
1388 kFixedAccountRemovalViewWidth); 1387 kFixedAccountRemovalViewWidth);
1389 } 1388 }
1390 1389
1391 views::View* ProfileChooserView::CreateWelcomeUpgradeTutorialViewIfNeeded( 1390 views::View* ProfileChooserView::CreateWelcomeUpgradeTutorialViewIfNeeded(
1392 bool tutorial_shown, const AvatarMenu::Item& avatar_item){ 1391 bool tutorial_shown, const AvatarMenu::Item& avatar_item){
1393 if (first_run::IsChromeFirstRun())
1394 return NULL;
1395
1396 Profile* profile = browser_->profile(); 1392 Profile* profile = browser_->profile();
1397 if (!avatar_item.signed_in) { 1393 if (!avatar_item.signed_in) {
1398 profile->GetPrefs()->SetInteger( 1394 profile->GetPrefs()->SetInteger(
1399 prefs::kProfileAvatarTutorialShown, kUpgradeWelcomeTutorialShowMax + 1); 1395 prefs::kProfileAvatarTutorialShown, kUpgradeWelcomeTutorialShowMax + 1);
1400 return NULL; 1396 return NULL;
1401 } 1397 }
1402 1398
1403 const int show_count = profile->GetPrefs()->GetInteger( 1399 const int show_count = profile->GetPrefs()->GetInteger(
1404 prefs::kProfileAvatarTutorialShown); 1400 prefs::kProfileAvatarTutorialShown);
1405 // Do not show the tutorial if user has dismissed it. 1401 // Do not show the tutorial if user has dismissed it.
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
1498 IncognitoModePrefs::GetAvailability(browser_->profile()->GetPrefs()) != 1494 IncognitoModePrefs::GetAvailability(browser_->profile()->GetPrefs()) !=
1499 IncognitoModePrefs::DISABLED; 1495 IncognitoModePrefs::DISABLED;
1500 return incognito_available && !browser_->profile()->IsGuestSession(); 1496 return incognito_available && !browser_->profile()->IsGuestSession();
1501 } 1497 }
1502 1498
1503 void ProfileChooserView::PostActionPerformed( 1499 void ProfileChooserView::PostActionPerformed(
1504 ProfileMetrics::ProfileDesktopMenu action_performed) { 1500 ProfileMetrics::ProfileDesktopMenu action_performed) {
1505 ProfileMetrics::LogProfileDesktopMenu(action_performed, gaia_service_type_); 1501 ProfileMetrics::LogProfileDesktopMenu(action_performed, gaia_service_type_);
1506 gaia_service_type_ = signin::GAIA_SERVICE_TYPE_NONE; 1502 gaia_service_type_ = signin::GAIA_SERVICE_TYPE_NONE;
1507 } 1503 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698