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

Side by Side Diff: remoting/host/composite_host_config.cc

Issue 10825121: Remove the need to have separate config for authentication. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 4 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 (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.
4
5 #include "remoting/host/composite_host_config.h"
6
7 #include "base/stl_util.h"
8 #include "remoting/host/json_host_config.h"
9
10 namespace remoting {
11
12 CompositeHostConfig::CompositeHostConfig() {
13 }
14
15 CompositeHostConfig::~CompositeHostConfig() {
16 STLDeleteElements(&configs_);
17 }
18
19 bool CompositeHostConfig::AddConfigPath(const FilePath& path) {
20 scoped_ptr<JsonHostConfig> config(new JsonHostConfig(path));
21 if (!config->Read()) {
22 return false;
23 }
24 configs_.push_back(config.release());
25 return true;
26 }
27
28 bool CompositeHostConfig::GetString(const std::string& path,
29 std::string* out_value) const {
30 for (std::vector<HostConfig*>::const_iterator it = configs_.begin();
31 it != configs_.end(); ++it) {
32 if ((*it)->GetString(path, out_value))
33 return true;
34 }
35 return false;
36 }
37
38 bool CompositeHostConfig::GetBoolean(const std::string& path,
39 bool* out_value) const {
40 for (std::vector<HostConfig*>::const_iterator it = configs_.begin();
41 it != configs_.end(); ++it) {
42 if ((*it)->GetBoolean(path, out_value))
43 return true;
44 }
45 return false;
46 }
47
48 } // namespace remoting
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698