| OLD | NEW |
| 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/basictypes.h" | 10 #include "base/basictypes.h" |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 | 24 |
| 25 // AddToHomescreenDialogHelper is the C++ counterpart of | 25 // AddToHomescreenDialogHelper is the C++ counterpart of |
| 26 // org.chromium.chrome.browser's AddToHomescreenDialogHelper in Java. The object | 26 // org.chromium.chrome.browser's AddToHomescreenDialogHelper in Java. The object |
| 27 // is owned by the Java object. It is created from there via a JNI (Initialize) | 27 // is owned by the Java object. It is created from there via a JNI (Initialize) |
| 28 // call and MUST BE DESTROYED via Destroy(). | 28 // call and MUST BE DESTROYED via Destroy(). |
| 29 class AddToHomescreenDialogHelper : | 29 class AddToHomescreenDialogHelper : |
| 30 public AddToHomescreenDataFetcher::Observer { | 30 public AddToHomescreenDataFetcher::Observer { |
| 31 public: | 31 public: |
| 32 AddToHomescreenDialogHelper(JNIEnv* env, | 32 AddToHomescreenDialogHelper(JNIEnv* env, |
| 33 jobject obj, | 33 jobject obj, |
| 34 content::WebContents* web_contents, | 34 content::WebContents* web_contents); |
| 35 int ideal_splash_image_size_in_dp, | |
| 36 int ideal_icon_size_in_dp); | |
| 37 | 35 |
| 38 // Called by the Java counterpart to destroy its native half. | 36 // Called by the Java counterpart to destroy its native half. |
| 39 void Destroy(JNIEnv* env, jobject obj); | 37 void Destroy(JNIEnv* env, jobject obj); |
| 40 | 38 |
| 41 // Registers JNI hooks. | 39 // Registers JNI hooks. |
| 42 static bool RegisterAddToHomescreenDialogHelper(JNIEnv* env); | 40 static bool RegisterAddToHomescreenDialogHelper(JNIEnv* env); |
| 43 | 41 |
| 44 // 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. |
| 45 void AddShortcut(JNIEnv* env, jobject obj, jstring title); | 43 void AddShortcut(JNIEnv* env, jobject obj, jstring title); |
| 46 | 44 |
| (...skipping 18 matching lines...) Expand all Loading... |
| 65 // in progress. | 63 // in progress. |
| 66 bool add_shortcut_pending_; | 64 bool add_shortcut_pending_; |
| 67 | 65 |
| 68 // Fetches data required to add a shortcut. | 66 // Fetches data required to add a shortcut. |
| 69 scoped_refptr<AddToHomescreenDataFetcher> data_fetcher_; | 67 scoped_refptr<AddToHomescreenDataFetcher> data_fetcher_; |
| 70 | 68 |
| 71 DISALLOW_COPY_AND_ASSIGN(AddToHomescreenDialogHelper); | 69 DISALLOW_COPY_AND_ASSIGN(AddToHomescreenDialogHelper); |
| 72 }; | 70 }; |
| 73 | 71 |
| 74 #endif // CHROME_BROWSER_ANDROID_WEBAPPS_ADD_TO_HOMESCREEN_DIALOG_HELPER_H_ | 72 #endif // CHROME_BROWSER_ANDROID_WEBAPPS_ADD_TO_HOMESCREEN_DIALOG_HELPER_H_ |
| OLD | NEW |