Chromium Code Reviews| 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 253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 264 DCHECK(!native_app_data_.is_null()); | 264 DCHECK(!native_app_data_.is_null()); |
| 265 CreateJavaDelegate(); | 265 CreateJavaDelegate(); |
| 266 } | 266 } |
| 267 | 267 |
| 268 void AppBannerInfoBarDelegateAndroid::CreateJavaDelegate() { | 268 void AppBannerInfoBarDelegateAndroid::CreateJavaDelegate() { |
| 269 java_delegate_.Reset(Java_AppBannerInfoBarDelegateAndroid_create( | 269 java_delegate_.Reset(Java_AppBannerInfoBarDelegateAndroid_create( |
| 270 base::android::AttachCurrentThread(), | 270 base::android::AttachCurrentThread(), |
| 271 reinterpret_cast<intptr_t>(this))); | 271 reinterpret_cast<intptr_t>(this))); |
| 272 } | 272 } |
| 273 | 273 |
| 274 void AppBannerInfoBarDelegateAndroid::SendBannerAccepted( | 274 void AppBannerInfoBarDelegateAndroid::SendBannerAccepted( |
|
dominickn
2016/10/12 22:35:09
What about AppBannerInfoBarDelegateDesktop? Should
Matt Giuca
2016/12/09 04:36:48
I think desktop support for this can go in another
| |
| 275 content::WebContents* web_contents, | 275 content::WebContents* web_contents, |
| 276 const std::string& platform) { | 276 const std::string& platform) { |
| 277 web_contents->GetMainFrame()->Send( | 277 web_contents->GetMainFrame()->Send( |
| 278 new ChromeViewMsg_AppBannerAccepted( | 278 new ChromeViewMsg_AppBannerAccepted( |
| 279 web_contents->GetMainFrame()->GetRoutingID(), | 279 web_contents->GetMainFrame()->GetRoutingID(), |
| 280 event_request_id_, | 280 event_request_id_, |
| 281 platform)); | 281 platform)); |
| 282 if (weak_manager_) | |
| 283 weak_manager_->OnInstall(); | |
|
dominickn
2016/10/12 22:35:09
We're already sending a message to the renderer he
Matt Giuca
2016/12/09 04:36:48
Hmmm yeah your CL did make this easier but it's st
| |
| 282 } | 284 } |
| 283 | 285 |
| 284 infobars::InfoBarDelegate::InfoBarIdentifier | 286 infobars::InfoBarDelegate::InfoBarIdentifier |
| 285 AppBannerInfoBarDelegateAndroid::GetIdentifier() const { | 287 AppBannerInfoBarDelegateAndroid::GetIdentifier() const { |
| 286 return APP_BANNER_INFOBAR_DELEGATE_ANDROID; | 288 return APP_BANNER_INFOBAR_DELEGATE_ANDROID; |
| 287 } | 289 } |
| 288 | 290 |
| 289 gfx::Image AppBannerInfoBarDelegateAndroid::GetIcon() const { | 291 gfx::Image AppBannerInfoBarDelegateAndroid::GetIcon() const { |
| 290 return gfx::Image::CreateFrom1xBitmap(*icon_.get()); | 292 return gfx::Image::CreateFrom1xBitmap(*icon_.get()); |
| 291 } | 293 } |
| (...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 441 | 443 |
| 442 TrackDismissEvent(DISMISS_EVENT_BANNER_CLICK); | 444 TrackDismissEvent(DISMISS_EVENT_BANNER_CLICK); |
| 443 return true; | 445 return true; |
| 444 } | 446 } |
| 445 | 447 |
| 446 bool RegisterAppBannerInfoBarDelegateAndroid(JNIEnv* env) { | 448 bool RegisterAppBannerInfoBarDelegateAndroid(JNIEnv* env) { |
| 447 return RegisterNativesImpl(env); | 449 return RegisterNativesImpl(env); |
| 448 } | 450 } |
| 449 | 451 |
| 450 } // namespace banners | 452 } // namespace banners |
| OLD | NEW |