| 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_
|
|
|