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