| Index: chrome/browser/android/webapk/manifest_upgrade_detector_fetcher.h
|
| diff --git a/chrome/browser/android/webapk/manifest_upgrade_detector.h b/chrome/browser/android/webapk/manifest_upgrade_detector_fetcher.h
|
| similarity index 62%
|
| rename from chrome/browser/android/webapk/manifest_upgrade_detector.h
|
| rename to chrome/browser/android/webapk/manifest_upgrade_detector_fetcher.h
|
| index 96db2e995f1792405b50d880b82898df591327b5..d1f66c2ee586ed3b104315a92d8cf0d06dc5c42e 100644
|
| --- a/chrome/browser/android/webapk/manifest_upgrade_detector.h
|
| +++ b/chrome/browser/android/webapk/manifest_upgrade_detector_fetcher.h
|
| @@ -2,12 +2,11 @@
|
| // Use of this source code is governed by a BSD-style license that can be
|
| // found in the LICENSE file.
|
|
|
| -#ifndef CHROME_BROWSER_ANDROID_WEBAPK_MANIFEST_UPGRADE_DETECTOR_H_
|
| -#define CHROME_BROWSER_ANDROID_WEBAPK_MANIFEST_UPGRADE_DETECTOR_H_
|
| +#ifndef CHROME_BROWSER_ANDROID_WEBAPK_MANIFEST_UPGRADE_DETECTOR_FETCHER_H_
|
| +#define CHROME_BROWSER_ANDROID_WEBAPK_MANIFEST_UPGRADE_DETECTOR_FETCHER_H_
|
|
|
| #include "base/android/jni_android.h"
|
| #include "base/android/jni_weak_ref.h"
|
| -#include "base/gtest_prod_util.h"
|
| #include "base/macros.h"
|
| #include "base/memory/weak_ptr.h"
|
| #include "content/public/browser/web_contents_observer.h"
|
| @@ -20,36 +19,35 @@ class WebContents;
|
| class GURL;
|
| struct ShortcutInfo;
|
|
|
| -// ManifestUpgradeDetector is the C++ counterpart of
|
| -// org.chromium.chrome.browser's ManifestUpgradeDetector in Java. It is created
|
| -// via a JNI (Initialize) call and MUST BE DESTROYED via Destroy().
|
| -class ManifestUpgradeDetector : public content::WebContentsObserver {
|
| +// ManifestUpgradeDetectorFetcher is the C++ counterpart of
|
| +// org.chromium.chrome.browser's ManifestUpgradeDetectorFetcher in Java. It is
|
| +// created via a JNI (Initialize) call and MUST BE DESTROYED via Destroy().
|
| +class ManifestUpgradeDetectorFetcher : public content::WebContentsObserver {
|
| public:
|
| - ManifestUpgradeDetector(JNIEnv* env,
|
| - jobject obj,
|
| - content::WebContents* web_contents,
|
| - const GURL& scope,
|
| - const GURL& web_manifest_url);
|
| + ManifestUpgradeDetectorFetcher(JNIEnv* env,
|
| + jobject obj,
|
| + const GURL& scope,
|
| + const GURL& web_manifest_url);
|
|
|
| // Replaces the WebContents that is being observed.
|
| void ReplaceWebContents(
|
| JNIEnv* env,
|
| const base::android::JavaParamRef<jobject>& obj,
|
| - const base::android::JavaParamRef<jobject>& jweb_contents);
|
| + const base::android::JavaParamRef<jobject>& java_web_contents);
|
|
|
| // Called by the Java counterpart to destroy its native half.
|
| void Destroy(JNIEnv* env, const base::android::JavaParamRef<jobject>& obj);
|
|
|
| // Called by the Java counterpart to start checking web manifest changes.
|
| - void Start(JNIEnv* env, const base::android::JavaParamRef<jobject>& obj);
|
| + void Start(JNIEnv* env,
|
| + const base::android::JavaParamRef<jobject>& obj,
|
| + const base::android::JavaParamRef<jobject>& java_web_contents);
|
|
|
| // Registers JNI hooks.
|
| static bool Register(JNIEnv* env);
|
|
|
| private:
|
| - FRIEND_TEST_ALL_PREFIXES(ManifestUpgradeDetectorTest,
|
| - OnDidGetManifestReturnsFalseWhenTheFetchedManifestUrlIsEmpty);
|
| - ~ManifestUpgradeDetector() override;
|
| + ~ManifestUpgradeDetectorFetcher() override;
|
|
|
| // content::WebContentsObserver:
|
| void DidFinishLoad(content::RenderFrameHost* render_frame_host,
|
| @@ -64,18 +62,15 @@ class ManifestUpgradeDetector : public content::WebContentsObserver {
|
| // Points to the Java object.
|
| base::android::ScopedJavaGlobalRef<jobject> java_ref_;
|
|
|
| - // A flag to indicate if the detection pipeline was started.
|
| - bool started_;
|
| -
|
| // The detector will only fetch the URL within the scope of the WebAPK.
|
| const GURL scope_;
|
|
|
| // The WebAPK's Web Manifest URL that the detector is looking for.
|
| const GURL web_manifest_url_;
|
|
|
| - base::WeakPtrFactory<ManifestUpgradeDetector> weak_ptr_factory_;
|
| + base::WeakPtrFactory<ManifestUpgradeDetectorFetcher> weak_ptr_factory_;
|
|
|
| - DISALLOW_COPY_AND_ASSIGN(ManifestUpgradeDetector);
|
| + DISALLOW_COPY_AND_ASSIGN(ManifestUpgradeDetectorFetcher);
|
| };
|
|
|
| -#endif // CHROME_BROWSER_ANDROID_WEBAPK_MANIFEST_UPGRADE_DETECTOR_H_
|
| +#endif // CHROME_BROWSER_ANDROID_WEBAPK_MANIFEST_UPGRADE_DETECTOR_FETCHER_H_
|
|
|