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

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

Issue 1148163003: Allow only responsive websites to install as a web app on mobile. Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Restoring a lost nullptr check Created 5 years, 6 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
Index: chrome/browser/android/banners/app_banner_data_fetcher_android.h
diff --git a/chrome/browser/android/banners/app_banner_data_fetcher_android.h b/chrome/browser/android/banners/app_banner_data_fetcher_android.h
index e059522e634851aaf6bd37b46f20af92c478e5cf..52ef8925d59d69cc78d8d348f586771605e5e8b6 100644
--- a/chrome/browser/android/banners/app_banner_data_fetcher_android.h
+++ b/chrome/browser/android/banners/app_banner_data_fetcher_android.h
@@ -26,15 +26,32 @@ class AppBannerDataFetcherAndroid : public AppBannerDataFetcher {
base::android::ScopedJavaLocalRef<jobject> app_data,
const GURL& image_url);
+ // Avoid compiler warning about hiding a virtual function with the same name.
+ using AppBannerDataFetcher::OnMessageReceived;
+
+ // WebContentsObserver override.
+ bool OnMessageReceived(const IPC::Message& message) override;
+
protected:
~AppBannerDataFetcherAndroid() override;
std::string GetBannerType() override;
std::string GetAppIdentifier() override;
+
+ // AppBannerDataFetcher override. Queries the site's meta viewport tag to
+ // detect whether it is responsive, and proceeds by calling the base class
+ // implementation.
+ void HandleWebApp(content::WebContents* web_contents) override;
+
void ShowBanner(const SkBitmap* icon,
const base::string16& title) override;
private:
+ void OnDidRetrieveMetaTagContent(bool success,
+ const std::string& tag_name,
+ const std::string& tag_content,
+ const GURL& expected_url);
+
base::android::ScopedJavaGlobalRef<jobject> native_app_data_;
std::string native_app_package_;

Powered by Google App Engine
This is Rietveld 408576698