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