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

Side by Side Diff: mojo/services/catalog/entry.h

Issue 1818373003: Move serialize/deserialize logic onto Entry. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 4 years, 9 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
« no previous file with comments | « mojo/services/catalog/catalog.cc ('k') | mojo/services/catalog/entry.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef MOJO_SERVICES_CATALOG_ENTRY_H_ 5 #ifndef MOJO_SERVICES_CATALOG_ENTRY_H_
6 #define MOJO_SERVICES_CATALOG_ENTRY_H_ 6 #define MOJO_SERVICES_CATALOG_ENTRY_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/memory/scoped_ptr.h"
10 #include "mojo/shell/public/cpp/capabilities.h" 11 #include "mojo/shell/public/cpp/capabilities.h"
11 12
13 namespace base {
14 class DictionaryValue;
15 }
16
12 namespace catalog { 17 namespace catalog {
13 18
14 // Static information about an application package known to the Catalog. 19 // Static information about an application package known to the Catalog.
15 struct Entry { 20 class Entry {
21 public:
16 Entry(); 22 Entry();
17 Entry(const Entry& other); 23 explicit Entry(const Entry& other);
18 ~Entry(); 24 ~Entry();
19 25
26 scoped_ptr<base::DictionaryValue> Serialize() const;
27 static scoped_ptr<Entry> Deserialize(const base::DictionaryValue& value);
28
20 bool operator==(const Entry& other) const; 29 bool operator==(const Entry& other) const;
21 30
22 std::string name; 31 const std::string& name() const { return name_; }
23 std::string qualifier; 32 void set_name(const std::string& name) { name_ = name; }
24 std::string display_name; 33 const std::string& qualifier() const { return qualifier_; }
25 mojo::CapabilitySpec capabilities; 34 void set_qualifier(const std::string& qualifier) { qualifier_ = qualifier; }
35 const std::string& display_name() const { return display_name_; }
36 void set_display_name(const std::string& display_name) {
37 display_name_ = display_name;
38 }
39 const mojo::CapabilitySpec& capabilities() const { return capabilities_; }
40 void set_capabilities(const mojo::CapabilitySpec& capabilities) {
41 capabilities_ = capabilities;
42 }
43
44 private:
45 std::string name_;
46 std::string qualifier_;
47 std::string display_name_;
48 mojo::CapabilitySpec capabilities_;
26 }; 49 };
27 50
28 } // namespace catalog 51 } // namespace catalog
29 52
30 #endif // MOJO_SERVICES_CATALOG_ENTRY_H_ 53 #endif // MOJO_SERVICES_CATALOG_ENTRY_H_
OLDNEW
« no previous file with comments | « mojo/services/catalog/catalog.cc ('k') | mojo/services/catalog/entry.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698