OLD | NEW |
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_weak_ref.h" | 9 #include "base/android/jni_weak_ref.h" |
10 #include "chrome/browser/translate/chrome_translate_client.h" | 10 #include "chrome/browser/translate/chrome_translate_client.h" |
11 #include "components/translate/core/browser/translate_infobar_delegate.h" | 11 #include "components/translate/core/browser/translate_infobar_delegate.h" |
12 #include "grit/generated_resources.h" | |
13 #include "jni/TranslateInfoBarDelegate_jni.h" | 12 #include "jni/TranslateInfoBarDelegate_jni.h" |
14 #include "ui/base/l10n/l10n_util.h" | |
15 | 13 |
16 // ChromeTranslateClient | 14 // ChromeTranslateClient |
17 // ---------------------------------------------------------- | 15 // ---------------------------------------------------------- |
18 | 16 |
19 scoped_ptr<infobars::InfoBar> ChromeTranslateClient::CreateInfoBar( | 17 scoped_ptr<infobars::InfoBar> ChromeTranslateClient::CreateInfoBar( |
20 scoped_ptr<translate::TranslateInfoBarDelegate> delegate) const { | 18 scoped_ptr<translate::TranslateInfoBarDelegate> delegate) const { |
21 return scoped_ptr<infobars::InfoBar>(new TranslateInfoBar(delegate.Pass())); | 19 return scoped_ptr<infobars::InfoBar>(new TranslateInfoBar(delegate.Pass())); |
22 } | 20 } |
23 | 21 |
24 | 22 |
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
130 translate::TranslateInfoBarDelegate* TranslateInfoBar::GetDelegate() { | 128 translate::TranslateInfoBarDelegate* TranslateInfoBar::GetDelegate() { |
131 return delegate()->AsTranslateInfoBarDelegate(); | 129 return delegate()->AsTranslateInfoBarDelegate(); |
132 } | 130 } |
133 | 131 |
134 | 132 |
135 // Native JNI methods --------------------------------------------------------- | 133 // Native JNI methods --------------------------------------------------------- |
136 | 134 |
137 bool RegisterTranslateInfoBarDelegate(JNIEnv* env) { | 135 bool RegisterTranslateInfoBarDelegate(JNIEnv* env) { |
138 return RegisterNativesImpl(env); | 136 return RegisterNativesImpl(env); |
139 } | 137 } |
OLD | NEW |