Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(638)

Side by Side Diff: trunk/src/chrome/browser/ui/android/infobars/confirm_infobar.cc

Issue 102163002: Revert 238283 "Infobar system refactor." (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: Created 7 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/ui/android/infobars/confirm_infobar.h" 5 #include "chrome/browser/ui/android/infobars/confirm_infobar.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/logging.h" 9 #include "base/logging.h"
10 #include "chrome/browser/android/resource_mapper.h" 10 #include "chrome/browser/android/resource_mapper.h"
11 #include "chrome/browser/infobars/confirm_infobar_delegate.h" 11 #include "chrome/browser/infobars/confirm_infobar_delegate.h"
12 #include "jni/ConfirmInfoBarDelegate_jni.h" 12 #include "jni/ConfirmInfoBarDelegate_jni.h"
13 13
14 14
15 // ConfirmInfoBarDelegate ----------------------------------------------------- 15 // ConfirmInfoBarDelegate -----------------------------------------------------
16 16
17 // static 17 // static
18 scoped_ptr<InfoBar> ConfirmInfoBarDelegate::CreateInfoBar( 18 InfoBar* ConfirmInfoBarDelegate::CreateInfoBar(InfoBarService* owner) {
19 scoped_ptr<ConfirmInfoBarDelegate> delegate) { 19 return new ConfirmInfoBar(owner, this);
20 return scoped_ptr<InfoBar>(new ConfirmInfoBar(delegate.Pass()));
21 } 20 }
22 21
23 22
24 // ConfirmInfoBar ------------------------------------------------------------- 23 // ConfirmInfoBar -------------------------------------------------------------
25 24
26 ConfirmInfoBar::ConfirmInfoBar(scoped_ptr<ConfirmInfoBarDelegate> delegate) 25 ConfirmInfoBar::ConfirmInfoBar(InfoBarService* owner, InfoBarDelegate* delegate)
27 : InfoBarAndroid(delegate.PassAs<InfoBarDelegate>()), 26 : InfoBarAndroid(owner, delegate),
28 java_confirm_delegate_() { 27 java_confirm_delegate_() {
29 } 28 }
30 29
31 ConfirmInfoBar::~ConfirmInfoBar() { 30 ConfirmInfoBar::~ConfirmInfoBar() {
32 } 31 }
33 32
34 base::android::ScopedJavaLocalRef<jobject> ConfirmInfoBar::CreateRenderInfoBar( 33 base::android::ScopedJavaLocalRef<jobject> ConfirmInfoBar::CreateRenderInfoBar(
35 JNIEnv* env) { 34 JNIEnv* env) {
36 java_confirm_delegate_.Reset(Java_ConfirmInfoBarDelegate_create(env)); 35 java_confirm_delegate_.Reset(Java_ConfirmInfoBarDelegate_create(env));
37 base::android::ScopedJavaLocalRef<jstring> ok_button_text = 36 base::android::ScopedJavaLocalRef<jstring> ok_button_text =
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
85 return (delegate->GetButtons() & button) ? 84 return (delegate->GetButtons() & button) ?
86 delegate->GetButtonLabel(button) : string16(); 85 delegate->GetButtonLabel(button) : string16();
87 } 86 }
88 87
89 88
90 // Native JNI methods --------------------------------------------------------- 89 // Native JNI methods ---------------------------------------------------------
91 90
92 bool RegisterConfirmInfoBarDelegate(JNIEnv* env) { 91 bool RegisterConfirmInfoBarDelegate(JNIEnv* env) {
93 return RegisterNativesImpl(env); 92 return RegisterNativesImpl(env);
94 } 93 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698