Fix first run detection for post-sideload UI.
1. Don't override our current first-run state on the next call of IdentifyAlertableExtensions.
2. Remember for each external extension whether it was installed during a first run, so on subsequent runs it behaves the same.
BUG=229083
Review URL: https://chromiumcodereview.appspot.com/14079012
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@196313 0039d316-1c4b-4281-b951-d872f2087c98
diff --git a/chrome/browser/extensions/test_extension_system.cc b/chrome/browser/extensions/test_extension_system.cc
index 568078b9..ec88051 100644
--- a/chrome/browser/extensions/test_extension_system.cc
+++ b/chrome/browser/extensions/test_extension_system.cc
@@ -62,10 +62,9 @@
socket_manager_.reset(new ApiResourceManager<Socket>(id));
}
-ExtensionService* TestExtensionSystem::CreateExtensionService(
+ExtensionPrefs* TestExtensionSystem::CreateExtensionPrefs(
const CommandLine* command_line,
- const base::FilePath& install_directory,
- bool autoupdate_enabled) {
+ const base::FilePath& install_directory) {
bool extensions_disabled =
command_line && command_line->HasSwitch(switches::kDisableExtensions);
@@ -79,6 +78,15 @@
install_directory,
ExtensionPrefValueMapFactory::GetForProfile(profile_),
extensions_disabled);
+ return extension_prefs_.get();
+}
+
+ExtensionService* TestExtensionSystem::CreateExtensionService(
+ const CommandLine* command_line,
+ const base::FilePath& install_directory,
+ bool autoupdate_enabled) {
+ if (!extension_prefs_)
+ CreateExtensionPrefs(command_line, install_directory);
state_store_.reset(new StateStore(profile_, new TestingValueStore()));
shell_window_geometry_cache_.reset(
new ShellWindowGeometryCache(profile_, extension_prefs_.get()));