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

Unified Diff: chrome/browser/extensions/test_extension_system.cc

Issue 1254363004: Move ownership of AppSorting from ExtensionPrefs to ExtensionSystem (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: review1 Created 5 years, 5 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/extensions/test_extension_system.cc
diff --git a/chrome/browser/extensions/test_extension_system.cc b/chrome/browser/extensions/test_extension_system.cc
index b1d023cf23256695a845731fef2f43053074a5db..8cfb38b13030a0b955a4c84ef752dc6cd903ecb7 100644
--- a/chrome/browser/extensions/test_extension_system.cc
+++ b/chrome/browser/extensions/test_extension_system.cc
@@ -21,6 +21,7 @@
#include "extensions/browser/extensions_browser_client.h"
#include "extensions/browser/info_map.h"
#include "extensions/browser/management_policy.h"
+#include "extensions/browser/null_app_sorting.h"
#include "extensions/browser/quota_service.h"
#include "extensions/browser/runtime_data.h"
#include "extensions/browser/state_store.h"
@@ -34,7 +35,9 @@ TestExtensionSystem::TestExtensionSystem(Profile* profile)
: profile_(profile),
value_store_(NULL),
info_map_(new InfoMap()),
- quota_service_(new QuotaService()) {}
+ quota_service_(new QuotaService()),
+ app_sorting_(new NullAppSorting) {
+}
TestExtensionSystem::~TestExtensionSystem() {
}
@@ -55,11 +58,12 @@ scoped_ptr<ExtensionPrefs> TestExtensionSystem::CreateExtensionPrefs(
// are not reflected in the pref service. One would need to
// inject a new ExtensionPrefStore(extension_pref_value_map, false).
- return make_scoped_ptr(ExtensionPrefs::Create(
+ auto prefs = make_scoped_ptr(ExtensionPrefs::Create(
profile_->GetPrefs(), install_directory,
ExtensionPrefValueMapFactory::GetForBrowserContext(profile_),
- ExtensionsBrowserClient::Get()->CreateAppSorting(profile_).Pass(),
extensions_disabled, std::vector<ExtensionPrefsObserver*>()));
+ prefs->set_app_sorting(app_sorting_.get());
+ return prefs;
}
ExtensionService* TestExtensionSystem::CreateExtensionService(
@@ -122,6 +126,10 @@ QuotaService* TestExtensionSystem::quota_service() {
return quota_service_.get();
}
+AppSorting* TestExtensionSystem::app_sorting() {
+ return app_sorting_.get();
+}
+
const OneShotEvent& TestExtensionSystem::ready() const {
return ready_;
}

Powered by Google App Engine
This is Rietveld 408576698