Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | |
|
gone
2017/03/24 20:34:30
2017
ramyasharma
2017/03/27 03:36:58
Done.
| |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #include "chrome/browser/ui/android/infobars/translate_compact_infobar.h" | |
| 6 | |
| 7 #include <stddef.h> | |
| 8 | |
| 9 #include "base/android/jni_android.h" | |
| 10 #include "base/android/jni_array.h" | |
| 11 #include "base/android/jni_string.h" | |
| 12 #include "base/android/jni_weak_ref.h" | |
| 13 #include "base/memory/ptr_util.h" | |
| 14 #include "chrome/browser/ui/android/infobars/translate_utils.h" | |
| 15 #include "components/translate/core/browser/translate_infobar_delegate.h" | |
| 16 #include "jni/TranslateCompactInfoBar_jni.h" | |
| 17 | |
| 18 using base::android::JavaParamRef; | |
| 19 using base::android::ScopedJavaLocalRef; | |
| 20 | |
| 21 // TranslateInfoBar ----------------------------------------------------------- | |
| 22 | |
| 23 TranslateCompactInfoBar::TranslateCompactInfoBar( | |
| 24 std::unique_ptr<translate::TranslateInfoBarDelegate> delegate) | |
| 25 : InfoBarAndroid(std::move(delegate)) {} | |
| 26 | |
| 27 TranslateCompactInfoBar::~TranslateCompactInfoBar() {} | |
| 28 | |
| 29 ScopedJavaLocalRef<jobject> TranslateCompactInfoBar::CreateRenderInfoBar( | |
| 30 JNIEnv* env) { | |
| 31 // TODO(ramyasharma): Implement. | |
| 32 return Java_TranslateCompactInfoBar_create(env); | |
| 33 } | |
| 34 | |
| 35 void TranslateCompactInfoBar::ProcessButton(int action) { | |
| 36 // TODO(ramyasharma): Implement. | |
| 37 } | |
| 38 | |
| 39 void TranslateCompactInfoBar::PassJavaInfoBar(InfoBarAndroid* source) { | |
| 40 // TODO(ramyasharma): Implement. | |
| 41 } | |
| 42 | |
| 43 void TranslateCompactInfoBar::SetJavaInfoBar( | |
| 44 const base::android::JavaRef<jobject>& java_info_bar) { | |
| 45 InfoBarAndroid::SetJavaInfoBar(java_info_bar); | |
| 46 JNIEnv* env = base::android::AttachCurrentThread(); | |
| 47 Java_TranslateCompactInfoBar_setNativePtr(env, java_info_bar, | |
| 48 reinterpret_cast<intptr_t>(this)); | |
| 49 } | |
| 50 | |
| 51 void TranslateCompactInfoBar::ApplyTranslateOptions( | |
| 52 JNIEnv* env, | |
| 53 const JavaParamRef<jobject>& obj) { | |
| 54 // TODO(ramyasharma): Implement. | |
| 55 } | |
| 56 | |
| 57 void TranslateCompactInfoBar::TransferOwnership( | |
| 58 TranslateCompactInfoBar* destination, | |
| 59 translate::TranslateStep new_type) { | |
| 60 // TODO(ramyasharma): Implement. | |
| 61 } | |
| 62 | |
| 63 bool TranslateCompactInfoBar::ShouldDisplayNeverTranslateInfoBarOnCancel() { | |
| 64 return false; | |
| 65 // TODO(ramyasharma): Implement. | |
| 66 } | |
| 67 | |
| 68 translate::TranslateInfoBarDelegate* TranslateCompactInfoBar::GetDelegate() { | |
| 69 return delegate()->AsTranslateInfoBarDelegate(); | |
| 70 } | |
| 71 | |
| 72 // Native JNI methods --------------------------------------------------------- | |
| 73 | |
| 74 // static | |
| 75 bool RegisterTranslateCompactInfoBar(JNIEnv* env) { | |
| 76 return RegisterNativesImpl(env); | |
| 77 } | |
| OLD | NEW |