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

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

Issue 10086019: Use the non-localized "canonical name" of an extension to write to its sync (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: rename, test Created 8 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 | chrome/common/extensions/extension.h » ('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 #include "chrome/browser/extensions/extension_sync_data.h" 5 #include "chrome/browser/extensions/extension_sync_data.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "chrome/browser/extensions/app_sync_data.h" 8 #include "chrome/browser/extensions/app_sync_data.h"
9 #include "chrome/browser/extensions/extension_service.h" 9 #include "chrome/browser/extensions/extension_service.h"
10 #include "chrome/browser/sync/api/sync_data.h" 10 #include "chrome/browser/sync/api/sync_data.h"
(...skipping 25 matching lines...) Expand all
36 36
37 ExtensionSyncData::ExtensionSyncData(const Extension& extension, 37 ExtensionSyncData::ExtensionSyncData(const Extension& extension,
38 bool enabled, 38 bool enabled,
39 bool incognito_enabled) 39 bool incognito_enabled)
40 : id_(extension.id()), 40 : id_(extension.id()),
41 uninstalled_(false), 41 uninstalled_(false),
42 enabled_(enabled), 42 enabled_(enabled),
43 incognito_enabled_(incognito_enabled), 43 incognito_enabled_(incognito_enabled),
44 version_(*extension.version()), 44 version_(*extension.version()),
45 update_url_(extension.update_url()), 45 update_url_(extension.update_url()),
46 name_(extension.name()) { 46 name_(extension.non_localized_name()) {
47 } 47 }
48 48
49 ExtensionSyncData::~ExtensionSyncData() {} 49 ExtensionSyncData::~ExtensionSyncData() {}
50 50
51 SyncData ExtensionSyncData::GetSyncData() const { 51 SyncData ExtensionSyncData::GetSyncData() const {
52 sync_pb::EntitySpecifics specifics; 52 sync_pb::EntitySpecifics specifics;
53 PopulateExtensionSpecifics(specifics.mutable_extension()); 53 PopulateExtensionSpecifics(specifics.mutable_extension());
54 54
55 return SyncData::CreateLocalData(id_, name_, specifics); 55 return SyncData::CreateLocalData(id_, name_, specifics);
56 } 56 }
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
103 const sync_pb::EntitySpecifics& entity_specifics = sync_data.GetSpecifics(); 103 const sync_pb::EntitySpecifics& entity_specifics = sync_data.GetSpecifics();
104 104
105 if (entity_specifics.has_extension()) { 105 if (entity_specifics.has_extension()) {
106 PopulateFromExtensionSpecifics(entity_specifics.extension()); 106 PopulateFromExtensionSpecifics(entity_specifics.extension());
107 } else { 107 } else {
108 LOG(FATAL) << "Attempt to sync bad EntitySpecifics."; 108 LOG(FATAL) << "Attempt to sync bad EntitySpecifics.";
109 } 109 }
110 } 110 }
111 111
112 } // namespace extensions 112 } // namespace extensions
OLDNEW
« no previous file with comments | « no previous file | chrome/common/extensions/extension.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698