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

Side by Side Diff: trunk/src/chrome/browser/ui/android/infobars/translate_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/translate_infobar.h" 5 #include "chrome/browser/ui/android/infobars/translate_infobar.h"
6 6
7 #include "base/android/jni_android.h" 7 #include "base/android/jni_android.h"
8 #include "base/android/jni_array.h" 8 #include "base/android/jni_array.h"
9 #include "base/android/jni_helper.h" 9 #include "base/android/jni_helper.h"
10 #include "chrome/browser/translate/translate_infobar_delegate.h" 10 #include "chrome/browser/translate/translate_infobar_delegate.h"
11 #include "grit/generated_resources.h" 11 #include "grit/generated_resources.h"
12 #include "jni/TranslateInfoBarDelegate_jni.h" 12 #include "jni/TranslateInfoBarDelegate_jni.h"
13 #include "ui/base/l10n/l10n_util.h" 13 #include "ui/base/l10n/l10n_util.h"
14 14
15 15
16 // TranslateInfoBarDelegate --------------------------------------------------- 16 // TranslateInfoBarDelegate ---------------------------------------------------
17 17
18 // static 18 // static
19 scoped_ptr<InfoBar> TranslateInfoBarDelegate::CreateInfoBar( 19 InfoBar* TranslateInfoBarDelegate::CreateInfoBar(InfoBarService* owner) {
20 scoped_ptr<TranslateInfoBarDelegate> delegate) { 20 return new TranslateInfoBar(owner, this);
21 return scoped_ptr<InfoBar>(new TranslateInfoBar(delegate.Pass()));
22 } 21 }
23 22
24 23
25 // TranslateInfoBar ----------------------------------------------------------- 24 // TranslateInfoBar -----------------------------------------------------------
26 25
27 TranslateInfoBar::TranslateInfoBar( 26 TranslateInfoBar::TranslateInfoBar(InfoBarService* owner,
28 scoped_ptr<TranslateInfoBarDelegate> delegate) 27 TranslateInfoBarDelegate* delegate)
29 : InfoBarAndroid(delegate.PassAs<InfoBarDelegate>()), 28 : InfoBarAndroid(owner, delegate),
30 java_translate_delegate_() { 29 java_translate_delegate_() {
31 } 30 }
32 31
33 TranslateInfoBar::~TranslateInfoBar() { 32 TranslateInfoBar::~TranslateInfoBar() {
34 } 33 }
35 34
36 ScopedJavaLocalRef<jobject> TranslateInfoBar::CreateRenderInfoBar(JNIEnv* env) { 35 ScopedJavaLocalRef<jobject> TranslateInfoBar::CreateRenderInfoBar(JNIEnv* env) {
37 java_translate_delegate_.Reset(Java_TranslateInfoBarDelegate_create(env)); 36 java_translate_delegate_.Reset(Java_TranslateInfoBarDelegate_create(env));
38 TranslateInfoBarDelegate* delegate = GetDelegate(); 37 TranslateInfoBarDelegate* delegate = GetDelegate();
39 std::vector<string16> languages; 38 std::vector<string16> languages;
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
131 TranslateInfoBarDelegate* TranslateInfoBar::GetDelegate() { 130 TranslateInfoBarDelegate* TranslateInfoBar::GetDelegate() {
132 return delegate()->AsTranslateInfoBarDelegate(); 131 return delegate()->AsTranslateInfoBarDelegate();
133 } 132 }
134 133
135 134
136 // Native JNI methods --------------------------------------------------------- 135 // Native JNI methods ---------------------------------------------------------
137 136
138 bool RegisterTranslateInfoBarDelegate(JNIEnv* env) { 137 bool RegisterTranslateInfoBarDelegate(JNIEnv* env) {
139 return RegisterNativesImpl(env); 138 return RegisterNativesImpl(env);
140 } 139 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698