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

Unified Diff: remoting/base/capabilities.h

Issue 13932020: Set the initial resolution of an RDP session to the client screen resolution if it is available. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: CR feedback #2 Created 7 years, 8 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 | « no previous file | remoting/base/capabilities.cc » ('j') | remoting/base/capabilities.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/base/capabilities.h
diff --git a/remoting/base/capabilities.h b/remoting/base/capabilities.h
new file mode 100644
index 0000000000000000000000000000000000000000..bd2adae835dc99da82a03f9a92f8bcb89a264cc8
--- /dev/null
+++ b/remoting/base/capabilities.h
@@ -0,0 +1,69 @@
+// Copyright 2013 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.
+
+#ifndef REMOTING_BASE_CAPABILITIES_H_
+#define REMOTING_BASE_CAPABILITIES_H_
+
+#include <set>
+#include <string>
+
+#include "base/basictypes.h"
+#include "base/memory/scoped_ptr.h"
+
+namespace base {
+class ListValue;
+} // namespace base
+
+namespace remoting {
+
+namespace protocol {
+class Capabilities;
+} // namespace protocol
+
+// Represents a set of capabilities. Each capability is represented by a unique
+// string that may not contain spaces.
+class Capabilities {
+ public:
+ Capabilities();
+ explicit Capabilities(const std::string& value);
+ ~Capabilities();
+
+ // Returs the number of capabilities in the set.
+ size_t Size() const {
+ return capabilities_.size();
+ }
+
+ // Returns true if |this| contains |capability|.
+ bool HasCapability(const std::string& capability) const;
+
+ // Returns a set of capabilities contained in both |this| and |other| sets.
+ Capabilities Intersect(const Capabilities& other) const;
+
+ // Initializes |this| from |base::ListValue|. Returns false if |value|
+ // contains anything else than valid capability strings.
+ bool FromListValue(const base::ListValue& value);
+
+ // Initializes |this| from |message|. Returns false if |message| contains
+ // anything else than valid capability strings.
+ bool FromProtocolMessage(const protocol::Capabilities& message);
+
+ // Initializes |this| from |message|.
+ void FromString(const std::string& value);
+
+ // Converts |this| into |base::ListValue|.
+ scoped_ptr<base::ListValue> ToListValue() const;
+
+ // Converts |this| into |protocol::Capabilities|.
+ scoped_ptr<protocol::Capabilities> ToProtocolMessage() const;
+
+ // Converts |this| into |std::string|.
+ std::string ToString() const;
+
+ protected:
+ std::set<std::string> capabilities_;
+};
+
+} // namespace remoting
+
+#endif // REMOTING_BASE_CAPABILITIES_H_
« no previous file with comments | « no previous file | remoting/base/capabilities.cc » ('j') | remoting/base/capabilities.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698