OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2017 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef CHROME_BROWSER_ANDROID_DIGITAL_ASSET_LINKS_DIGITAL_ASSET_LINKS_HANDLER_H
_ |
| 6 #define CHROME_BROWSER_ANDROID_DIGITAL_ASSET_LINKS_DIGITAL_ASSET_LINKS_HANDLER_H
_ |
| 7 |
| 8 #include "net/url_request/url_fetcher.h" |
| 9 #include "net/url_request/url_fetcher_delegate.h" |
| 10 #include "net/url_request/url_request_context_getter.h" |
| 11 |
| 12 namespace base { |
| 13 class DictionaryValue; |
| 14 } |
| 15 |
| 16 namespace digital_asset_links { |
| 17 |
| 18 extern const char kDigitalAssetLinksCheckResponseKeyLinked[]; |
| 19 |
| 20 typedef base::Callback<void(std::unique_ptr<base::DictionaryValue>)> |
| 21 RelationshipCheckResultCallback; |
| 22 |
| 23 class DigitalAssetLinksHandler : public net::URLFetcherDelegate { |
| 24 public: |
| 25 DigitalAssetLinksHandler( |
| 26 const scoped_refptr<net::URLRequestContextGetter>& request_context); |
| 27 ~DigitalAssetLinksHandler() override; |
| 28 |
| 29 bool CheckDigitalAssetLinkRelationship( |
| 30 RelationshipCheckResultCallback listener, |
| 31 const std::string& web_domain, |
| 32 const std::string& package_name, |
| 33 const std::string& fingerprint, |
| 34 const std::string& relationship); |
| 35 |
| 36 private: |
| 37 // net::URLFetcherDelegate: |
| 38 void OnURLFetchComplete(const net::URLFetcher* source) override; |
| 39 |
| 40 scoped_refptr<net::URLRequestContextGetter> request_context_; |
| 41 |
| 42 std::unique_ptr<net::URLFetcher> url_fetcher_; |
| 43 |
| 44 // The callback for receiving a URLFetcher result. |
| 45 RelationshipCheckResultCallback callback_; |
| 46 |
| 47 DISALLOW_COPY_AND_ASSIGN(DigitalAssetLinksHandler); |
| 48 }; |
| 49 |
| 50 } // namespace digital_asset_links |
| 51 |
| 52 #endif // CHROME_BROWSER_ANDROID_DIGITAL_ASSET_LINKS_DIGITAL_ASSET_LINKS_HANDLE
R_H_ |
OLD | NEW |