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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | remoting/base/capabilities.cc » ('j') | remoting/base/capabilities.cc » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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 #ifndef REMOTING_BASE_CAPABILITIES_H_
6 #define REMOTING_BASE_CAPABILITIES_H_
7
8 #include <set>
9 #include <string>
10
11 #include "base/basictypes.h"
12 #include "base/memory/scoped_ptr.h"
13
14 namespace base {
15 class ListValue;
16 } // namespace base
17
18 namespace remoting {
19
20 namespace protocol {
21 class Capabilities;
22 } // namespace protocol
23
24 // Represents a set of capabilities. Each capability is represented by a unique
25 // string that may not contain spaces.
26 class Capabilities {
27 public:
28 Capabilities();
29 explicit Capabilities(const std::string& value);
30 ~Capabilities();
31
32 // Returs the number of capabilities in the set.
33 size_t Size() const {
34 return capabilities_.size();
35 }
36
37 // Returns true if |this| contains |capability|.
38 bool HasCapability(const std::string& capability) const;
39
40 // Returns a set of capabilities contained in both |this| and |other| sets.
41 Capabilities Intersect(const Capabilities& other) const;
42
43 // Initializes |this| from |base::ListValue|. Returns false if |value|
44 // contains anything else than valid capability strings.
45 bool FromListValue(const base::ListValue& value);
46
47 // Initializes |this| from |message|. Returns false if |message| contains
48 // anything else than valid capability strings.
49 bool FromProtocolMessage(const protocol::Capabilities& message);
50
51 // Initializes |this| from |message|.
52 void FromString(const std::string& value);
53
54 // Converts |this| into |base::ListValue|.
55 scoped_ptr<base::ListValue> ToListValue() const;
56
57 // Converts |this| into |protocol::Capabilities|.
58 scoped_ptr<protocol::Capabilities> ToProtocolMessage() const;
59
60 // Converts |this| into |std::string|.
61 std::string ToString() const;
62
63 protected:
64 std::set<std::string> capabilities_;
65 };
66
67 } // namespace remoting
68
69 #endif // REMOTING_BASE_CAPABILITIES_H_
OLDNEW
« 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