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

Unified Diff: chrome/browser/android/banners/app_banner_manager.h

Issue 155503004: Create a skeleton AppBannerManager class (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Back and forth, forth and back Created 6 years, 10 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/banners/OWNERS ('k') | chrome/browser/android/banners/app_banner_manager.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..1218cce5ca18c0ad33f15c349b9ddf2a611e7c4c
--- /dev/null
+++ b/chrome/browser/android/banners/app_banner_manager.h
@@ -0,0 +1,58 @@
+// 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,
+ jobject jweb_contents);
+
+ // 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;
+
+ 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_
« no previous file with comments | « chrome/browser/android/banners/OWNERS ('k') | chrome/browser/android/banners/app_banner_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698