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

Unified Diff: chrome/browser/android/customtabs/origin_verifier.h

Issue 2767333006: Add Digital Asset Links verification for postMessage API (Closed)
Patch Set: destructor Created 3 years, 8 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
« no previous file with comments | « chrome/browser/android/customtabs/OWNERS ('k') | chrome/browser/android/customtabs/origin_verifier.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/android/customtabs/origin_verifier.h
diff --git a/chrome/browser/android/customtabs/origin_verifier.h b/chrome/browser/android/customtabs/origin_verifier.h
new file mode 100644
index 0000000000000000000000000000000000000000..ae216af65179d046713bdcfd35e18c1062bf7e42
--- /dev/null
+++ b/chrome/browser/android/customtabs/origin_verifier.h
@@ -0,0 +1,54 @@
+// Copyright 2017 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_BROWSER_ANDROID_CUSTOMTABS_ORIGIN_VERIFIER_H_
+#define CHROME_BROWSER_ANDROID_CUSTOMTABS_ORIGIN_VERIFIER_H_
+
+#include "base/android/scoped_java_ref.h"
+#include "net/url_request/url_fetcher.h"
+#include "net/url_request/url_fetcher_delegate.h"
+#include "net/url_request/url_request_context_getter.h"
+
+namespace base {
+class DictionaryValue;
+}
+
+namespace digital_asset_links {
+class DigitalAssetLinksHandler;
+}
+
+namespace customtabs {
+
+// JNI bridge for OriginVerifier.java
+class OriginVerifier {
+ public:
+ OriginVerifier(JNIEnv* env, jobject obj, jobject jprofile);
+ ~OriginVerifier();
+
+ // Verify origin with the given parameters. No network requests can be made
+ // if the params are null.
+ bool VerifyOrigin(JNIEnv* env,
+ const base::android::JavaParamRef<jobject>& obj,
+ const base::android::JavaParamRef<jstring>& j_package_name,
+ const base::android::JavaParamRef<jstring>& j_fingerprint,
+ const base::android::JavaParamRef<jstring>& j_origin);
+
+ void Destroy(JNIEnv* env, const base::android::JavaRef<jobject>& obj);
+
+ private:
+ void OnRelationshipCheckComplete(
+ std::unique_ptr<base::DictionaryValue> response);
+
+ std::unique_ptr<digital_asset_links::DigitalAssetLinksHandler>
+ asset_link_handler_;
+
+ base::android::ScopedJavaGlobalRef<jobject> jobject_;
+
+ DISALLOW_COPY_AND_ASSIGN(OriginVerifier);
+};
+
+bool RegisterOriginVerifier(JNIEnv* env);
+} // namespace customtabs
+
+#endif // CHROME_BROWSER_ANDROID_CUSTOMTABS_ORIGIN_VERIFIER_H_
« no previous file with comments | « chrome/browser/android/customtabs/OWNERS ('k') | chrome/browser/android/customtabs/origin_verifier.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698