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

Unified Diff: chrome/browser/extensions/bookmark_app_helper.h

Issue 667053007: Use manifest for streamlined hosted app creation for title and URL. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git/+/master
Patch Set: Fix memory leak in manifest_manager_host Created 6 years, 2 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
« no previous file with comments | « no previous file | chrome/browser/extensions/bookmark_app_helper.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/bookmark_app_helper.h
diff --git a/chrome/browser/extensions/bookmark_app_helper.h b/chrome/browser/extensions/bookmark_app_helper.h
index 0e5ad27288cc4316646685ca7c839e20df219d3a..bc3cfb2befa0d57ff33a38fdeb696746d3fe173d 100644
--- a/chrome/browser/extensions/bookmark_app_helper.h
+++ b/chrome/browser/extensions/bookmark_app_helper.h
@@ -15,6 +15,7 @@
#include "chrome/common/web_application_info.h"
#include "content/public/browser/notification_observer.h"
#include "content/public/browser/notification_registrar.h"
+#include "content/public/common/manifest.h"
class ExtensionService;
class FaviconDownloader;
@@ -44,6 +45,10 @@ class BookmarkAppHelper : public content::NotificationObserver {
content::WebContents* contents);
virtual ~BookmarkAppHelper();
+ // Update the given WebApplicationInfo with information from the manifest.
+ static void UpdateWebAppInfoFromManifest(const content::Manifest& manifest,
+ WebApplicationInfo* web_app_info);
+
// This finds the closest not-smaller bitmap in |bitmaps| for each size in
// |sizes| and resizes it to that size. This returns a map of sizes to bitmaps
// which contains only bitmaps of a size in |sizes| and at most one bitmap of
@@ -66,6 +71,11 @@ class BookmarkAppHelper : public content::NotificationObserver {
private:
friend class TestBookmarkAppHelper;
+ // Called by the WebContents when the manifest has been downloaded. If there
+ // is no manifest, or the WebContents is destroyed before the manifest could
+ // be downloaded, this is called with an empty manifest.
+ void OnDidGetManifest(const content::Manifest& manifest);
+
// Performs post icon download tasks including installing the bookmark app.
void OnIconsDownloaded(bool success,
const std::map<GURL, std::vector<SkBitmap> >& bitmaps);
@@ -75,6 +85,9 @@ class BookmarkAppHelper : public content::NotificationObserver {
const content::NotificationSource& source,
const content::NotificationDetails& details) override;
+ // The web contents that the bookmark app is being created for.
+ content::WebContents* contents_;
+
// The WebApplicationInfo that the bookmark app is being created for.
WebApplicationInfo web_app_info_;
« no previous file with comments | « no previous file | chrome/browser/extensions/bookmark_app_helper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698