| Index: chrome/browser/android/banners/app_banner_manager.h
|
| diff --git a/chrome/browser/android/banners/app_banner_manager.h b/chrome/browser/android/banners/app_banner_manager.h
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..37dde39c9f6a7f052c35ac0d8860adb6af341aa9
|
| --- /dev/null
|
| +++ b/chrome/browser/android/banners/app_banner_manager.h
|
| @@ -0,0 +1,61 @@
|
| +// Copyright 2014 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_BANNERS_APP_BANNER_MANAGER_H_
|
| +#define CHROME_BROWSER_ANDROID_BANNERS_APP_BANNER_MANAGER_H_
|
| +
|
| +#include "base/android/jni_android.h"
|
| +#include "base/android/jni_helper.h"
|
| +#include "base/memory/scoped_ptr.h"
|
| +#include "chrome/browser/android/meta_tag_observer.h"
|
| +
|
| +namespace content {
|
| +struct FrameNavigateParams;
|
| +struct LoadCommittedDetails;
|
| +} // namespace content
|
| +
|
| +/**
|
| + * Manages when an app banner is created or dismissed.
|
| + *
|
| + * Hooks the wiring together for getting the data for a particular app.
|
| + * Monitors at most one package at a time, and tracks the info for the
|
| + * most recent app that was requested. Any work in progress for other apps is
|
| + * discarded.
|
| + */
|
| +class AppBannerManager : public MetaTagObserver {
|
| + public:
|
| + AppBannerManager(JNIEnv* env, jobject obj);
|
| + virtual ~AppBannerManager();
|
| +
|
| + // Destroys the AppBannerManager.
|
| + void Destroy(JNIEnv* env, jobject obj);
|
| +
|
| + // Observes a new WebContents, if necessary.
|
| + void ReplaceWebContents(JNIEnv* env,
|
| + jobject obj,
|
| + jlong native_content_view_core);
|
| +
|
| + // WebContentsObserver overrides.
|
| + virtual void DidNavigateMainFrame(
|
| + const content::LoadCommittedDetails& details,
|
| + const content::FrameNavigateParams& params) OVERRIDE;
|
| +
|
| + private:
|
| + // Kicks off the process of showing a banner for the package designated by
|
| + // |tag_content| on the page at the |expected_url|.
|
| + virtual void HandleMetaTagContent(const std::string& tag_content,
|
| + const GURL& expected_url) OVERRIDE;
|
| +
|
| + // Data about the app we're building a banner for.
|
| + GURL request_url_;
|
| + std::string request_package_;
|
| +
|
| + JavaObjectWeakGlobalRef weak_java_banner_view_manager_;
|
| + DISALLOW_COPY_AND_ASSIGN(AppBannerManager);
|
| +}; // class AppBannerManager
|
| +
|
| +// Register native methods
|
| +bool RegisterAppBannerManager(JNIEnv* env);
|
| +
|
| +#endif // CHROME_BROWSER_ANDROID_BANNERS_APP_BANNER_MANAGER_H_
|
|
|