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

Side by Side 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: Feedback 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CHROME_BROWSER_ANDROID_BANNERS_APP_BANNER_MANAGER_H_ 5 #ifndef CHROME_BROWSER_ANDROID_BANNERS_APP_BANNER_MANAGER_H_
6 #define CHROME_BROWSER_ANDROID_BANNERS_APP_BANNER_MANAGER_H_ 6 #define CHROME_BROWSER_ANDROID_BANNERS_APP_BANNER_MANAGER_H_
7 7
8 #include "base/android/jni_android.h" 8 #include "base/android/jni_android.h"
9 #include "base/android/jni_weak_ref.h" 9 #include "base/android/jni_weak_ref.h"
10 #include "base/memory/ref_counted.h"
10 #include "base/memory/scoped_ptr.h" 11 #include "base/memory/scoped_ptr.h"
12 #include "base/memory/weak_ptr.h"
11 #include "chrome/browser/android/banners/app_banner_infobar_delegate.h" 13 #include "chrome/browser/android/banners/app_banner_infobar_delegate.h"
12 #include "chrome/browser/bitmap_fetcher/bitmap_fetcher.h" 14 #include "chrome/browser/bitmap_fetcher/bitmap_fetcher.h"
13 #include "content/public/browser/web_contents_observer.h" 15 #include "content/public/browser/web_contents_observer.h"
14 #include "content/public/common/manifest.h" 16 #include "content/public/common/manifest.h"
15 17
16 namespace content { 18 namespace content {
17 struct FrameNavigateParams; 19 struct FrameNavigateParams;
18 struct LoadCommittedDetails; 20 struct LoadCommittedDetails;
19 struct Manifest; 21 struct Manifest;
20 } // namespace content 22 } // namespace content
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
118 120
119 // Called when the renderer has returned information about the meta tag. 121 // Called when the renderer has returned information about the meta tag.
120 // If there is some metadata for the play store tag, this kicks off the 122 // If there is some metadata for the play store tag, this kicks off the
121 // process of showing a banner for the package designated by |tag_content| on 123 // process of showing a banner for the package designated by |tag_content| on
122 // the page at the |expected_url|. 124 // the page at the |expected_url|.
123 void OnDidRetrieveMetaTagContent(bool success, 125 void OnDidRetrieveMetaTagContent(bool success,
124 const std::string& tag_name, 126 const std::string& tag_name,
125 const std::string& tag_content, 127 const std::string& tag_content,
126 const GURL& expected_url); 128 const GURL& expected_url);
127 129
130 // Called when the result of the CheckHasSameServiceWorker query has
131 // completed.
132 void OnDidCheckHasSameServiceWorker(bool has_same);
133
128 // Fetches the icon for an app. 134 // Fetches the icon for an app.
129 scoped_ptr<chrome::BitmapFetcher> fetcher_; 135 scoped_ptr<chrome::BitmapFetcher> fetcher_;
130 GURL validated_url_; 136 GURL validated_url_;
131 content::Manifest manifest_; 137 content::Manifest manifest_;
132 scoped_ptr<SkBitmap> app_icon_; 138 scoped_ptr<SkBitmap> app_icon_;
133 139
134 // AppBannerManager on the Java side. 140 // AppBannerManager on the Java side.
135 JavaObjectWeakGlobalRef weak_java_banner_view_manager_; 141 JavaObjectWeakGlobalRef weak_java_banner_view_manager_;
136 142
143 // A weak pointer is used as the lifetime of the ServiceWorkerContext is
144 // longer than the lifetime of this banner manager. The banner manager
145 // might be gone when calls sent to the ServiceWorkerContext are completed.
146 base::WeakPtrFactory<AppBannerManager> weak_factory_;
147
137 DISALLOW_COPY_AND_ASSIGN(AppBannerManager); 148 DISALLOW_COPY_AND_ASSIGN(AppBannerManager);
138 }; // class AppBannerManager 149 }; // class AppBannerManager
139 150
140 // Register native methods 151 // Register native methods
141 bool RegisterAppBannerManager(JNIEnv* env); 152 bool RegisterAppBannerManager(JNIEnv* env);
142 153
143 } // namespace banners 154 } // namespace banners
144 155
145 #endif // CHROME_BROWSER_ANDROID_BANNERS_APP_BANNER_MANAGER_H_ 156 #endif // CHROME_BROWSER_ANDROID_BANNERS_APP_BANNER_MANAGER_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/android/banners/app_banner_manager.cc » ('j') | content/public/browser/service_worker_context.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698