| 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); |
| 35 | 37 |
| 36 // Called by the Java counterpart to destroy its native half. | 38 // Called by the Java counterpart to destroy its native half. |
| 37 void Destroy(JNIEnv* env, jobject obj); | 39 void Destroy(JNIEnv* env, jobject obj); |
| 38 | 40 |
| 39 // Registers JNI hooks. | 41 // Registers JNI hooks. |
| 40 static bool RegisterAddToHomescreenDialogHelper(JNIEnv* env); | 42 static bool RegisterAddToHomescreenDialogHelper(JNIEnv* env); |
| 41 | 43 |
| 42 // Adds a shortcut to the current URL to the Android home screen. | 44 // Adds a shortcut to the current URL to the Android home screen. |
| 43 void AddShortcut(JNIEnv* env, jobject obj, jstring title); | 45 void AddShortcut(JNIEnv* env, jobject obj, jstring title); |
| 44 | 46 |
| (...skipping 18 matching lines...) Expand all Loading... |
| 63 // in progress. | 65 // in progress. |
| 64 bool add_shortcut_pending_; | 66 bool add_shortcut_pending_; |
| 65 | 67 |
| 66 // Fetches data required to add a shortcut. | 68 // Fetches data required to add a shortcut. |
| 67 scoped_refptr<AddToHomescreenDataFetcher> data_fetcher_; | 69 scoped_refptr<AddToHomescreenDataFetcher> data_fetcher_; |
| 68 | 70 |
| 69 DISALLOW_COPY_AND_ASSIGN(AddToHomescreenDialogHelper); | 71 DISALLOW_COPY_AND_ASSIGN(AddToHomescreenDialogHelper); |
| 70 }; | 72 }; |
| 71 | 73 |
| 72 #endif // CHROME_BROWSER_ANDROID_WEBAPPS_ADD_TO_HOMESCREEN_DIALOG_HELPER_H_ | 74 #endif // CHROME_BROWSER_ANDROID_WEBAPPS_ADD_TO_HOMESCREEN_DIALOG_HELPER_H_ |
| OLD | NEW |