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

Unified Diff: chrome/browser/ui/app_list/app_list_view_delegate.cc

Issue 489753002: Added proper extension manifest parser for launcher_page. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 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/ui/app_list/app_list_view_delegate.cc
diff --git a/chrome/browser/ui/app_list/app_list_view_delegate.cc b/chrome/browser/ui/app_list/app_list_view_delegate.cc
index f84222792063e2c41d279023bb0b2f8d0a30d058..61c43ee04ec51347498069f3abce5cfb65552983 100644
--- a/chrome/browser/ui/app_list/app_list_view_delegate.cc
+++ b/chrome/browser/ui/app_list/app_list_view_delegate.cc
@@ -41,8 +41,8 @@
#include "extensions/browser/extension_registry.h"
#include "extensions/common/constants.h"
#include "extensions/common/extension_set.h"
-#include "extensions/common/manifest.h"
#include "extensions/common/manifest_constants.h"
+#include "extensions/common/manifest_handlers/launcher_page_info.h"
#include "grit/theme_resources.h"
#include "ui/app_list/app_list_switches.h"
#include "ui/app_list/app_list_view_delegate_observer.h"
@@ -135,20 +135,12 @@ void GetCustomLauncherPageUrls(content::BrowserContext* browser_context,
it != enabled_extensions.end();
++it) {
const extensions::Extension* extension = it->get();
- const extensions::Manifest* manifest = extension->manifest();
- if (!manifest->HasKey(extensions::manifest_keys::kLauncherPage))
+ extensions::LauncherPageInfo* info =
+ static_cast<extensions::LauncherPageInfo*>(extension->GetManifestData(
+ extensions::manifest_keys::kLauncherPage));
+ if (!info)
continue;
- std::string launcher_page_page;
- if (!manifest->GetString(extensions::manifest_keys::kLauncherPagePage,
- &launcher_page_page)) {
- // TODO(mgiuca): Add a proper manifest parser to catch this error properly
- // and display it on the extensions page.
- LOG(ERROR) << "Extension " << extension->id() << ": "
- << extensions::manifest_keys::kLauncherPage
- << " has no 'page' attribute; will be ignored.";
- continue;
- }
- urls->push_back(extension->GetResourceURL(launcher_page_page));
+ urls->push_back(extension->GetResourceURL(info->page));
}
}

Powered by Google App Engine
This is Rietveld 408576698