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

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

Issue 907533004: [Extensions] Sync the 'allowed scripting on all urls' preference (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 10 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
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 #include "chrome/browser/extensions/app_sync_data.h" 5 #include "chrome/browser/extensions/app_sync_data.h"
6 6
7 #include "chrome/common/extensions/manifest_handlers/app_icon_color_info.h" 7 #include "chrome/common/extensions/manifest_handlers/app_icon_color_info.h"
8 #include "chrome/common/extensions/manifest_handlers/app_launch_info.h" 8 #include "chrome/common/extensions/manifest_handlers/app_launch_info.h"
9 #include "extensions/common/extension.h" 9 #include "extensions/common/extension.h"
10 #include "sync/api/sync_data.h" 10 #include "sync/api/sync_data.h"
(...skipping 11 matching lines...) Expand all
22 AppSyncData::AppSyncData(const syncer::SyncChange& sync_change) { 22 AppSyncData::AppSyncData(const syncer::SyncChange& sync_change) {
23 PopulateFromSyncData(sync_change.sync_data()); 23 PopulateFromSyncData(sync_change.sync_data());
24 extension_sync_data_.set_uninstalled( 24 extension_sync_data_.set_uninstalled(
25 sync_change.change_type() == syncer::SyncChange::ACTION_DELETE); 25 sync_change.change_type() == syncer::SyncChange::ACTION_DELETE);
26 } 26 }
27 27
28 AppSyncData::AppSyncData(const Extension& extension, 28 AppSyncData::AppSyncData(const Extension& extension,
29 bool enabled, 29 bool enabled,
30 bool incognito_enabled, 30 bool incognito_enabled,
31 bool remote_install, 31 bool remote_install,
32 ExtensionSyncData::OptionalBoolean all_urls_enabled,
32 const syncer::StringOrdinal& app_launch_ordinal, 33 const syncer::StringOrdinal& app_launch_ordinal,
33 const syncer::StringOrdinal& page_ordinal, 34 const syncer::StringOrdinal& page_ordinal,
34 extensions::LaunchType launch_type) 35 extensions::LaunchType launch_type)
35 : extension_sync_data_(extension, 36 : extension_sync_data_(extension,
36 enabled, 37 enabled,
37 incognito_enabled, 38 incognito_enabled,
38 remote_install), 39 remote_install,
40 all_urls_enabled),
39 app_launch_ordinal_(app_launch_ordinal), 41 app_launch_ordinal_(app_launch_ordinal),
40 page_ordinal_(page_ordinal), 42 page_ordinal_(page_ordinal),
41 launch_type_(launch_type) { 43 launch_type_(launch_type) {
42 if (extension.from_bookmark()) { 44 if (extension.from_bookmark()) {
43 bookmark_app_description_ = extension.description(); 45 bookmark_app_description_ = extension.description();
44 bookmark_app_url_ = AppLaunchInfo::GetLaunchWebURL(&extension).spec(); 46 bookmark_app_url_ = AppLaunchInfo::GetLaunchWebURL(&extension).spec();
45 bookmark_app_icon_color_ = AppIconColorInfo::GetIconColorString(&extension); 47 bookmark_app_icon_color_ = AppIconColorInfo::GetIconColorString(&extension);
46 } 48 }
47 } 49 }
48 50
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
107 bookmark_app_url_ = specifics.bookmark_app_url(); 109 bookmark_app_url_ = specifics.bookmark_app_url();
108 bookmark_app_description_ = specifics.bookmark_app_description(); 110 bookmark_app_description_ = specifics.bookmark_app_description();
109 bookmark_app_icon_color_ = specifics.bookmark_app_icon_color(); 111 bookmark_app_icon_color_ = specifics.bookmark_app_icon_color();
110 } 112 }
111 113
112 void AppSyncData::PopulateFromSyncData(const syncer::SyncData& sync_data) { 114 void AppSyncData::PopulateFromSyncData(const syncer::SyncData& sync_data) {
113 PopulateFromAppSpecifics(sync_data.GetSpecifics().app()); 115 PopulateFromAppSpecifics(sync_data.GetSpecifics().app());
114 } 116 }
115 117
116 } // namespace extensions 118 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/browser/extensions/app_sync_data.h ('k') | chrome/browser/extensions/app_sync_data_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698