OLD | NEW |
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/command_line.h" | 7 #include "base/command_line.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 422 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
433 ProfileOAuth2TokenServiceFactory::GetForProfile(browser_->profile()); | 433 ProfileOAuth2TokenServiceFactory::GetForProfile(browser_->profile()); |
434 if (oauth2_token_service) | 434 if (oauth2_token_service) |
435 oauth2_token_service->RevokeCredentials(match->second); | 435 oauth2_token_service->RevokeCredentials(match->second); |
436 } | 436 } |
437 | 437 |
438 void ProfileChooserView::LinkClicked(views::Link* sender, int event_flags) { | 438 void ProfileChooserView::LinkClicked(views::Link* sender, int event_flags) { |
439 if (sender == manage_accounts_link_) { | 439 if (sender == manage_accounts_link_) { |
440 // ShowView() will DCHECK if this view is displayed for non signed-in users. | 440 // ShowView() will DCHECK if this view is displayed for non signed-in users. |
441 ShowView(ACCOUNT_MANAGEMENT_VIEW, avatar_menu_.get()); | 441 ShowView(ACCOUNT_MANAGEMENT_VIEW, avatar_menu_.get()); |
442 } else if (sender == signout_current_profile_link_) { | 442 } else if (sender == signout_current_profile_link_) { |
443 avatar_menu_->BeginSignOut(); | 443 profiles::LockProfile(browser_->profile()); |
444 } else if (sender == signin_current_profile_link_) { | 444 } else if (sender == signin_current_profile_link_) { |
445 if (CommandLine::ForCurrentProcess()->HasSwitch( | 445 if (CommandLine::ForCurrentProcess()->HasSwitch( |
446 switches::kEnableInlineSignin)) { | 446 switches::kEnableInlineSignin)) { |
447 ShowView(GAIA_SIGNIN_VIEW, avatar_menu_.get()); | 447 ShowView(GAIA_SIGNIN_VIEW, avatar_menu_.get()); |
448 } else { | 448 } else { |
449 GURL page = signin::GetPromoURL(signin::SOURCE_MENU, false); | 449 GURL page = signin::GetPromoURL(signin::SOURCE_MENU, false); |
450 chrome::ShowSingletonTab(browser_, page); | 450 chrome::ShowSingletonTab(browser_, page); |
451 } | 451 } |
452 } else { | 452 } else { |
453 DCHECK(sender == change_photo_link_); | 453 DCHECK(sender == change_photo_link_); |
(...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
688 layout->AddPaddingRow(0, views::kRelatedControlVerticalSpacing); | 688 layout->AddPaddingRow(0, views::kRelatedControlVerticalSpacing); |
689 | 689 |
690 add_account_button_ = new views::BlueButton( | 690 add_account_button_ = new views::BlueButton( |
691 this, | 691 this, |
692 l10n_util::GetStringFUTF16(IDS_PROFILES_PROFILE_ADD_ACCOUNT_BUTTON, | 692 l10n_util::GetStringFUTF16(IDS_PROFILES_PROFILE_ADD_ACCOUNT_BUTTON, |
693 avatar_item.name)); | 693 avatar_item.name)); |
694 layout->StartRow(1, 0); | 694 layout->StartRow(1, 0); |
695 layout->AddView(add_account_button_); | 695 layout->AddView(add_account_button_); |
696 return view; | 696 return view; |
697 } | 697 } |
OLD | NEW |