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

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

Issue 210903003: Implemented system tray UI for new account management. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Comments addressed. Created 6 years, 8 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
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "chrome/browser/ui/ash/stub_user_accounts_delegate.h"
6
7 #include <cctype>
8
9 #include "base/logging.h"
10
11 StubUserAccountsDelegate::StubUserAccountsDelegate(const std::string& owner_id)
12 : primary_account_(owner_id) {}
13
14 StubUserAccountsDelegate::~StubUserAccountsDelegate() {}
15
16 std::string StubUserAccountsDelegate::GetPrimaryAccount() {
17 return primary_account_;
18 }
19
20 std::vector<std::string> StubUserAccountsDelegate::GetSecondaryAccountsList() {
21 return secondary_accounts_;
22 }
23
24 std::string StubUserAccountsDelegate::GetAccountDisplayName(
25 const std::string& account_id) {
26 std::string res(1, std::toupper(account_id[0]));
27 res += account_id.substr(1);
28 return res;
29 }
30
31 void StubUserAccountsDelegate::DeleteAccount(const std::string& account_id) {
32 secondary_accounts_.erase(
33 std::remove(
34 secondary_accounts_.begin(), secondary_accounts_.end(), account_id),
35 secondary_accounts_.end());
36 NotifyAccountListChanged();
37 }
38
39 void StubUserAccountsDelegate::AddAccount(const std::string& account_id) {
40 if (primary_account_ == account_id)
41 return;
42 if (std::find(secondary_accounts_.begin(),
43 secondary_accounts_.end(),
44 account_id) != secondary_accounts_.end())
45 return;
46 secondary_accounts_.push_back(account_id);
47 NotifyAccountListChanged();
48 }
49
50 void StubUserAccountsDelegate::LaunchAddAccountDialog() {
51 NOTIMPLEMENTED();
52 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698