Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4495)

Unified Diff: chrome/browser/ui/android/infobars/translate_compact_infobar.h

Issue 2762393003: Creates translate_compact_infobar class, which holds the logic for the new translate UI (Closed)
Patch Set: a Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/ui/BUILD.gn ('k') | chrome/browser/ui/android/infobars/translate_compact_infobar.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/android/infobars/translate_compact_infobar.h
diff --git a/chrome/browser/ui/android/infobars/translate_compact_infobar.h b/chrome/browser/ui/android/infobars/translate_compact_infobar.h
new file mode 100644
index 0000000000000000000000000000000000000000..aee7e2999d94f28461767f16ab9dde07c23998b4
--- /dev/null
+++ b/chrome/browser/ui/android/infobars/translate_compact_infobar.h
@@ -0,0 +1,43 @@
+// Copyright 2017 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_BROWSER_UI_ANDROID_INFOBARS_TRANSLATE_COMPACT_INFOBAR_H_
+#define CHROME_BROWSER_UI_ANDROID_INFOBARS_TRANSLATE_COMPACT_INFOBAR_H_
+
+#include "base/android/scoped_java_ref.h"
+#include "base/macros.h"
+#include "chrome/browser/translate/chrome_translate_client.h"
+#include "chrome/browser/ui/android/infobars/infobar_android.h"
+
+namespace translate {
+class TranslateInfoBarDelegate;
+}
+
+class TranslateCompactInfoBar : public InfoBarAndroid {
+ public:
+ explicit TranslateCompactInfoBar(
+ std::unique_ptr<translate::TranslateInfoBarDelegate> delegate);
+ ~TranslateCompactInfoBar() override;
+
+ // JNI methods specific to translate.
+ void ApplyTranslateOptions(JNIEnv* env,
+ const base::android::JavaParamRef<jobject>& obj);
+
+ private:
+ // InfoBarAndroid:
+ base::android::ScopedJavaLocalRef<jobject> CreateRenderInfoBar(
+ JNIEnv* env) override;
+ void ProcessButton(int action) override;
+ void SetJavaInfoBar(
+ const base::android::JavaRef<jobject>& java_info_bar) override;
+
+ translate::TranslateInfoBarDelegate* GetDelegate();
+
+ DISALLOW_COPY_AND_ASSIGN(TranslateCompactInfoBar);
+};
+
+// Registers the native methods through JNI.
+bool RegisterTranslateCompactInfoBar(JNIEnv* env);
+
+#endif
« no previous file with comments | « chrome/browser/ui/BUILD.gn ('k') | chrome/browser/ui/android/infobars/translate_compact_infobar.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698