OLD | NEW |
| (Empty) |
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 | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef CHROME_BROWSER_BANNERS_APP_BANNER_DATA_FETCHER_DESKTOP_H_ | |
6 #define CHROME_BROWSER_BANNERS_APP_BANNER_DATA_FETCHER_DESKTOP_H_ | |
7 | |
8 #include "base/macros.h" | |
9 #include "chrome/browser/banners/app_banner_data_fetcher.h" | |
10 | |
11 namespace extensions { | |
12 class BookmarkAppHelper; | |
13 class Extension; | |
14 } // namespace extensions | |
15 | |
16 namespace banners { | |
17 | |
18 // Fetches data required to show a banner for the URL currently shown by the | |
19 // WebContents. Extends the regular fetch to support desktop web apps. | |
20 class AppBannerDataFetcherDesktop : public AppBannerDataFetcher { | |
21 public: | |
22 AppBannerDataFetcherDesktop(content::WebContents* web_contents, | |
23 base::WeakPtr<Delegate> weak_delegate, | |
24 int ideal_icon_size_in_dp, | |
25 int minimum_icon_size_in_dp, | |
26 bool is_debug_mode); | |
27 | |
28 // Callback for finishing bookmark app creation | |
29 void FinishCreateBookmarkApp(const extensions::Extension* extension, | |
30 const WebApplicationInfo& web_app_info); | |
31 | |
32 protected: | |
33 ~AppBannerDataFetcherDesktop() override; | |
34 | |
35 private: | |
36 // AppBannerDataFetcher override. | |
37 bool IsWebAppInstalled(content::BrowserContext* browser_context, | |
38 const GURL& start_url) override; | |
39 | |
40 // AppBannerDataFetcher override. | |
41 void ShowBanner(const GURL& icon_url, | |
42 const SkBitmap* icon, | |
43 const base::string16& title, | |
44 const std::string& referrer) override; | |
45 | |
46 std::unique_ptr<extensions::BookmarkAppHelper> bookmark_app_helper_; | |
47 | |
48 DISALLOW_COPY_AND_ASSIGN(AppBannerDataFetcherDesktop); | |
49 }; | |
50 | |
51 } // namespace banners | |
52 | |
53 #endif // CHROME_BROWSER_BANNERS_APP_BANNER_DATA_FETCHER_DESKTOP_H_ | |
OLD | NEW |