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

Unified Diff: chrome/browser/android/shortcut_helper.h

Issue 1310223002: webapps: initial addition of splash screen icon downloading (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@webapps-database-exp
Patch Set: Fix small issues Created 5 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/android/shortcut_helper.h
diff --git a/chrome/browser/android/shortcut_helper.h b/chrome/browser/android/shortcut_helper.h
index 93e1c9d589a86307befc9bbc041867eb15ffadae..af8fa3c0e79a9264ae05ac2e3e20de382a413bf0 100644
--- a/chrome/browser/android/shortcut_helper.h
+++ b/chrome/browser/android/shortcut_helper.h
@@ -10,10 +10,14 @@
#include "chrome/browser/android/shortcut_info.h"
#include "third_party/skia/include/core/SkBitmap.h"
+namespace content {
+class WebContents;
+} // namespace content
+
// ShortcutHelper is the C++ counterpart of org.chromium.chrome.browser's
// ShortcutHelper in Java. The object is owned by the Java object. It is created
gone 2015/08/26 21:39:25 Nothing owns the native ShortcutHelper -- you don'
Lalit Maganti 2015/08/26 22:55:00 This is fixed by a rebase. I hadn't based this off
// from there via a JNI (Initialize) call and MUST BE DESTROYED via Destroy().
-class ShortcutHelper {
+class ShortcutHelper final {
public:
// Registers JNI hooks.
static bool RegisterShortcutHelper(JNIEnv* env);
@@ -21,9 +25,23 @@ class ShortcutHelper {
// Adds a shortcut to the launcher using a SkBitmap.
// Must be called on the IO thread.
static void AddShortcutInBackgroundWithSkBitmap(const ShortcutInfo& info,
+ const std::string& webapp_id,
const SkBitmap& icon_bitmap);
+
+ // Fetches the splashscreen image and stores it inside the WebappDataStorage
+ // of the webapp.
+ static void FetchSplashscreenImage(content::WebContents* web_contents,
+ const GURL& image_url,
+ const int ideal_splash_image_size_in_dp,
+ const std::string& webapp_id);
+
+ // Stores the data of the webapp which is not placed inside the shortcut.
+ static void StoreWebappData(const std::string& webapp_id,
+ const SkBitmap& splash_image);
+
private:
- ShortcutHelper();
+ ShortcutHelper() = delete;
+ ~ShortcutHelper() = delete;
DISALLOW_COPY_AND_ASSIGN(ShortcutHelper);
};

Powered by Google App Engine
This is Rietveld 408576698