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

Unified 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, 5 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
« no previous file with comments | « remoting/host/composite_host_config.h ('k') | remoting/host/installer/chromoting.wxs » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/host/composite_host_config.cc
diff --git a/remoting/host/composite_host_config.cc b/remoting/host/composite_host_config.cc
new file mode 100644
index 0000000000000000000000000000000000000000..cf130a9decf7271055cfac4fe7856e0554322a6e
--- /dev/null
+++ b/remoting/host/composite_host_config.cc
@@ -0,0 +1,46 @@
+// Copyright (c) 2012 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 "remoting/host/composite_host_config.h"
+
+#include "remoting/host/json_host_config.h"
+
+namespace remoting {
+
+CompositeHostConfig::CompositeHostConfig() {
+}
+
+CompositeHostConfig::~CompositeHostConfig() {
+}
+
+bool CompositeHostConfig::AddConfigPath(const FilePath& path) {
+ scoped_ptr<JsonHostConfig> config(new JsonHostConfig(path));
+ if (!config->Read()) {
+ return false;
+ }
+ configs_.push_back(config.release());
+ return true;
+}
+
+bool CompositeHostConfig::GetString(const std::string& path,
+ std::string* out_value) const {
+ for (std::vector<HostConfig*>::const_iterator it = configs_.begin();
+ it != configs_.end(); ++it) {
+ if ((*it)->GetString(path, out_value))
+ return true;
+ }
+ return false;
+}
+
+bool CompositeHostConfig::GetBoolean(const std::string& path,
+ bool* out_value) const {
+ for (std::vector<HostConfig*>::const_iterator it = configs_.begin();
+ it != configs_.end(); ++it) {
+ if ((*it)->GetBoolean(path, out_value))
+ return true;
+ }
+ return false;
+}
+
+} // namespace remoting
« no previous file with comments | « remoting/host/composite_host_config.h ('k') | remoting/host/installer/chromoting.wxs » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698