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

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

Issue 199533004: [Mac, Win] Show a user manager tutorial once per profile. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rachel nits Created 6 years, 9 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/profile_chooser_view.h" 5 #include "chrome/browser/ui/views/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/profiles/profile_info_util.h" 10 #include "chrome/browser/profiles/profile_info_util.h"
(...skipping 499 matching lines...) Expand 10 before | Expand all | Expand 10 after
510 // has no parent (like in tests) because that will also crash. 510 // has no parent (like in tests) because that will also crash.
511 if (sender->parent()) 511 if (sender->parent())
512 sender->SetEnabled(false); 512 sender->SetEnabled(false);
513 513
514 if (sender == guest_button_) { 514 if (sender == guest_button_) {
515 profiles::SwitchToGuestProfile(browser_->host_desktop_type(), 515 profiles::SwitchToGuestProfile(browser_->host_desktop_type(),
516 profiles::ProfileSwitchingDoneCallback()); 516 profiles::ProfileSwitchingDoneCallback());
517 } else if (sender == end_guest_button_) { 517 } else if (sender == end_guest_button_) {
518 profiles::CloseGuestProfileWindows(); 518 profiles::CloseGuestProfileWindows();
519 } else if (sender == users_button_) { 519 } else if (sender == users_button_) {
520 // Only non-guest users appear in the User Manager. 520 // Only non-guest users appear in the User Manager, or can display a
msw 2014/03/20 18:51:26 nit: consider "Guest users cannot appear in the Us
noms (inactive) 2014/03/20 20:28:20 Done.
521 base::FilePath profile_path; 521 // tutorial.
522 if (!end_guest_button_) { 522 profiles::ShowUserManagerMaybeWithTutorial(
523 size_t active_index = avatar_menu_->GetActiveProfileIndex(); 523 end_guest_button_ ? NULL : browser_->profile());
524 profile_path = avatar_menu_->GetItemAt(active_index).profile_path;
525 }
526 chrome::ShowUserManager(profile_path);
527 } else if (sender == add_user_button_) { 524 } else if (sender == add_user_button_) {
528 profiles::CreateAndSwitchToNewProfile( 525 profiles::CreateAndSwitchToNewProfile(
529 browser_->host_desktop_type(), 526 browser_->host_desktop_type(),
530 profiles::ProfileSwitchingDoneCallback(), 527 profiles::ProfileSwitchingDoneCallback(),
531 ProfileMetrics::ADD_NEW_USER_ICON); 528 ProfileMetrics::ADD_NEW_USER_ICON);
532 } else if (sender == add_account_button_) { 529 } else if (sender == add_account_button_) {
533 ShowView(GAIA_ADD_ACCOUNT_VIEW, avatar_menu_.get()); 530 ShowView(GAIA_ADD_ACCOUNT_VIEW, avatar_menu_.get());
534 } else if (sender == current_profile_photo_->change_photo_button()) { 531 } else if (sender == current_profile_photo_->change_photo_button()) {
535 avatar_menu_->EditProfile(avatar_menu_->GetActiveProfileIndex()); 532 avatar_menu_->EditProfile(avatar_menu_->GetActiveProfileIndex());
536 } else if (sender == tutorial_ok_button_) { 533 } else if (sender == tutorial_ok_button_) {
(...skipping 405 matching lines...) Expand 10 before | Expand all | Expand 10 after
942 if (!is_primary_account) { 939 if (!is_primary_account) {
943 email_button->set_menu_marker(menu_marker); 940 email_button->set_menu_marker(menu_marker);
944 layout->AddPaddingRow(0, views::kRelatedControlVerticalSpacing); 941 layout->AddPaddingRow(0, views::kRelatedControlVerticalSpacing);
945 } 942 }
946 layout->StartRow(1, 0); 943 layout->StartRow(1, 0);
947 layout->AddView(email_button); 944 layout->AddView(email_button);
948 945
949 // Save the original email address, as the button text could be elided. 946 // Save the original email address, as the button text could be elided.
950 current_profile_accounts_map_[email_button] = account; 947 current_profile_accounts_map_[email_button] = account;
951 } 948 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698