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

Side by Side Diff: chrome/browser/android/banners/app_banner_manager.h

Issue 871103004: Allow installing apps via the AppBannerInfoBar (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@pointers
Patch Set: Rebasing 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/ref_counted.h"
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
87 87
88 // Called when the Java-side has retrieved information for the app. 88 // Called when the Java-side has retrieved information for the app.
89 // Returns |false| if an icon fetch couldn't be kicked off. 89 // Returns |false| if an icon fetch couldn't be kicked off.
90 bool OnAppDetailsRetrieved(JNIEnv* env, 90 bool OnAppDetailsRetrieved(JNIEnv* env,
91 jobject obj, 91 jobject obj,
92 jobject japp_data, 92 jobject japp_data,
93 jstring japp_title, 93 jstring japp_title,
94 jstring japp_package, 94 jstring japp_package,
95 jstring jicon_url); 95 jstring jicon_url);
96 96
97 // Called when the installation Intent has been handled.
98 void OnIntentCompleted(JNIEnv* env,
99 jobject obj,
100 jboolean jis_installing);
101
102 // Called when the InstallerDelegate task has finished.
103 void OnInstallFinished(JNIEnv* env,
104 jobject obj,
105 jboolean success);
106
97 // Fetches the icon at the given URL asynchronously. 107 // Fetches the icon at the given URL asynchronously.
98 // Returns |false| if this couldn't be kicked off. 108 // Returns |false| if this couldn't be kicked off.
99 bool FetchIcon(const GURL& image_url); 109 bool FetchIcon(const GURL& image_url);
100 110
101 // Installs the app defined by the manifest. 111 // Installs the app defined by the manifest.
102 // TODO(dfalcantara): Fold into Install() when more CLs land. 112 // TODO(dfalcantara): Fold into Install() when more CLs land.
103 static void InstallManifestApp(const content::Manifest& manifest, 113 static void InstallManifestApp(const content::Manifest& manifest,
104 const SkBitmap& icon); 114 const SkBitmap& icon);
105 115
116 // Called when the AppBannerInfoBar's button needs to be updated.
117 void UpdateInstallState(JNIEnv* env, jobject obj);
118
106 // WebContentsObserver overrides. 119 // WebContentsObserver overrides.
107 void DidNavigateMainFrame( 120 void DidNavigateMainFrame(
108 const content::LoadCommittedDetails& details, 121 const content::LoadCommittedDetails& details,
109 const content::FrameNavigateParams& params) override; 122 const content::FrameNavigateParams& params) override;
110 void DidFinishLoad(content::RenderFrameHost* render_frame_host, 123 void DidFinishLoad(content::RenderFrameHost* render_frame_host,
111 const GURL& validated_url) override; 124 const GURL& validated_url) override;
112 bool OnMessageReceived(const IPC::Message& message) override; 125 bool OnMessageReceived(const IPC::Message& message) override;
113 126
114 // BitmapFetcherDelegate overrides. 127 // BitmapFetcherDelegate overrides.
115 void OnFetchComplete(const GURL url, const SkBitmap* bitmap) override; 128 void OnFetchComplete(const GURL url, const SkBitmap* bitmap) override;
116 129
117 // AppBannerInfoBarDelegate::AppDelegate overrides. 130 // AppBannerInfoBarDelegate::AppDelegate overrides.
118 void Block() const override; 131 void Block() const override;
119 bool OnButtonClicked() const override; 132 bool OnButtonClicked() const override;
133 bool OnLinkClicked() const override;
120 void OnInfoBarDestroyed() override; 134 void OnInfoBarDestroyed() override;
121 base::string16 GetTitle() const override; 135 base::string16 GetTitle() const override;
122 gfx::Image GetIcon() const override; 136 gfx::Image GetIcon() const override;
123 137
124 private: 138 private:
125 // Gets the preferred icon size for the banner icons. 139 // Gets the preferred icon size for the banner icons.
126 int GetPreferredIconSize(); 140 int GetPreferredIconSize();
127 141
128 // Called when the manifest has been retrieved, or if there is no manifest to 142 // Called when the manifest has been retrieved, or if there is no manifest to
129 // retrieve. 143 // retrieve.
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
174 188
175 DISALLOW_COPY_AND_ASSIGN(AppBannerManager); 189 DISALLOW_COPY_AND_ASSIGN(AppBannerManager);
176 }; // class AppBannerManager 190 }; // class AppBannerManager
177 191
178 // Register native methods 192 // Register native methods
179 bool RegisterAppBannerManager(JNIEnv* env); 193 bool RegisterAppBannerManager(JNIEnv* env);
180 194
181 } // namespace banners 195 } // namespace banners
182 196
183 #endif // CHROME_BROWSER_ANDROID_BANNERS_APP_BANNER_MANAGER_H_ 197 #endif // CHROME_BROWSER_ANDROID_BANNERS_APP_BANNER_MANAGER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698