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

Side by Side Diff: chrome/browser/android/webapk/webapk_installer.h

Issue 2746723002: [WebAPK] Refactor "unsigned sources" installation path (Closed)
Patch Set: Merge branch 'start0' into start Created 3 years, 9 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 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_WEBAPK_WEBAPK_INSTALLER_H_ 5 #ifndef CHROME_BROWSER_ANDROID_WEBAPK_WEBAPK_INSTALLER_H_
6 #define CHROME_BROWSER_ANDROID_WEBAPK_WEBAPK_INSTALLER_H_ 6 #define CHROME_BROWSER_ANDROID_WEBAPK_WEBAPK_INSTALLER_H_
7 7
8 #include <jni.h> 8 #include <jni.h>
9 #include <map> 9 #include <map>
10 #include <memory> 10 #include <memory>
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
103 bool is_manifest_stale); 103 bool is_manifest_stale);
104 104
105 // Registers JNI hooks. 105 // Registers JNI hooks.
106 static bool Register(JNIEnv* env); 106 static bool Register(JNIEnv* env);
107 107
108 protected: 108 protected:
109 WebApkInstaller(content::BrowserContext* browser_context, 109 WebApkInstaller(content::BrowserContext* browser_context,
110 const ShortcutInfo& shortcut_info, 110 const ShortcutInfo& shortcut_info,
111 const SkBitmap& shortcut_icon); 111 const SkBitmap& shortcut_icon);
112 112
113 // Starts installation of the downloaded WebAPK. Returns whether the install 113 // Starts installion of the downloaded WebAPK.
114 // could be started. The installation may still fail if true is returned.
115 // |file_path| is the file path that the WebAPK was downloaded to. 114 // |file_path| is the file path that the WebAPK was downloaded to.
116 // |package_name| is the package name that the WebAPK should be installed at. 115 // |package_name| is the package name of the WebAPK.
117 virtual bool StartInstallingDownloadedWebApk( 116 virtual void InstallDownloadedWebApk(
118 JNIEnv* env, 117 JNIEnv* env,
119 const base::android::ScopedJavaLocalRef<jstring>& java_file_path, 118 const base::android::ScopedJavaLocalRef<jstring>& java_file_path,
120 const base::android::ScopedJavaLocalRef<jstring>& java_package_name); 119 const base::android::ScopedJavaLocalRef<jstring>& java_package_name);
121 120
122 // Starts update using the downloaded WebAPK. Returns whether the updating 121 // Starts update using the downloaded WebAPK.
123 // could be started. The updating may still fail if true is returned.
124 // |file_path| is the file path that the WebAPK was downloaded to. 122 // |file_path| is the file path that the WebAPK was downloaded to.
125 virtual bool StartUpdateUsingDownloadedWebApk( 123 virtual void UpdateUsingDownloadedWebApk(
126 JNIEnv* env, 124 JNIEnv* env,
127 const base::android::ScopedJavaLocalRef<jstring>& java_file_path); 125 const base::android::ScopedJavaLocalRef<jstring>& java_file_path);
128 126
129 // Returns whether Google Play Services can be used and the install delegate 127 // Returns whether Google Play Services can be used and the install delegate
130 // is available. 128 // is available.
131 // Note: it is possible that this delegate is null even when installing 129 // Note: it is possible that this delegate is null even when installing
132 // WebAPKs using Google Play is enabled. 130 // WebAPKs using Google Play is enabled.
133 virtual bool CanUseGooglePlayInstallService(); 131 virtual bool CanUseGooglePlayInstallService();
134 132
135 // Called when the package name of the WebAPK is available and the install 133 // Called when the package name of the WebAPK is available and the install
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after
284 // Points to the Java Object. 282 // Points to the Java Object.
285 base::android::ScopedJavaGlobalRef<jobject> java_ref_; 283 base::android::ScopedJavaGlobalRef<jobject> java_ref_;
286 284
287 // Used to get |weak_ptr_|. 285 // Used to get |weak_ptr_|.
288 base::WeakPtrFactory<WebApkInstaller> weak_ptr_factory_; 286 base::WeakPtrFactory<WebApkInstaller> weak_ptr_factory_;
289 287
290 DISALLOW_COPY_AND_ASSIGN(WebApkInstaller); 288 DISALLOW_COPY_AND_ASSIGN(WebApkInstaller);
291 }; 289 };
292 290
293 #endif // CHROME_BROWSER_ANDROID_WEBAPK_WEBAPK_INSTALLER_H_ 291 #endif // CHROME_BROWSER_ANDROID_WEBAPK_WEBAPK_INSTALLER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698