| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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_MANAGER_H_ | 5 #ifndef CHROME_BROWSER_ANDROID_WEBAPPS_ADD_TO_HOMESCREEN_MANAGER_H_ |
| 6 #define CHROME_BROWSER_ANDROID_WEBAPPS_ADD_TO_HOMESCREEN_MANAGER_H_ | 6 #define CHROME_BROWSER_ANDROID_WEBAPPS_ADD_TO_HOMESCREEN_MANAGER_H_ |
| 7 | 7 |
| 8 #include "base/android/jni_android.h" | 8 #include "base/android/jni_android.h" |
| 9 #include "base/android/scoped_java_ref.h" | 9 #include "base/android/scoped_java_ref.h" |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 49 | 49 |
| 50 // Shows alert to prompt user for name of home screen shortcut. | 50 // Shows alert to prompt user for name of home screen shortcut. |
| 51 void ShowDialog(); | 51 void ShowDialog(); |
| 52 | 52 |
| 53 // Called only when the AddToHomescreenDataFetcher has retrieved all of the | 53 // Called only when the AddToHomescreenDataFetcher has retrieved all of the |
| 54 // data needed to add the shortcut. | 54 // data needed to add the shortcut. |
| 55 void AddShortcut(const ShortcutInfo& info, const SkBitmap& icon); | 55 void AddShortcut(const ShortcutInfo& info, const SkBitmap& icon); |
| 56 | 56 |
| 57 // Called only when the AddToHomescreenDataFetcher has retrieved all of the | 57 // Called only when the AddToHomescreenDataFetcher has retrieved all of the |
| 58 // data needed to install a WebAPK. | 58 // data needed to install a WebAPK. |
| 59 void CreateInfoBarForWebAPK(const ShortcutInfo& info, const SkBitmap& icon); | 59 void CreateInfoBarForWebApk(const ShortcutInfo& info, const SkBitmap& icon); |
| 60 | 60 |
| 61 void RecordAddToHomescreen(); | 61 void RecordAddToHomescreen(); |
| 62 | 62 |
| 63 // AddToHomescreenDataFetcher::Observer: | 63 // AddToHomescreenDataFetcher::Observer: |
| 64 void OnDidDetermineWebApkCompatibility(bool is_webapk_compatible) override; | 64 void OnDidDetermineWebApkCompatibility(bool is_webapk_compatible) override; |
| 65 void OnUserTitleAvailable(const base::string16& user_title) override; | 65 void OnUserTitleAvailable(const base::string16& user_title) override; |
| 66 void OnDataAvailable(const ShortcutInfo& info, const SkBitmap& icon) override; | 66 void OnDataAvailable(const ShortcutInfo& info, const SkBitmap& icon) override; |
| 67 SkBitmap FinalizeLauncherIconInBackground(const SkBitmap& icon, | 67 SkBitmap FinalizeLauncherIconInBackground(const SkBitmap& icon, |
| 68 const GURL& url, | 68 const GURL& url, |
| 69 bool* is_generated) override; | 69 bool* is_generated) override; |
| 70 | 70 |
| 71 // Points to the Java object. | 71 // Points to the Java object. |
| 72 base::android::ScopedJavaGlobalRef<jobject> java_ref_; | 72 base::android::ScopedJavaGlobalRef<jobject> java_ref_; |
| 73 | 73 |
| 74 // Whether the user has requested that a shortcut be added while a fetch was | 74 // Whether the user has requested that a shortcut be added while a fetch was |
| 75 // in progress. | 75 // in progress. |
| 76 bool add_shortcut_pending_; | 76 bool add_shortcut_pending_; |
| 77 | 77 |
| 78 // Whether the site is WebAPK-compatible. | 78 // Whether the site is WebAPK-compatible. |
| 79 bool is_webapk_compatible_; | 79 bool is_webapk_compatible_; |
| 80 | 80 |
| 81 // Fetches data required to add a shortcut. | 81 // Fetches data required to add a shortcut. |
| 82 scoped_refptr<AddToHomescreenDataFetcher> data_fetcher_; | 82 scoped_refptr<AddToHomescreenDataFetcher> data_fetcher_; |
| 83 | 83 |
| 84 DISALLOW_COPY_AND_ASSIGN(AddToHomescreenManager); | 84 DISALLOW_COPY_AND_ASSIGN(AddToHomescreenManager); |
| 85 }; | 85 }; |
| 86 | 86 |
| 87 #endif // CHROME_BROWSER_ANDROID_WEBAPPS_ADD_TO_HOMESCREEN_MANAGER_H_ | 87 #endif // CHROME_BROWSER_ANDROID_WEBAPPS_ADD_TO_HOMESCREEN_MANAGER_H_ |
| OLD | NEW |