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

Side by Side Diff: chrome/browser/android/webapps/add_to_homescreen_dialog_helper.h

Issue 2064943002: Pass in extra parameters to WebApkBuilder#buildWebApkAsync() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Merge branch 'master' into webapk_manifest Created 4 years, 6 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 unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CHROME_BROWSER_ANDROID_WEBAPPS_ADD_TO_HOMESCREEN_DIALOG_HELPER_H_ 5 #ifndef CHROME_BROWSER_ANDROID_WEBAPPS_ADD_TO_HOMESCREEN_DIALOG_HELPER_H_
6 #define CHROME_BROWSER_ANDROID_WEBAPPS_ADD_TO_HOMESCREEN_DIALOG_HELPER_H_ 6 #define CHROME_BROWSER_ANDROID_WEBAPPS_ADD_TO_HOMESCREEN_DIALOG_HELPER_H_
7 7
8 #include "base/android/jni_android.h" 8 #include "base/android/jni_android.h"
9 #include "base/android/jni_weak_ref.h" 9 #include "base/android/jni_weak_ref.h"
10 #include "base/macros.h" 10 #include "base/macros.h"
(...skipping 28 matching lines...) Expand all
39 // Registers JNI hooks. 39 // Registers JNI hooks.
40 static bool RegisterAddToHomescreenDialogHelper(JNIEnv* env); 40 static bool RegisterAddToHomescreenDialogHelper(JNIEnv* env);
41 41
42 // Adds a shortcut to the current URL to the Android home screen. 42 // Adds a shortcut to the current URL to the Android home screen.
43 void AddShortcut(JNIEnv* env, 43 void AddShortcut(JNIEnv* env,
44 const base::android::JavaParamRef<jobject>& obj, 44 const base::android::JavaParamRef<jobject>& obj,
45 const base::android::JavaParamRef<jstring>& title); 45 const base::android::JavaParamRef<jstring>& title);
46 46
47 // AddToHomescreenDataFetcher::Observer 47 // AddToHomescreenDataFetcher::Observer
48 void OnUserTitleAvailable(const base::string16& user_title) override; 48 void OnUserTitleAvailable(const base::string16& user_title) override;
49 void OnDataAvailable(const ShortcutInfo& info, const SkBitmap& icon) override; 49 void OnDataAvailable(const ShortcutInfo& info,
50 const GURL& icon_url,
51 const SkBitmap& icon) override;
50 SkBitmap FinalizeLauncherIcon(const SkBitmap& icon, 52 SkBitmap FinalizeLauncherIcon(const SkBitmap& icon,
51 const GURL& url, 53 const GURL& url,
52 bool* is_generated) override; 54 bool* is_generated) override;
53 55
54 private: 56 private:
55 virtual ~AddToHomescreenDialogHelper(); 57 virtual ~AddToHomescreenDialogHelper();
56 58
57 // Called only when the AddToHomescreenDataFetcher has retrieved all of the 59 // Called only when the AddToHomescreenDataFetcher has retrieved all of the
58 // data needed to add the shortcut. 60 // data needed to add the shortcut.
59 void AddShortcut(const ShortcutInfo& info, const SkBitmap& icon); 61 void AddShortcut(const ShortcutInfo& info,
62 const GURL& icon_url,
63 const SkBitmap& icon);
60 64
61 void RecordAddToHomescreen(); 65 void RecordAddToHomescreen();
62 66
63 // Points to the Java object. 67 // Points to the Java object.
64 base::android::ScopedJavaGlobalRef<jobject> java_ref_; 68 base::android::ScopedJavaGlobalRef<jobject> java_ref_;
65 69
66 // Whether the user has requested that a shortcut be added while a fetch was 70 // Whether the user has requested that a shortcut be added while a fetch was
67 // in progress. 71 // in progress.
68 bool add_shortcut_pending_; 72 bool add_shortcut_pending_;
69 73
70 // Fetches data required to add a shortcut. 74 // Fetches data required to add a shortcut.
71 scoped_refptr<AddToHomescreenDataFetcher> data_fetcher_; 75 scoped_refptr<AddToHomescreenDataFetcher> data_fetcher_;
72 76
73 DISALLOW_COPY_AND_ASSIGN(AddToHomescreenDialogHelper); 77 DISALLOW_COPY_AND_ASSIGN(AddToHomescreenDialogHelper);
74 }; 78 };
75 79
76 #endif // CHROME_BROWSER_ANDROID_WEBAPPS_ADD_TO_HOMESCREEN_DIALOG_HELPER_H_ 80 #endif // CHROME_BROWSER_ANDROID_WEBAPPS_ADD_TO_HOMESCREEN_DIALOG_HELPER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698