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/android/banners/app_banner_infobar_delegate_android.h" | 5 #include "chrome/browser/android/banners/app_banner_infobar_delegate_android.h" |
6 | 6 |
7 #include "base/android/jni_android.h" | 7 #include "base/android/jni_android.h" |
8 #include "base/android/jni_string.h" | 8 #include "base/android/jni_string.h" |
9 #include "base/guid.h" | 9 #include "base/guid.h" |
10 #include "base/location.h" | 10 #include "base/location.h" |
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
155 void AppBannerInfoBarDelegateAndroid::SendBannerAccepted( | 155 void AppBannerInfoBarDelegateAndroid::SendBannerAccepted( |
156 content::WebContents* web_contents, | 156 content::WebContents* web_contents, |
157 const std::string& platform) { | 157 const std::string& platform) { |
158 web_contents->GetMainFrame()->Send( | 158 web_contents->GetMainFrame()->Send( |
159 new ChromeViewMsg_AppBannerAccepted( | 159 new ChromeViewMsg_AppBannerAccepted( |
160 web_contents->GetMainFrame()->GetRoutingID(), | 160 web_contents->GetMainFrame()->GetRoutingID(), |
161 event_request_id_, | 161 event_request_id_, |
162 platform)); | 162 platform)); |
163 } | 163 } |
164 | 164 |
| 165 infobars::InfoBarDelegate::InfoBarIdentifier |
| 166 AppBannerInfoBarDelegateAndroid::GetIdentifier() const { |
| 167 return APP_BANNER_INFOBAR_DELEGATE_ANDROID; |
| 168 } |
| 169 |
165 gfx::Image AppBannerInfoBarDelegateAndroid::GetIcon() const { | 170 gfx::Image AppBannerInfoBarDelegateAndroid::GetIcon() const { |
166 return gfx::Image::CreateFrom1xBitmap(*app_icon_.get()); | 171 return gfx::Image::CreateFrom1xBitmap(*app_icon_.get()); |
167 } | 172 } |
168 | 173 |
169 void AppBannerInfoBarDelegateAndroid::InfoBarDismissed() { | 174 void AppBannerInfoBarDelegateAndroid::InfoBarDismissed() { |
170 has_user_interaction_ = true; | 175 has_user_interaction_ = true; |
171 | 176 |
172 content::WebContents* web_contents = | 177 content::WebContents* web_contents = |
173 InfoBarService::WebContentsFromInfoBar(infobar()); | 178 InfoBarService::WebContentsFromInfoBar(infobar()); |
174 if (!web_contents) | 179 if (!web_contents) |
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
287 | 292 |
288 TrackDismissEvent(DISMISS_EVENT_BANNER_CLICK); | 293 TrackDismissEvent(DISMISS_EVENT_BANNER_CLICK); |
289 return true; | 294 return true; |
290 } | 295 } |
291 | 296 |
292 bool RegisterAppBannerInfoBarDelegateAndroid(JNIEnv* env) { | 297 bool RegisterAppBannerInfoBarDelegateAndroid(JNIEnv* env) { |
293 return RegisterNativesImpl(env); | 298 return RegisterNativesImpl(env); |
294 } | 299 } |
295 | 300 |
296 } // namespace banners | 301 } // namespace banners |
OLD | NEW |