diff options
Diffstat (limited to 'chrome')
-rw-r--r-- | chrome/browser/extensions/extension_prefs.cc | 10 | ||||
-rw-r--r-- | chrome/browser/ui/webui/ntp/app_launcher_handler.cc | 4 |
2 files changed, 12 insertions, 2 deletions
diff --git a/chrome/browser/extensions/extension_prefs.cc b/chrome/browser/extensions/extension_prefs.cc index a49f934..c70e268 100644 --- a/chrome/browser/extensions/extension_prefs.cc +++ b/chrome/browser/extensions/extension_prefs.cc @@ -1708,7 +1708,17 @@ void ExtensionPrefs::InitializePageOrdinalMap( for (ExtensionIdSet::const_iterator ext_it = extension_ids.begin(); ext_it != extension_ids.end(); ++ext_it) { UpdatePageOrdinalMap(StringOrdinal(), GetPageOrdinal(*ext_it)); + + // Ensure that the web store app still isn't found in this list, since + // it is added after this loop. + DCHECK(*ext_it != extension_misc::kWebStoreAppId); } + + // Include the Web Store App since it is displayed on the NTP. + StringOrdinal web_store_app_page = + GetPageOrdinal(extension_misc::kWebStoreAppId); + if (web_store_app_page.IsValid()) + UpdatePageOrdinalMap(StringOrdinal(), web_store_app_page); } void ExtensionPrefs::UpdatePageOrdinalMap(const StringOrdinal& old_value, diff --git a/chrome/browser/ui/webui/ntp/app_launcher_handler.cc b/chrome/browser/ui/webui/ntp/app_launcher_handler.cc index a494a9c..893fb0b 100644 --- a/chrome/browser/ui/webui/ntp/app_launcher_handler.cc +++ b/chrome/browser/ui/webui/ntp/app_launcher_handler.cc @@ -173,8 +173,8 @@ void AppLauncherHandler::CreateAppInfo(const Extension* extension, // We convert the page_ordinal to an integer because the pages are referenced // from within an array in the javascript code, which can't be easily // changed to handle the StringOrdinal values, so we do the conversion here. - value->SetInteger("page_index", - prefs->PageStringOrdinalAsInteger(page_ordinal)); + int page_index = prefs->PageStringOrdinalAsInteger(page_ordinal); + value->SetInteger("page_index", page_index >= 0 ? page_index : 0); StringOrdinal app_launch_ordinal = prefs->GetAppLaunchOrdinal(extension->id()); |