1 // Copyright (c) 2012 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.
5 #include "chrome/browser/chromeos/login/screen_manager.h"
9 ScreenManager::ScreenManager() {
12 ScreenManager::~ScreenManager() {
15 BaseScreen
* ScreenManager::GetScreen(const std::string
& screen_name
) {
16 ScreenMap::const_iterator iter
= screens_
.find(screen_name
);
17 if (iter
!= screens_
.end()) {
18 return iter
->second
.get();
20 BaseScreen
* result
= CreateScreen(screen_name
);
21 DCHECK(result
) << "Can not create screen named " << screen_name
;
22 screens_
[screen_name
] = make_linked_ptr(result
);
26 bool ScreenManager::HasScreen(const std::string
& screen_name
) {
27 return screens_
.count(screen_name
) > 0;
30 } // namespace chromeos