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

Side by Side Diff: chrome/browser/ui/ash/user_accounts_delegate_chromeos.cc

Issue 398753004: [cros] Move User class to user_manager component. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 6 years, 5 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/ash/user_accounts_delegate_chromeos.h" 5 #include "chrome/browser/ui/ash/user_accounts_delegate_chromeos.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <iterator> 8 #include <iterator>
9 9
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 std::remove(accounts.begin(), accounts.end(), GetPrimaryAccountId()); 47 std::remove(accounts.begin(), accounts.end(), GetPrimaryAccountId());
48 LOG_IF(WARNING, std::distance(it, accounts.end()) != 1) 48 LOG_IF(WARNING, std::distance(it, accounts.end()) != 1)
49 << "Found " << std::distance(it, accounts.end()) 49 << "Found " << std::distance(it, accounts.end())
50 << " primary accounts in the account list."; 50 << " primary accounts in the account list.";
51 accounts.erase(it, accounts.end()); 51 accounts.erase(it, accounts.end());
52 return accounts; 52 return accounts;
53 } 53 }
54 54
55 std::string UserAccountsDelegateChromeOS::GetAccountDisplayName( 55 std::string UserAccountsDelegateChromeOS::GetAccountDisplayName(
56 const std::string& account_id) { 56 const std::string& account_id) {
57 User* user = ProfileHelper::Get()->GetUserByProfile(user_profile_); 57 user_manager::User* user =
58 ProfileHelper::Get()->GetUserByProfile(user_profile_);
58 if (gaia::AreEmailsSame(user->email(), account_id) && 59 if (gaia::AreEmailsSame(user->email(), account_id) &&
59 !user->display_email().empty()) 60 !user->display_email().empty())
60 return user->display_email(); 61 return user->display_email();
61 return account_id; 62 return account_id;
62 } 63 }
63 64
64 void UserAccountsDelegateChromeOS::DeleteAccount( 65 void UserAccountsDelegateChromeOS::DeleteAccount(
65 const std::string& account_id) { 66 const std::string& account_id) {
66 MutableProfileOAuth2TokenService* oauth2_token_service = 67 MutableProfileOAuth2TokenService* oauth2_token_service =
67 ProfileOAuth2TokenServiceFactory::GetPlatformSpecificForProfile( 68 ProfileOAuth2TokenServiceFactory::GetPlatformSpecificForProfile(
68 user_profile_); 69 user_profile_);
69 oauth2_token_service->RevokeCredentials(account_id); 70 oauth2_token_service->RevokeCredentials(account_id);
70 } 71 }
71 72
72 void UserAccountsDelegateChromeOS::LaunchAddAccountDialog() { 73 void UserAccountsDelegateChromeOS::LaunchAddAccountDialog() {
73 ui::InlineLoginDialog::Show(user_profile_); 74 ui::InlineLoginDialog::Show(user_profile_);
74 } 75 }
75 76
76 void UserAccountsDelegateChromeOS::OnRefreshTokenAvailable( 77 void UserAccountsDelegateChromeOS::OnRefreshTokenAvailable(
77 const std::string& account_id) { 78 const std::string& account_id) {
78 NotifyAccountListChanged(); 79 NotifyAccountListChanged();
79 } 80 }
80 81
81 void UserAccountsDelegateChromeOS::OnRefreshTokenRevoked( 82 void UserAccountsDelegateChromeOS::OnRefreshTokenRevoked(
82 const std::string& account_id) { 83 const std::string& account_id) {
83 NotifyAccountListChanged(); 84 NotifyAccountListChanged();
84 } 85 }
85 86
86 } // namespace chromeos 87 } // namespace chromeos
OLDNEW
« no previous file with comments | « chrome/browser/ui/ash/system_tray_delegate_chromeos.cc ('k') | chrome/browser/ui/webui/chromeos/login/signin_screen_handler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698