| 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 std::string AppBannerInfoBarDelegateAndroid::GetIdentifier() const { |
| 166 return "AppBannerInfoBarDelegateAndroid"; |
| 167 } |
| 168 |
| 165 gfx::Image AppBannerInfoBarDelegateAndroid::GetIcon() const { | 169 gfx::Image AppBannerInfoBarDelegateAndroid::GetIcon() const { |
| 166 return gfx::Image::CreateFrom1xBitmap(*app_icon_.get()); | 170 return gfx::Image::CreateFrom1xBitmap(*app_icon_.get()); |
| 167 } | 171 } |
| 168 | 172 |
| 169 void AppBannerInfoBarDelegateAndroid::InfoBarDismissed() { | 173 void AppBannerInfoBarDelegateAndroid::InfoBarDismissed() { |
| 170 has_user_interaction_ = true; | 174 has_user_interaction_ = true; |
| 171 | 175 |
| 172 content::WebContents* web_contents = | 176 content::WebContents* web_contents = |
| 173 InfoBarService::WebContentsFromInfoBar(infobar()); | 177 InfoBarService::WebContentsFromInfoBar(infobar()); |
| 174 if (!web_contents) | 178 if (!web_contents) |
| (...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 287 | 291 |
| 288 TrackDismissEvent(DISMISS_EVENT_BANNER_CLICK); | 292 TrackDismissEvent(DISMISS_EVENT_BANNER_CLICK); |
| 289 return true; | 293 return true; |
| 290 } | 294 } |
| 291 | 295 |
| 292 bool RegisterAppBannerInfoBarDelegateAndroid(JNIEnv* env) { | 296 bool RegisterAppBannerInfoBarDelegateAndroid(JNIEnv* env) { |
| 293 return RegisterNativesImpl(env); | 297 return RegisterNativesImpl(env); |
| 294 } | 298 } |
| 295 | 299 |
| 296 } // namespace banners | 300 } // namespace banners |
| OLD | NEW |