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
3 // found in the LICENSE file.
5 #ifndef CHROME_BROWSER_UI_ANDROID_INFOBARS_TRANSLATE_INFOBAR_H_
6 #define CHROME_BROWSER_UI_ANDROID_INFOBARS_TRANSLATE_INFOBAR_H_
8 #include "base/android/scoped_java_ref.h"
9 #include "base/basictypes.h"
10 #include "chrome/browser/translate/chrome_translate_client.h"
11 #include "chrome/browser/ui/android/infobars/infobar_android.h"
14 class TranslateInfoBarDelegate
;
17 class TranslateInfoBar
: public InfoBarAndroid
{
19 explicit TranslateInfoBar(
20 scoped_ptr
<translate::TranslateInfoBarDelegate
> delegate
);
21 ~TranslateInfoBar() override
;
23 // JNI methods specific to translate.
24 void ApplyTranslateOptions(JNIEnv
* env
,
26 int source_language_index
,
27 int target_language_index
,
28 bool always_translate
,
29 bool never_translate_language
,
30 bool never_translate_site
);
34 base::android::ScopedJavaLocalRef
<jobject
> CreateRenderInfoBar(
35 JNIEnv
* env
) override
;
36 void ProcessButton(int action
, const std::string
& action_value
) override
;
37 void PassJavaInfoBar(InfoBarAndroid
* source
) override
;
39 const base::android::JavaRef
<jobject
>& java_info_bar
) override
;
41 void TransferOwnership(TranslateInfoBar
* destination
,
42 translate::TranslateStep new_type
);
43 bool ShouldDisplayNeverTranslateInfoBarOnCancel();
45 translate::TranslateInfoBarDelegate
* GetDelegate();
47 DISALLOW_COPY_AND_ASSIGN(TranslateInfoBar
);
50 // Registers the native methods through JNI.
51 bool RegisterTranslateInfoBarDelegate(JNIEnv
* env
);
53 #endif // CHROME_BROWSER_UI_ANDROID_INFOBARS_TRANSLATE_INFOBAR_H_