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

Side by Side Diff: chrome/browser/extensions/app_sync_data.h

Issue 1066623008: Sync bookmark app icon urls and sizes, and download icons for new apps. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Updated sync value conversions Created 5 years, 7 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 | « no previous file | chrome/browser/extensions/app_sync_data.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 (c) 2012 The Chromium Authors. All rights reserved. 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 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 CHROME_BROWSER_EXTENSIONS_APP_SYNC_DATA_H_ 5 #ifndef CHROME_BROWSER_EXTENSIONS_APP_SYNC_DATA_H_
6 #define CHROME_BROWSER_EXTENSIONS_APP_SYNC_DATA_H_ 6 #define CHROME_BROWSER_EXTENSIONS_APP_SYNC_DATA_H_
7 7
8 #include "base/memory/scoped_ptr.h" 8 #include "base/memory/scoped_ptr.h"
9 #include "chrome/browser/extensions/extension_sync_data.h" 9 #include "chrome/browser/extensions/extension_sync_data.h"
10 #include "extensions/common/constants.h" 10 #include "extensions/common/constants.h"
(...skipping 10 matching lines...) Expand all
21 } 21 }
22 22
23 namespace extensions { 23 namespace extensions {
24 24
25 class Extension; 25 class Extension;
26 class ExtensionSyncData; 26 class ExtensionSyncData;
27 27
28 // A class that encapsulates the synced properties of an Application. 28 // A class that encapsulates the synced properties of an Application.
29 class AppSyncData { 29 class AppSyncData {
30 public: 30 public:
31 struct LinkedAppIconInfo {
32 LinkedAppIconInfo();
33 ~LinkedAppIconInfo();
34
35 GURL url;
36 int size;
37 };
38
31 AppSyncData(); 39 AppSyncData();
32 AppSyncData(const Extension& extension, 40 AppSyncData(const Extension& extension,
33 bool enabled, 41 bool enabled,
34 bool incognito_enabled, 42 bool incognito_enabled,
35 bool remote_install, 43 bool remote_install,
36 ExtensionSyncData::OptionalBoolean all_urls_enabled, 44 ExtensionSyncData::OptionalBoolean all_urls_enabled,
37 const syncer::StringOrdinal& app_launch_ordinal, 45 const syncer::StringOrdinal& app_launch_ordinal,
38 const syncer::StringOrdinal& page_ordinal, 46 const syncer::StringOrdinal& page_ordinal,
39 extensions::LaunchType launch_type); 47 extensions::LaunchType launch_type);
40 ~AppSyncData(); 48 ~AppSyncData();
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
75 } 83 }
76 84
77 const std::string& bookmark_app_description() const { 85 const std::string& bookmark_app_description() const {
78 return bookmark_app_description_; 86 return bookmark_app_description_;
79 } 87 }
80 88
81 const std::string& bookmark_app_icon_color() const { 89 const std::string& bookmark_app_icon_color() const {
82 return bookmark_app_icon_color_; 90 return bookmark_app_icon_color_;
83 } 91 }
84 92
93 const std::vector<LinkedAppIconInfo>& linked_icons() const {
94 return linked_icons_;
95 }
96
85 private: 97 private:
86 // Convert an AppSyncData back out to a sync structure. 98 // Convert an AppSyncData back out to a sync structure.
87 void PopulateAppSpecifics(sync_pb::AppSpecifics* specifics) const; 99 void PopulateAppSpecifics(sync_pb::AppSpecifics* specifics) const;
88 100
89 // Populate this class from sync inputs. Return true if the input 101 // Populate this class from sync inputs. Return true if the input
90 // was valid. 102 // was valid.
91 bool PopulateFromAppSpecifics(const sync_pb::AppSpecifics& specifics); 103 bool PopulateFromAppSpecifics(const sync_pb::AppSpecifics& specifics);
92 bool PopulateFromSyncData(const syncer::SyncData& sync_data); 104 bool PopulateFromSyncData(const syncer::SyncData& sync_data);
93 105
94 ExtensionSyncData extension_sync_data_; 106 ExtensionSyncData extension_sync_data_;
95 syncer::StringOrdinal app_launch_ordinal_; 107 syncer::StringOrdinal app_launch_ordinal_;
96 syncer::StringOrdinal page_ordinal_; 108 syncer::StringOrdinal page_ordinal_;
97 extensions::LaunchType launch_type_; 109 extensions::LaunchType launch_type_;
98 std::string bookmark_app_url_; 110 std::string bookmark_app_url_;
99 std::string bookmark_app_description_; 111 std::string bookmark_app_description_;
100 std::string bookmark_app_icon_color_; 112 std::string bookmark_app_icon_color_;
113 std::vector<LinkedAppIconInfo> linked_icons_;
101 }; 114 };
102 115
103 } // namespace extensions 116 } // namespace extensions
104 117
105 #endif // CHROME_BROWSER_EXTENSIONS_APP_SYNC_DATA_H_ 118 #endif // CHROME_BROWSER_EXTENSIONS_APP_SYNC_DATA_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/extensions/app_sync_data.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698