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

Side by Side Diff: chrome/browser/android/webapps/add_to_homescreen_manager.h

Issue 2290603005: Trigger app banner when add to homescreen is pressed and WebAPKs are enabled. (Closed)
Patch Set: Created 4 years, 3 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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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_WEBAPPS_ADD_TO_HOMESCREEN_MANAGER_H_ 5 #ifndef CHROME_BROWSER_ANDROID_WEBAPPS_ADD_TO_HOMESCREEN_MANAGER_H_
6 #define CHROME_BROWSER_ANDROID_WEBAPPS_ADD_TO_HOMESCREEN_MANAGER_H_ 6 #define CHROME_BROWSER_ANDROID_WEBAPPS_ADD_TO_HOMESCREEN_MANAGER_H_
7 7
8 #include "base/android/jni_android.h" 8 #include "base/android/jni_android.h"
9 #include "base/android/scoped_java_ref.h" 9 #include "base/android/scoped_java_ref.h"
10 #include "base/macros.h" 10 #include "base/macros.h"
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
67 void ShowDialog(); 67 void ShowDialog();
68 68
69 // Starts fetching home screen shortcut data (like Web Manifest and home 69 // Starts fetching home screen shortcut data (like Web Manifest and home
70 // screen icon). 70 // screen icon).
71 void StartFetchingInfoForShortcut(content::WebContents* web_contents); 71 void StartFetchingInfoForShortcut(content::WebContents* web_contents);
72 72
73 // Called only when the AddToHomescreenDataFetcher has retrieved all of the 73 // Called only when the AddToHomescreenDataFetcher has retrieved all of the
74 // data needed to add the shortcut. 74 // data needed to add the shortcut.
75 void AddShortcut(const ShortcutInfo& info, const SkBitmap& icon); 75 void AddShortcut(const ShortcutInfo& info, const SkBitmap& icon);
76 76
77 // Called only when the AddToHomescreenDataFetcher has retrieved all of the
78 // data needed to install a WebAPK.
79 void CreateInfobar(const ShortcutInfo& info, const SkBitmap& icon);
gone 2016/08/31 18:12:46 CreateInfoBarForWebAPK()
Xi Han 2016/08/31 20:11:48 Done.
80
77 void RecordAddToHomescreen(); 81 void RecordAddToHomescreen();
78 82
79 // AddToHomescreenDataFetcher::Observer: 83 // AddToHomescreenDataFetcher::Observer:
80 void OnUserTitleAvailable(const base::string16& user_title) override; 84 void OnUserTitleAvailable(const base::string16& user_title) override;
81 void OnDataAvailable(const ShortcutInfo& info, const SkBitmap& icon) override; 85 void OnDataAvailable(const ShortcutInfo& info, const SkBitmap& icon) override;
82 SkBitmap FinalizeLauncherIconInBackground(const SkBitmap& icon, 86 SkBitmap FinalizeLauncherIconInBackground(const SkBitmap& icon,
83 const GURL& url, 87 const GURL& url,
84 bool* is_generated) override; 88 bool* is_generated) override;
85 89
86 // Points to the Java object. 90 // Points to the Java object.
87 base::android::ScopedJavaGlobalRef<jobject> java_ref_; 91 base::android::ScopedJavaGlobalRef<jobject> java_ref_;
88 92
89 // Whether the user has requested that a shortcut be added while a fetch was 93 // Whether the user has requested that a shortcut be added while a fetch was
90 // in progress. 94 // in progress.
91 bool add_shortcut_pending_; 95 bool add_shortcut_pending_;
92 96
97 // Whether the site is WebAPK-compatible.
98 bool is_compatible_;
gone 2016/08/31 18:12:45 make the variable name explicitly is_webapk_compat
Xi Han 2016/08/31 20:11:48 Done.
99
93 // Fetches data required to add a shortcut. 100 // Fetches data required to add a shortcut.
94 scoped_refptr<AddToHomescreenDataFetcher> data_fetcher_; 101 scoped_refptr<AddToHomescreenDataFetcher> data_fetcher_;
95 102
96 base::WeakPtrFactory<AddToHomescreenManager> weak_ptr_factory_; 103 base::WeakPtrFactory<AddToHomescreenManager> weak_ptr_factory_;
97 104
98 DISALLOW_COPY_AND_ASSIGN(AddToHomescreenManager); 105 DISALLOW_COPY_AND_ASSIGN(AddToHomescreenManager);
99 }; 106 };
100 107
101 #endif // CHROME_BROWSER_ANDROID_WEBAPPS_ADD_TO_HOMESCREEN_MANAGER_H_ 108 #endif // CHROME_BROWSER_ANDROID_WEBAPPS_ADD_TO_HOMESCREEN_MANAGER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698