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 3 // found in the LICENSE file. 4 5 #include "chrome/browser/ui/webui/chromeos/login/screenlock_icon_provider.h" 6 7 namespace chromeos { 8 ScreenlockIconProvider()9ScreenlockIconProvider::ScreenlockIconProvider() {} 10 ~ScreenlockIconProvider()11ScreenlockIconProvider::~ScreenlockIconProvider() {} 12 AddIcon(const std::string & username,const gfx::Image & icon)13void ScreenlockIconProvider::AddIcon(const std::string& username, 14 const gfx::Image& icon) { 15 user_icon_map_[username] = icon; 16 } 17 RemoveIcon(const std::string & username)18void 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 GetIcon(const std::string & username)23gfx::Image ScreenlockIconProvider::GetIcon(const std::string& username) { 24 if (user_icon_map_.find(username) == user_icon_map_.end()) 25 return gfx::Image(); 26 return user_icon_map_[username]; 27 } 28 Clear()29void ScreenlockIconProvider::Clear() { 30 user_icon_map_.clear(); 31 } 32 33 } // namespace chromeos 34