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

Side by Side Diff: chrome/browser/ui/webui/chromeos/login/screenlock_icon_provider.cc

Issue 168813002: Refactor user pods to use authType property for distinct authentication modes. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix ScreenLockerTest Created 6 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 | Annotate | Revision Log
OLDNEW
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/webui/chromeos/login/screenlock_icon_provider.h" 5 #include "chrome/browser/ui/webui/chromeos/login/screenlock_icon_provider.h"
6 6
7 namespace chromeos { 7 namespace chromeos {
8 8
9 ScreenlockIconProvider::ScreenlockIconProvider() {} 9 ScreenlockIconProvider::ScreenlockIconProvider() {}
10 10
11 ScreenlockIconProvider::~ScreenlockIconProvider() {} 11 ScreenlockIconProvider::~ScreenlockIconProvider() {}
12 12
13 void ScreenlockIconProvider::AddIcon(const std::string& username, 13 void ScreenlockIconProvider::AddIcon(const std::string& username,
14 const gfx::Image& icon) { 14 const gfx::Image& icon) {
15 user_icon_map_[username] = icon; 15 user_icon_map_[username] = icon;
16 } 16 }
17 17
18 void ScreenlockIconProvider::RemoveIcon(const std::string& username) {
19 if (user_icon_map_.find(username) != user_icon_map_.end())
20 user_icon_map_.erase(username);
21 }
22
18 gfx::Image ScreenlockIconProvider::GetIcon(const std::string& username) { 23 gfx::Image ScreenlockIconProvider::GetIcon(const std::string& username) {
19 if (user_icon_map_.find(username) == user_icon_map_.end()) 24 if (user_icon_map_.find(username) == user_icon_map_.end())
20 return gfx::Image(); 25 return gfx::Image();
21 return user_icon_map_[username]; 26 return user_icon_map_[username];
22 } 27 }
23 28
24 void ScreenlockIconProvider::Clear() { 29 void ScreenlockIconProvider::Clear() {
25 user_icon_map_.clear(); 30 user_icon_map_.clear();
26 } 31 }
27 32
28 } // namespace chromeos 33 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698