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

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

Issue 2724723002: [WebAPKs]: Reduce the parameters of ShortcutHelper::AddToLauncherWithSkBitmap() (Closed)
Patch Set: Created 3 years, 9 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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_BANNERS_APP_BANNER_MANAGER_H_ 5 #ifndef CHROME_BROWSER_BANNERS_APP_BANNER_MANAGER_H_
6 #define CHROME_BROWSER_BANNERS_APP_BANNER_MANAGER_H_ 6 #define CHROME_BROWSER_BANNERS_APP_BANNER_MANAGER_H_
7 7
8 #include <memory> 8 #include <memory>
9 #include <vector> 9 #include <vector>
10 10
11 #include "base/callback_forward.h" 11 #include "base/callback_forward.h"
dominickn 2017/03/01 02:29:40 Remove this include
12 #include "base/macros.h" 12 #include "base/macros.h"
13 #include "base/memory/weak_ptr.h" 13 #include "base/memory/weak_ptr.h"
14 #include "chrome/browser/engagement/site_engagement_observer.h" 14 #include "chrome/browser/engagement/site_engagement_observer.h"
15 #include "chrome/browser/installable/installable_logging.h" 15 #include "chrome/browser/installable/installable_logging.h"
16 #include "chrome/browser/installable/installable_manager.h" 16 #include "chrome/browser/installable/installable_manager.h"
17 #include "content/public/browser/web_contents_observer.h" 17 #include "content/public/browser/web_contents_observer.h"
18 #include "mojo/public/cpp/bindings/binding.h" 18 #include "mojo/public/cpp/bindings/binding.h"
19 #include "third_party/WebKit/public/platform/modules/app_banner/app_banner.mojom .h" 19 #include "third_party/WebKit/public/platform/modules/app_banner/app_banner.mojom .h"
20 20
21 class SkBitmap; 21 class SkBitmap;
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
87 virtual void DidFinishCreatingBookmarkApp( 87 virtual void DidFinishCreatingBookmarkApp(
88 const extensions::Extension* extension, 88 const extensions::Extension* extension,
89 const WebApplicationInfo& web_app_info) {} 89 const WebApplicationInfo& web_app_info) {}
90 90
91 // Overridden and passed through base::Bind on Android. Called when the 91 // Overridden and passed through base::Bind on Android. Called when the
92 // download of a native app's icon is complete, as native banners use an icon 92 // download of a native app's icon is complete, as native banners use an icon
93 // provided from the Play Store rather than the web manifest. Not used on 93 // provided from the Play Store rather than the web manifest. Not used on
94 // desktop platforms. 94 // desktop platforms.
95 virtual void OnAppIconFetched(const SkBitmap& bitmap) {} 95 virtual void OnAppIconFetched(const SkBitmap& bitmap) {}
96 96
97 // Overridden and passed through base::Bind on Android. Called after a web app
98 // banner was successfully used to add a web app to homescreen to kick off an
99 // asynchronous fetch of a splash screen icon. Not used on desktop platforms.
100 virtual base::Closure FetchWebappSplashScreenImageCallback(
101 const std::string& webapp_id);
102
103 protected: 97 protected:
104 explicit AppBannerManager(content::WebContents* web_contents); 98 explicit AppBannerManager(content::WebContents* web_contents);
105 ~AppBannerManager() override; 99 ~AppBannerManager() override;
106 100
107 // Returns true if the banner should be shown. Returns false if the banner has 101 // Returns true if the banner should be shown. Returns false if the banner has
108 // been shown too recently, or if the app has already been installed. 102 // been shown too recently, or if the app has already been installed.
109 // GetAppIdentifier() must return a valid value for this method to work. 103 // GetAppIdentifier() must return a valid value for this method to work.
110 bool CheckIfShouldShowBanner(); 104 bool CheckIfShouldShowBanner();
111 105
112 // Return a string identifying this app for metrics. 106 // Return a string identifying this app for metrics.
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after
284 // scoped to the WebContents which they are observing. This allows us to use 278 // scoped to the WebContents which they are observing. This allows us to use
285 // weak pointers for callbacks. 279 // weak pointers for callbacks.
286 base::WeakPtrFactory<AppBannerManager> weak_factory_; 280 base::WeakPtrFactory<AppBannerManager> weak_factory_;
287 281
288 DISALLOW_COPY_AND_ASSIGN(AppBannerManager); 282 DISALLOW_COPY_AND_ASSIGN(AppBannerManager);
289 }; 283 };
290 284
291 } // namespace banners 285 } // namespace banners
292 286
293 #endif // CHROME_BROWSER_BANNERS_APP_BANNER_MANAGER_H_ 287 #endif // CHROME_BROWSER_BANNERS_APP_BANNER_MANAGER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698