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

Unified Diff: chrome/browser/ui/webui/webapk_info_callback.h

Issue 2629573004: Add a chrome://webapks page. (Closed)
Patch Set: Adds an about:webapks page with information about all installed Web APKs on the device Created 3 years, 11 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/webui/webapk_info_callback.h
diff --git a/chrome/browser/ui/webui/webapk_info_callback.h b/chrome/browser/ui/webui/webapk_info_callback.h
new file mode 100644
index 0000000000000000000000000000000000000000..38fce7db3c3d2017548ee2b19b59060bfab56e0e
--- /dev/null
+++ b/chrome/browser/ui/webui/webapk_info_callback.h
@@ -0,0 +1,52 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
hartmanng 2017/01/13 15:40:21 s/2016/2017/
gonzalon 2017/01/13 20:24:39 Done.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_BROWSER_UI_WEBUI_WEBAPK_INFO_CALLBACK_H_
+#define CHROME_BROWSER_UI_WEBUI_WEBAPK_INFO_CALLBACK_H_
+
+#include "base/android/jni_weak_ref.h"
+#include "base/android/scoped_java_ref.h"
+#include "base/callback.h"
+
+// A callback wrapper for fetching information regarding the Web APKs installed
hartmanng 2017/01/13 15:40:21 s/Web APKs/WebAPKs/
gonzalon 2017/01/13 20:24:39 Done.
+// on the Android device.
+class WebapkInfoCallback {
+ public:
+ explicit WebapkInfoCallback(
+ const base::RepeatingCallback<void(std::string, std::string, int, int)>&
+ callback);
+ ~WebapkInfoCallback();
+
+ // Destroys this object.
+ void Destroy(JNIEnv* env, const base::android::JavaParamRef<jobject>& obj);
+
+ // Called by Java code with information about a Web APK. It will be called
+ // once for each one installed in the device.
+ void OnWebApkFound(JNIEnv* env,
+ const base::android::JavaParamRef<jobject>& obj,
+ const base::android::JavaParamRef<jstring>& name,
+ const base::android::JavaParamRef<jstring>& package_name,
+ const jint j_shell_apk_version,
+ const jint j_version_code) const;
+
+ // The Java counterpart of this object.
+ const base::android::ScopedJavaGlobalRef<jobject>& j_webapk_info_callback()
+ const {
+ return j_webapk_info_callback_;
+ }
+
+ // JNI registration.
+ static bool Register(JNIEnv* env);
+
+ private:
+ // The wrapped native filter.
+ base::RepeatingCallback<void(std::string, std::string, int, int)> callback_;
+
+ // The Java counterpart of this C++ object.
+ base::android::ScopedJavaGlobalRef<jobject> j_webapk_info_callback_;
+
+ DISALLOW_COPY_AND_ASSIGN(WebapkInfoCallback);
+};
+
+#endif // CHROME_BROWSER_UI_WEBUI_WEBAPK_INFO_CALLBACK_H_

Powered by Google App Engine
This is Rietveld 408576698