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

Unified Diff: chrome/browser/sync/test/integration/sync_app_helper.cc

Issue 1419823011: app_sorting() calls should go via ExtensionSystem intsead of prefs. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Changes as per review comments. Created 5 years, 1 month 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/sync/test/integration/sync_app_helper.cc
diff --git a/chrome/browser/sync/test/integration/sync_app_helper.cc b/chrome/browser/sync/test/integration/sync_app_helper.cc
index 1f28b36aa4b3aeaa194017c45a688a4bd7901399..30f26f9996b843e71e82b05928dd9296f0d69b0b 100644
--- a/chrome/browser/sync/test/integration/sync_app_helper.cc
+++ b/chrome/browser/sync/test/integration/sync_app_helper.cc
@@ -20,7 +20,9 @@
#include "extensions/browser/extension_system.h"
#include "extensions/common/extension_set.h"
+using extensions::AppSorting;
using extensions::ExtensionPrefs;
+using extensions::ExtensionSystem;
namespace {
@@ -64,8 +66,9 @@ void LoadApp(content::BrowserContext* context,
const std::string& id,
AppState* app_state) {
ExtensionPrefs* prefs = ExtensionPrefs::Get(context);
- app_state->app_launch_ordinal = prefs->app_sorting()->GetAppLaunchOrdinal(id);
- app_state->page_ordinal = prefs->app_sorting()->GetPageOrdinal(id);
+ AppSorting* app_sorting = ExtensionSystem::Get(context)->app_sorting();
+ app_state->app_launch_ordinal = app_sorting->GetAppLaunchOrdinal(id);
+ app_state->page_ordinal = app_sorting->GetPageOrdinal(id);
app_state->launch_type = extensions::GetLaunchTypePrefValue(prefs, id);
ExtensionService* service =
extensions::ExtensionSystem::Get(context)->extension_service();
@@ -184,7 +187,7 @@ bool SyncAppHelper::AppStatesMatch(Profile* profile1, Profile* profile2) {
syncer::StringOrdinal SyncAppHelper::GetPageOrdinalForApp(
Profile* profile,
const std::string& name) {
- return ExtensionPrefs::Get(profile)->app_sorting()->GetPageOrdinal(
+ return ExtensionSystem::Get(profile)->app_sorting()->GetPageOrdinal(
crx_file::id_util::GenerateId(name));
}
@@ -192,14 +195,14 @@ void SyncAppHelper::SetPageOrdinalForApp(
Profile* profile,
const std::string& name,
const syncer::StringOrdinal& page_ordinal) {
- ExtensionPrefs::Get(profile)->app_sorting()->SetPageOrdinal(
+ ExtensionSystem::Get(profile)->app_sorting()->SetPageOrdinal(
crx_file::id_util::GenerateId(name), page_ordinal);
}
syncer::StringOrdinal SyncAppHelper::GetAppLaunchOrdinalForApp(
Profile* profile,
const std::string& name) {
- return ExtensionPrefs::Get(profile)->app_sorting()->GetAppLaunchOrdinal(
+ return ExtensionSystem::Get(profile)->app_sorting()->GetAppLaunchOrdinal(
crx_file::id_util::GenerateId(name));
}
@@ -207,12 +210,12 @@ void SyncAppHelper::SetAppLaunchOrdinalForApp(
Profile* profile,
const std::string& name,
const syncer::StringOrdinal& app_launch_ordinal) {
- ExtensionPrefs::Get(profile)->app_sorting()->SetAppLaunchOrdinal(
+ ExtensionSystem::Get(profile)->app_sorting()->SetAppLaunchOrdinal(
crx_file::id_util::GenerateId(name), app_launch_ordinal);
}
void SyncAppHelper::FixNTPOrdinalCollisions(Profile* profile) {
- ExtensionPrefs::Get(profile)->app_sorting()->FixNTPOrdinalCollisions();
+ ExtensionSystem::Get(profile)->app_sorting()->FixNTPOrdinalCollisions();
}
SyncAppHelper::SyncAppHelper() : setup_completed_(false) {}
« no previous file with comments | « chrome/browser/extensions/install_tracker.cc ('k') | chrome/browser/sync/test/integration/sync_app_list_helper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698