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

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

Issue 7677032: ntp4: make app-install-via-drag less janky (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: more test fixes Created 9 years, 4 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/extension_prefs.cc
diff --git a/chrome/browser/extensions/extension_prefs.cc b/chrome/browser/extensions/extension_prefs.cc
index 776273ee31e5077b9b39769eb66f9037591239bf..95c10b1d1300d4e944bbf997e5539f0189db1807 100644
--- a/chrome/browser/extensions/extension_prefs.cc
+++ b/chrome/browser/extensions/extension_prefs.cc
@@ -949,7 +949,8 @@ void ExtensionPrefs::SetToolbarOrder(
void ExtensionPrefs::OnExtensionInstalled(
const Extension* extension,
Extension::State initial_state,
- bool from_webstore) {
+ bool from_webstore,
+ int page_index) {
const std::string& id = extension->id();
CHECK(Extension::IdIsValid(id));
ScopedExtensionPrefUpdate update(prefs_, id);
@@ -979,8 +980,10 @@ void ExtensionPrefs::OnExtensionInstalled(
extension_dict->Set(kPrefManifest,
extension->manifest_value()->DeepCopy());
}
+ extension_dict->Set(kPrefPageIndex,
+ Value::CreateIntegerValue(page_index));
extension_dict->Set(kPrefAppLaunchIndex,
- Value::CreateIntegerValue(GetNextAppLaunchIndex()));
+ Value::CreateIntegerValue(GetNextAppLaunchIndex(page_index)));
extension_pref_value_map_->RegisterExtension(
id, install_time, initial_state == Extension::ENABLED);
content_settings_store_->RegisterExtension(
@@ -1324,7 +1327,7 @@ void ExtensionPrefs::SetAppLaunchIndex(const std::string& extension_id,
Value::CreateIntegerValue(index));
}
-int ExtensionPrefs::GetNextAppLaunchIndex() {
+int ExtensionPrefs::GetNextAppLaunchIndex(int on_page) {
const DictionaryValue* extensions = prefs_->GetDictionary(kExtensionsPref);
if (!extensions)
return 0;
@@ -1333,7 +1336,8 @@ int ExtensionPrefs::GetNextAppLaunchIndex() {
for (DictionaryValue::key_iterator extension_id = extensions->begin_keys();
extension_id != extensions->end_keys(); ++extension_id) {
int value = GetAppLaunchIndex(*extension_id);
- if (value > max_value)
+ int page = GetPageIndex(*extension_id);
+ if (page == on_page && value > max_value)
max_value = value;
}
return max_value + 1;

Powered by Google App Engine
This is Rietveld 408576698