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

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

Issue 893793005: Check if there is a SW controlling the start page for app banner. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 5 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 | « no previous file | 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
index c65d1479a5e62c29b3fe2019f5a223e7cdda43ec..a225ea8a4e29d2f7e0a3adb4f2517ab22bb799f8 100644
--- a/chrome/browser/android/banners/app_banner_manager.h
+++ b/chrome/browser/android/banners/app_banner_manager.h
@@ -7,7 +7,9 @@
#include "base/android/jni_android.h"
#include "base/android/jni_weak_ref.h"
+#include "base/memory/ref_counted.h"
#include "base/memory/scoped_ptr.h"
+#include "base/memory/weak_ptr.h"
#include "chrome/browser/android/banners/app_banner_infobar_delegate.h"
#include "chrome/browser/bitmap_fetcher/bitmap_fetcher.h"
#include "content/public/browser/web_contents_observer.h"
@@ -109,6 +111,8 @@ class AppBannerManager : public chrome::BitmapFetcherDelegate,
virtual gfx::Image GetIcon() const override;
private:
+ class IOThreadHandler;
+
// Gets the preferred icon size for the banner icons.
int GetPreferredIconSize();
@@ -125,6 +129,10 @@ class AppBannerManager : public chrome::BitmapFetcherDelegate,
const std::string& tag_content,
const GURL& expected_url);
+ // Called when the result of the CheckHasSameServiceWorker query has
+ // completed.
+ void OnDidCheckHasSameServiceWorker(bool has_same);
+
// Fetches the icon for an app.
scoped_ptr<chrome::BitmapFetcher> fetcher_;
GURL validated_url_;
@@ -134,6 +142,15 @@ class AppBannerManager : public chrome::BitmapFetcherDelegate,
// AppBannerManager on the Java side.
JavaObjectWeakGlobalRef weak_java_banner_view_manager_;
+ // Object to handle responses that are returned on the IO thread.
+ scoped_refptr<IOThreadHandler> io_thread_handler_;
+
+ // A weak pointer is used as the lifetime of the ServiceWorkerContext is
+ // longer than the lifetime of this banner manager. The banner manager
+ // may be destroyed when calls sent to the ServiceWorkerContext are
+ // completed.
gone 2015/02/04 17:28:01 What does "may" mean in this context? Might be des
benwells 2015/02/04 17:35:36 It means 'might'. The ServiceWorkerContext is owne
gone 2015/02/04 17:40:10 Ah, alright. As long as the ownership is being tra
+ base::WeakPtrFactory<AppBannerManager> weak_factory_;
+
DISALLOW_COPY_AND_ASSIGN(AppBannerManager);
}; // class AppBannerManager
« no previous file with comments | « no previous file | chrome/browser/android/banners/app_banner_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698