| 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 #include "chrome/browser/banners/app_banner_data_fetcher_desktop.h" | 5 #include "chrome/browser/banners/app_banner_data_fetcher_desktop.h" |
| 6 | 6 |
| 7 #include "chrome/browser/banners/app_banner_infobar_delegate_desktop.h" | 7 #include "chrome/browser/banners/app_banner_infobar_delegate_desktop.h" |
| 8 #include "chrome/browser/banners/app_banner_metrics.h" | 8 #include "chrome/browser/banners/app_banner_metrics.h" |
| 9 #include "chrome/browser/banners/app_banner_settings_helper.h" | 9 #include "chrome/browser/banners/app_banner_settings_helper.h" |
| 10 #include "chrome/browser/extensions/bookmark_app_helper.h" | 10 #include "chrome/browser/extensions/bookmark_app_helper.h" |
| (...skipping 23 matching lines...) Expand all Loading... |
| 34 AppBannerDataFetcherDesktop::~AppBannerDataFetcherDesktop() { | 34 AppBannerDataFetcherDesktop::~AppBannerDataFetcherDesktop() { |
| 35 } | 35 } |
| 36 | 36 |
| 37 bool AppBannerDataFetcherDesktop::IsWebAppInstalled( | 37 bool AppBannerDataFetcherDesktop::IsWebAppInstalled( |
| 38 content::BrowserContext* browser_context, | 38 content::BrowserContext* browser_context, |
| 39 const GURL& start_url) { | 39 const GURL& start_url) { |
| 40 return extensions::BookmarkAppHelper::BookmarkOrHostedAppInstalled( | 40 return extensions::BookmarkAppHelper::BookmarkOrHostedAppInstalled( |
| 41 browser_context, start_url); | 41 browser_context, start_url); |
| 42 } | 42 } |
| 43 | 43 |
| 44 void AppBannerDataFetcherDesktop::ShowBanner(const SkBitmap* icon, | 44 void AppBannerDataFetcherDesktop::ShowBanner(const GURL& icon_url, |
| 45 const SkBitmap* icon, |
| 45 const base::string16& title, | 46 const base::string16& title, |
| 46 const std::string& referrer) { | 47 const std::string& referrer) { |
| 47 content::WebContents* web_contents = GetWebContents(); | 48 content::WebContents* web_contents = GetWebContents(); |
| 48 DCHECK(web_contents && !web_app_data().IsEmpty()); | 49 DCHECK(web_contents && !web_app_data().IsEmpty()); |
| 49 | 50 |
| 50 Profile* profile = | 51 Profile* profile = |
| 51 Profile::FromBrowserContext(web_contents->GetBrowserContext()); | 52 Profile::FromBrowserContext(web_contents->GetBrowserContext()); |
| 52 WebApplicationInfo web_app_info; | 53 WebApplicationInfo web_app_info; |
| 53 | 54 |
| 54 bookmark_app_helper_.reset( | 55 bookmark_app_helper_.reset( |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 90 event_request_id(), "web")); | 91 event_request_id(), "web")); |
| 91 | 92 |
| 92 AppBannerSettingsHelper::RecordBannerInstallEvent( | 93 AppBannerSettingsHelper::RecordBannerInstallEvent( |
| 93 web_contents, web_app_data().start_url.spec(), | 94 web_contents, web_app_data().start_url.spec(), |
| 94 AppBannerSettingsHelper::WEB); | 95 AppBannerSettingsHelper::WEB); |
| 95 } | 96 } |
| 96 } | 97 } |
| 97 } | 98 } |
| 98 | 99 |
| 99 } // namespace banners | 100 } // namespace banners |
| OLD | NEW |