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

Unified Diff: chrome/browser/ui/views/profiles/profile_chooser_view.cc

Issue 471023003: Make sure the new confirmation bubble is always shown upon signin (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: roger's comments addressed and rebased 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/views/profiles/profile_chooser_view.cc
diff --git a/chrome/browser/ui/views/profiles/profile_chooser_view.cc b/chrome/browser/ui/views/profiles/profile_chooser_view.cc
index 226f64ca169e30a60787644af016bebd4a35763c..6f43dc4963f08aba9d38a6f069667696f0c7816a 100644
--- a/chrome/browser/ui/views/profiles/profile_chooser_view.cc
+++ b/chrome/browser/ui/views/profiles/profile_chooser_view.cc
@@ -456,6 +456,7 @@ bool ProfileChooserView::close_on_deactivate_for_testing_ = true;
// static
void ProfileChooserView::ShowBubble(
profiles::BubbleViewMode view_mode,
+ profiles::TutorialMode tutorial_mode,
const signin::ManageAccountsParams& manage_accounts_params,
views::View* anchor_view,
views::BubbleBorder::Arrow arrow,
@@ -465,7 +466,7 @@ void ProfileChooserView::ShowBubble(
return;
profile_bubble_ = new ProfileChooserView(anchor_view, arrow, browser,
- view_mode, manage_accounts_params.service_type);
+ view_mode, tutorial_mode, manage_accounts_params.service_type);
views::BubbleDelegateView::CreateBubble(profile_bubble_);
profile_bubble_->set_close_on_deactivate(close_on_deactivate_for_testing_);
profile_bubble_->SetAlignment(border_alignment);
@@ -488,11 +489,12 @@ ProfileChooserView::ProfileChooserView(views::View* anchor_view,
views::BubbleBorder::Arrow arrow,
Browser* browser,
profiles::BubbleViewMode view_mode,
+ profiles::TutorialMode tutorial_mode,
signin::GAIAServiceType service_type)
: BubbleDelegateView(anchor_view, arrow),
browser_(browser),
view_mode_(view_mode),
- tutorial_mode_(profiles::TUTORIAL_MODE_NONE),
+ tutorial_mode_(tutorial_mode),
gaia_service_type_(service_type) {
// Reset the default margins inherited from the BubbleDelegateView.
// Add a small bottom inset so that the bubble's rounded corners show up.
@@ -544,7 +546,6 @@ void ProfileChooserView::ResetView() {
tutorial_sync_settings_link_ = NULL;
tutorial_see_whats_new_button_ = NULL;
tutorial_not_you_link_ = NULL;
- tutorial_mode_ = profiles::TUTORIAL_MODE_NONE;
}
void ProfileChooserView::Init() {
@@ -617,8 +618,6 @@ void ProfileChooserView::ShowView(profiles::BubbleViewMode view_to_display,
return;
}
- // Records the last tutorial mode.
- profiles::TutorialMode last_tutorial_mode = tutorial_mode_;
ResetView();
RemoveAllChildViews(true);
view_mode_ = view_to_display;
@@ -642,7 +641,7 @@ void ProfileChooserView::ShowView(profiles::BubbleViewMode view_to_display,
break;
default:
layout = CreateSingleColumnLayout(this, kFixedMenuWidth);
- sub_view = CreateProfileChooserView(avatar_menu, last_tutorial_mode);
+ sub_view = CreateProfileChooserView(avatar_menu);
}
layout->StartRow(1, 0);
layout->AddView(sub_view);
@@ -819,8 +818,7 @@ bool ProfileChooserView::HandleKeyEvent(views::Textfield* sender,
}
views::View* ProfileChooserView::CreateProfileChooserView(
- AvatarMenu* avatar_menu,
- profiles::TutorialMode last_tutorial_mode) {
+ AvatarMenu* avatar_menu) {
// TODO(guohui, noms): the view should be customized based on whether new
// profile management preview is enabled or not.
@@ -839,11 +837,11 @@ views::View* ProfileChooserView::CreateProfileChooserView(
switches::IsNewProfileManagement() && item.signed_in);
current_profile_view = CreateCurrentProfileView(item, false);
if (view_mode_ == profiles::BUBBLE_VIEW_MODE_PROFILE_CHOOSER) {
- switch (last_tutorial_mode) {
+ switch (tutorial_mode_) {
case profiles::TUTORIAL_MODE_NONE:
case profiles::TUTORIAL_MODE_WELCOME_UPGRADE:
tutorial_view = CreateWelcomeUpgradeTutorialViewIfNeeded(
- last_tutorial_mode == profiles::TUTORIAL_MODE_WELCOME_UPGRADE,
+ tutorial_mode_ == profiles::TUTORIAL_MODE_WELCOME_UPGRADE,
item);
break;
case profiles::TUTORIAL_MODE_CONFIRM_SIGNIN:
@@ -865,6 +863,8 @@ views::View* ProfileChooserView::CreateProfileChooserView(
// TODO(mlerman): update UMA stats for the new tutorial.
layout->StartRow(1, 0);
layout->AddView(tutorial_view);
+ } else {
+ tutorial_mode_ = profiles::TUTORIAL_MODE_NONE;
}
if (!current_profile_view) {

Powered by Google App Engine
This is Rietveld 408576698