| 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 #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/lifetime/application_lifetime.h" | 10 #include "chrome/browser/lifetime/application_lifetime.h" |
| (...skipping 544 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 555 | 555 |
| 556 void ProfileChooserView::ButtonPressed(views::Button* sender, | 556 void ProfileChooserView::ButtonPressed(views::Button* sender, |
| 557 const ui::Event& event) { | 557 const ui::Event& event) { |
| 558 // Disable button after clicking so that it doesn't get clicked twice and | 558 // Disable button after clicking so that it doesn't get clicked twice and |
| 559 // start a second action... which can crash Chrome. But don't disable if it | 559 // start a second action... which can crash Chrome. But don't disable if it |
| 560 // has no parent (like in tests) because that will also crash. | 560 // has no parent (like in tests) because that will also crash. |
| 561 if (sender->parent()) | 561 if (sender->parent()) |
| 562 sender->SetEnabled(false); | 562 sender->SetEnabled(false); |
| 563 | 563 |
| 564 if (sender == users_button_) { | 564 if (sender == users_button_) { |
| 565 chrome::ShowUserManager(base::FilePath()); | 565 profiles::ShowUserManagerMaybeWithTutorial(browser_->profile()); |
| 566 } else if (sender == lock_button_) { | 566 } else if (sender == lock_button_) { |
| 567 profiles::LockProfile(browser_->profile()); | 567 profiles::LockProfile(browser_->profile()); |
| 568 } else if (sender == add_account_button_) { | 568 } else if (sender == add_account_button_) { |
| 569 ShowView(BUBBLE_VIEW_MODE_GAIA_ADD_ACCOUNT, avatar_menu_.get()); | 569 ShowView(BUBBLE_VIEW_MODE_GAIA_ADD_ACCOUNT, avatar_menu_.get()); |
| 570 } else if (sender == tutorial_ok_button_) { | 570 } else if (sender == tutorial_ok_button_) { |
| 571 // If the user manually dismissed the tutorial, never show it again by | 571 // If the user manually dismissed the tutorial, never show it again by |
| 572 // setting the number of times shown to the maximum plus 1, so that later we | 572 // setting the number of times shown to the maximum plus 1, so that later we |
| 573 // could distinguish between the dismiss case and the case when the tutorial | 573 // could distinguish between the dismiss case and the case when the tutorial |
| 574 // is indeed shown for the maximum number of times. | 574 // is indeed shown for the maximum number of times. |
| 575 browser_->profile()->GetPrefs()->SetInteger( | 575 browser_->profile()->GetPrefs()->SetInteger( |
| (...skipping 529 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1105 gfx::ALIGN_CENTER); | 1105 gfx::ALIGN_CENTER); |
| 1106 layout->StartRowWithPadding( | 1106 layout->StartRowWithPadding( |
| 1107 1, 0, 0, views::kUnrelatedControlVerticalSpacing); | 1107 1, 0, 0, views::kUnrelatedControlVerticalSpacing); |
| 1108 layout->AddView(remove_account_and_relaunch_button_); | 1108 layout->AddView(remove_account_and_relaunch_button_); |
| 1109 } else { | 1109 } else { |
| 1110 layout->AddPaddingRow(0, views::kUnrelatedControlVerticalSpacing); | 1110 layout->AddPaddingRow(0, views::kUnrelatedControlVerticalSpacing); |
| 1111 } | 1111 } |
| 1112 | 1112 |
| 1113 return view; | 1113 return view; |
| 1114 } | 1114 } |
| OLD | NEW |