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

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

Issue 898003002: [Cleanup] Const-correct the profile() method for the EasyUnlockService (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 5 years, 10 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
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_manager::User* user = 57 const user_manager::User* user =
58 ProfileHelper::Get()->GetUserByProfile(user_profile_); 58 ProfileHelper::Get()->GetUserByProfile(user_profile_);
59 if (gaia::AreEmailsSame(user->email(), account_id) && 59 if (gaia::AreEmailsSame(user->email(), account_id) &&
60 !user->display_email().empty()) 60 !user->display_email().empty())
61 return user->display_email(); 61 return user->display_email();
62 return account_id; 62 return account_id;
63 } 63 }
64 64
65 void UserAccountsDelegateChromeOS::DeleteAccount( 65 void UserAccountsDelegateChromeOS::DeleteAccount(
66 const std::string& account_id) { 66 const std::string& account_id) {
67 MutableProfileOAuth2TokenService* oauth2_token_service = 67 MutableProfileOAuth2TokenService* oauth2_token_service =
(...skipping 10 matching lines...) Expand all
78 const std::string& account_id) { 78 const std::string& account_id) {
79 NotifyAccountListChanged(); 79 NotifyAccountListChanged();
80 } 80 }
81 81
82 void UserAccountsDelegateChromeOS::OnRefreshTokenRevoked( 82 void UserAccountsDelegateChromeOS::OnRefreshTokenRevoked(
83 const std::string& account_id) { 83 const std::string& account_id) {
84 NotifyAccountListChanged(); 84 NotifyAccountListChanged();
85 } 85 }
86 86
87 } // namespace chromeos 87 } // namespace chromeos
OLDNEW
« no previous file with comments | « chrome/browser/ui/app_list/test/fake_profile.cc ('k') | chrome/browser/ui/webui/net_internals/net_internals_ui.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698