| 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 <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| 11 #include "base/android/jni_android.h" | 11 #include "base/android/jni_android.h" |
| 12 #include "base/android/jni_array.h" | 12 #include "base/android/jni_array.h" |
| 13 #include "base/android/jni_string.h" | 13 #include "base/android/jni_string.h" |
| 14 #include "base/android/jni_weak_ref.h" | 14 #include "base/android/jni_weak_ref.h" |
| 15 #include "base/memory/ptr_util.h" | 15 #include "base/memory/ptr_util.h" |
| 16 #include "chrome/browser/translate/chrome_translate_client.h" | 16 #include "chrome/browser/translate/chrome_translate_client.h" |
| 17 #include "components/translate/core/browser/translate_infobar_delegate.h" | 17 #include "components/translate/core/browser/translate_infobar_delegate.h" |
| 18 #include "jni/TranslateInfoBar_jni.h" | 18 #include "jni/TranslateInfoBar_jni.h" |
| 19 | 19 |
| 20 using base::android::JavaParamRef; | 20 using base::android::JavaParamRef; |
| 21 using base::android::ScopedJavaLocalRef; | 21 using base::android::ScopedJavaLocalRef; |
| 22 | 22 |
| 23 // ChromeTranslateClient | 23 // ChromeTranslateClient |
| 24 // ---------------------------------------------------------- | 24 // ---------------------------------------------------------- |
| 25 | 25 |
| 26 std::unique_ptr<infobars::InfoBar> ChromeTranslateClient::CreateInfoBar( | 26 std::unique_ptr<infobars::InfoBar> ChromeTranslateClient::CreateInfoBar( |
| 27 std::unique_ptr<translate::TranslateInfoBarDelegate> delegate) const { | 27 std::unique_ptr<translate::TranslateInfoBarDelegate> delegate) const { |
| 28 return base::WrapUnique(new TranslateInfoBar(std::move(delegate))); | 28 return base::MakeUnique<TranslateInfoBar>(std::move(delegate)); |
| 29 } | 29 } |
| 30 | 30 |
| 31 | 31 |
| 32 // TranslateInfoBar ----------------------------------------------------------- | 32 // TranslateInfoBar ----------------------------------------------------------- |
| 33 | 33 |
| 34 TranslateInfoBar::TranslateInfoBar( | 34 TranslateInfoBar::TranslateInfoBar( |
| 35 std::unique_ptr<translate::TranslateInfoBarDelegate> delegate) | 35 std::unique_ptr<translate::TranslateInfoBarDelegate> delegate) |
| 36 : InfoBarAndroid(std::move(delegate)) {} | 36 : InfoBarAndroid(std::move(delegate)) {} |
| 37 | 37 |
| 38 TranslateInfoBar::~TranslateInfoBar() { | 38 TranslateInfoBar::~TranslateInfoBar() { |
| (...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 153 translate::TranslateInfoBarDelegate* TranslateInfoBar::GetDelegate() { | 153 translate::TranslateInfoBarDelegate* TranslateInfoBar::GetDelegate() { |
| 154 return delegate()->AsTranslateInfoBarDelegate(); | 154 return delegate()->AsTranslateInfoBarDelegate(); |
| 155 } | 155 } |
| 156 | 156 |
| 157 | 157 |
| 158 // Native JNI methods --------------------------------------------------------- | 158 // Native JNI methods --------------------------------------------------------- |
| 159 | 159 |
| 160 bool RegisterTranslateInfoBarDelegate(JNIEnv* env) { | 160 bool RegisterTranslateInfoBarDelegate(JNIEnv* env) { |
| 161 return RegisterNativesImpl(env); | 161 return RegisterNativesImpl(env); |
| 162 } | 162 } |
| OLD | NEW |