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

Unified 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: Fixed windows compilation. Created 6 years, 9 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/ash/stub_user_accounts_delegate.cc
diff --git a/chrome/browser/ui/ash/stub_user_accounts_delegate.cc b/chrome/browser/ui/ash/stub_user_accounts_delegate.cc
new file mode 100644
index 0000000000000000000000000000000000000000..6857f8a025a1fe295f9c612230e9a5bb2bbdb61b
--- /dev/null
+++ b/chrome/browser/ui/ash/stub_user_accounts_delegate.cc
@@ -0,0 +1,52 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "chrome/browser/ui/ash/stub_user_accounts_delegate.h"
+
+#include <cctype>
+
+#include "base/logging.h"
+
+StubUserAccountsDelegate::StubUserAccountsDelegate(const std::string& owner_id)
+ : primary_account_(owner_id) {}
+
+StubUserAccountsDelegate::~StubUserAccountsDelegate() {}
+
+std::string StubUserAccountsDelegate::GetPrimaryAccount() {
+ return primary_account_;
+}
+
+std::vector<std::string> StubUserAccountsDelegate::GetSecondaryAccountsList() {
+ return secondary_accounts_;
+}
+
+std::string StubUserAccountsDelegate::GetAccountDisplayName(
+ const std::string& account_id) {
+ std::string res(1, std::toupper(account_id[0]));
+ res += account_id.substr(1);
+ return res;
+}
+
+void StubUserAccountsDelegate::DeleteAccount(const std::string& account_id) {
+ secondary_accounts_.erase(
+ std::remove(
+ secondary_accounts_.begin(), secondary_accounts_.end(), account_id),
+ secondary_accounts_.end());
+ NotifyAccountListChanged();
+}
+
+void StubUserAccountsDelegate::AddAccount(const std::string& account_id) {
+ if (primary_account_ == account_id)
+ return;
+ if (std::find(secondary_accounts_.begin(),
+ secondary_accounts_.end(),
+ account_id) != secondary_accounts_.end())
+ return;
+ secondary_accounts_.push_back(account_id);
+ NotifyAccountListChanged();
+}
+
+void StubUserAccountsDelegate::LaunchAddAccountDialog() {
+ NOTIMPLEMENTED();
+}

Powered by Google App Engine
This is Rietveld 408576698