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

Side by Side Diff: chrome/browser/sync/test/integration/sync_app_helper.cc

Issue 12578008: Move CrxFile, FileReader, ExtensionResource to src/extensions. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 7 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 | Annotate | Revision Log
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/sync/test/integration/sync_app_helper.h" 5 #include "chrome/browser/sync/test/integration/sync_app_helper.h"
6 6
7 #include "chrome/browser/extensions/extension_service.h" 7 #include "chrome/browser/extensions/extension_service.h"
8 #include "chrome/browser/extensions/extension_sorting.h" 8 #include "chrome/browser/extensions/extension_sorting.h"
9 #include "chrome/browser/extensions/extension_system.h" 9 #include "chrome/browser/extensions/extension_system.h"
10 #include "chrome/browser/profiles/profile.h" 10 #include "chrome/browser/profiles/profile.h"
11 #include "chrome/browser/sync/test/integration/extensions_helper.h" 11 #include "chrome/browser/sync/test/integration/extensions_helper.h"
12 #include "chrome/browser/sync/test/integration/sync_datatype_helper.h" 12 #include "chrome/browser/sync/test/integration/sync_datatype_helper.h"
13 #include "chrome/browser/sync/test/integration/sync_extension_helper.h" 13 #include "chrome/browser/sync/test/integration/sync_extension_helper.h"
14 #include "extensions/common/id_util.h"
14 15
15 namespace { 16 namespace {
16 17
17 struct AppState { 18 struct AppState {
18 AppState(); 19 AppState();
19 ~AppState(); 20 ~AppState();
20 bool IsValid() const; 21 bool IsValid() const;
21 bool Equals(const AppState& other) const; 22 bool Equals(const AppState& other) const;
22 23
23 syncer::StringOrdinal app_launch_ordinal; 24 syncer::StringOrdinal app_launch_ordinal;
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
138 ++it2; 139 ++it2;
139 } 140 }
140 141
141 return true; 142 return true;
142 } 143 }
143 144
144 syncer::StringOrdinal SyncAppHelper::GetPageOrdinalForApp( 145 syncer::StringOrdinal SyncAppHelper::GetPageOrdinalForApp(
145 Profile* profile, 146 Profile* profile,
146 const std::string& name) { 147 const std::string& name) {
147 return profile->GetExtensionService()->extension_prefs()-> 148 return profile->GetExtensionService()->extension_prefs()->
148 extension_sorting()->GetPageOrdinal(SyncExtensionHelper::NameToId(name)); 149 extension_sorting()->GetPageOrdinal(
150 extensions::id_util::GenerateId(name));
149 } 151 }
150 152
151 void SyncAppHelper::SetPageOrdinalForApp( 153 void SyncAppHelper::SetPageOrdinalForApp(
152 Profile* profile, 154 Profile* profile,
153 const std::string& name, 155 const std::string& name,
154 const syncer::StringOrdinal& page_ordinal) { 156 const syncer::StringOrdinal& page_ordinal) {
155 profile->GetExtensionService()->extension_prefs()->extension_sorting()-> 157 profile->GetExtensionService()->extension_prefs()->extension_sorting()->
156 SetPageOrdinal(SyncExtensionHelper::NameToId(name), page_ordinal); 158 SetPageOrdinal(extensions::id_util::GenerateId(name), page_ordinal);
157 } 159 }
158 160
159 syncer::StringOrdinal SyncAppHelper::GetAppLaunchOrdinalForApp( 161 syncer::StringOrdinal SyncAppHelper::GetAppLaunchOrdinalForApp(
160 Profile* profile, 162 Profile* profile,
161 const std::string& name) { 163 const std::string& name) {
162 return profile->GetExtensionService()->extension_prefs()-> 164 return profile->GetExtensionService()->extension_prefs()->
163 extension_sorting()->GetAppLaunchOrdinal( 165 extension_sorting()->GetAppLaunchOrdinal(
164 SyncExtensionHelper::NameToId(name)); 166 extensions::id_util::GenerateId(name));
165 } 167 }
166 168
167 void SyncAppHelper::SetAppLaunchOrdinalForApp( 169 void SyncAppHelper::SetAppLaunchOrdinalForApp(
168 Profile* profile, 170 Profile* profile,
169 const std::string& name, 171 const std::string& name,
170 const syncer::StringOrdinal& app_launch_ordinal) { 172 const syncer::StringOrdinal& app_launch_ordinal) {
171 profile->GetExtensionService()->extension_prefs()->extension_sorting()-> 173 profile->GetExtensionService()->extension_prefs()->extension_sorting()->
172 SetAppLaunchOrdinal(SyncExtensionHelper::NameToId(name), 174 SetAppLaunchOrdinal(extensions::id_util::GenerateId(name),
173 app_launch_ordinal); 175 app_launch_ordinal);
174 } 176 }
175 177
176 void SyncAppHelper::FixNTPOrdinalCollisions(Profile* profile) { 178 void SyncAppHelper::FixNTPOrdinalCollisions(Profile* profile) {
177 profile->GetExtensionService()->extension_prefs()->extension_sorting()-> 179 profile->GetExtensionService()->extension_prefs()->extension_sorting()->
178 FixNTPOrdinalCollisions(); 180 FixNTPOrdinalCollisions();
179 } 181 }
180 182
181 SyncAppHelper::SyncAppHelper() : setup_completed_(false) {} 183 SyncAppHelper::SyncAppHelper() : setup_completed_(false) {}
182 184
183 SyncAppHelper::~SyncAppHelper() {} 185 SyncAppHelper::~SyncAppHelper() {}
OLDNEW
« no previous file with comments | « chrome/browser/managed_mode/managed_user_service.cc ('k') | chrome/browser/sync/test/integration/sync_extension_helper.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698