Revert of Add button to add new FSP services to Files app. (patchset #8 id:140001...
[chromium-blink-merge.git] / chrome / browser / ui / android / infobars / translate_infobar.h
blobe210a0ca84794b94cc0dfa0ba8a073884d5d4a1a
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"
13 namespace translate {
14 class TranslateInfoBarDelegate;
17 class TranslateInfoBar : public InfoBarAndroid {
18 public:
19 explicit TranslateInfoBar(
20 scoped_ptr<translate::TranslateInfoBarDelegate> delegate);
21 ~TranslateInfoBar() override;
23 // JNI methods specific to translate.
24 void ApplyTranslateOptions(JNIEnv* env,
25 jobject obj,
26 int source_language_index,
27 int target_language_index,
28 bool always_translate,
29 bool never_translate_language,
30 bool never_translate_site);
32 private:
33 // InfoBarAndroid:
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 void TransferOwnership(TranslateInfoBar* destination,
40 translate::TranslateStep new_type);
41 void SetJavaDelegate(jobject delegate);
42 bool ShouldDisplayNeverTranslateInfoBarOnCancel();
44 translate::TranslateInfoBarDelegate* GetDelegate();
46 base::android::ScopedJavaGlobalRef<jobject> java_translate_delegate_;
48 DISALLOW_COPY_AND_ASSIGN(TranslateInfoBar);
51 // Registers the native methods through JNI.
52 bool RegisterTranslateInfoBarDelegate(JNIEnv* env);
54 #endif // CHROME_BROWSER_UI_ANDROID_INFOBARS_TRANSLATE_INFOBAR_H_