| 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_infobar_delegate_desktop.h" | 5 #include "chrome/browser/banners/app_banner_infobar_delegate_desktop.h" |
| 6 | 6 |
| 7 #include "chrome/browser/banners/app_banner_data_fetcher_desktop.h" | 7 #include "chrome/browser/banners/app_banner_data_fetcher_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 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 86 TrackUserResponse(USER_RESPONSE_WEB_APP_ACCEPTED); | 86 TrackUserResponse(USER_RESPONSE_WEB_APP_ACCEPTED); |
| 87 has_user_interaction_ = true; | 87 has_user_interaction_ = true; |
| 88 | 88 |
| 89 bookmark_app_helper_->CreateFromAppBanner( | 89 bookmark_app_helper_->CreateFromAppBanner( |
| 90 base::Bind(&AppBannerDataFetcherDesktop::FinishCreateBookmarkApp, | 90 base::Bind(&AppBannerDataFetcherDesktop::FinishCreateBookmarkApp, |
| 91 fetcher_), | 91 fetcher_), |
| 92 web_manifest_); | 92 web_manifest_); |
| 93 return true; | 93 return true; |
| 94 } | 94 } |
| 95 | 95 |
| 96 std::string AppBannerInfoBarDelegateDesktop::GetIdentifier() const { |
| 97 return "AppBannerInfoBarDelegateDesktop"; |
| 98 } |
| 99 |
| 96 void AppBannerInfoBarDelegateDesktop::InfoBarDismissed() { | 100 void AppBannerInfoBarDelegateDesktop::InfoBarDismissed() { |
| 97 TrackUserResponse(USER_RESPONSE_WEB_APP_DISMISSED); | 101 TrackUserResponse(USER_RESPONSE_WEB_APP_DISMISSED); |
| 98 has_user_interaction_ = true; | 102 has_user_interaction_ = true; |
| 99 | 103 |
| 100 content::WebContents* web_contents = | 104 content::WebContents* web_contents = |
| 101 InfoBarService::WebContentsFromInfoBar(infobar()); | 105 InfoBarService::WebContentsFromInfoBar(infobar()); |
| 102 if (web_contents) { | 106 if (web_contents) { |
| 103 fetcher_.get()->Cancel(); | 107 fetcher_.get()->Cancel(); |
| 104 | 108 |
| 105 web_contents->GetMainFrame()->Send( | 109 web_contents->GetMainFrame()->Send( |
| 106 new ChromeViewMsg_AppBannerDismissed( | 110 new ChromeViewMsg_AppBannerDismissed( |
| 107 web_contents->GetMainFrame()->GetRoutingID(), | 111 web_contents->GetMainFrame()->GetRoutingID(), |
| 108 event_request_id_)); | 112 event_request_id_)); |
| 109 | 113 |
| 110 AppBannerSettingsHelper::RecordBannerDismissEvent( | 114 AppBannerSettingsHelper::RecordBannerDismissEvent( |
| 111 web_contents, web_manifest_.start_url.spec(), | 115 web_contents, web_manifest_.start_url.spec(), |
| 112 AppBannerSettingsHelper::WEB); | 116 AppBannerSettingsHelper::WEB); |
| 113 } | 117 } |
| 114 } | 118 } |
| 115 | 119 |
| 116 } // namespace banners | 120 } // namespace banners |
| OLD | NEW |