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

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

Issue 2899893004: Code cleanup for Translate Compact Infobar. (Closed)
Patch Set: Merge branch 'master' into code-cleanup-5 Created 3 years, 7 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
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
index 43a4605b270208a321d2b4539cb352f4cea6c3e4..a2c65e1340290a83ba91b6a529e41b0a89e6bd14 100644
--- a/chrome/browser/ui/android/infobars/translate_compact_infobar.h
+++ b/chrome/browser/ui/android/infobars/translate_compact_infobar.h
@@ -44,11 +44,15 @@ class TranslateCompactInfoBar
// Check whether we should automatically trigger "Never Translate Language".
jboolean ShouldAutoNeverTranslate(
JNIEnv* env,
- const base::android::JavaParamRef<jobject>& obj);
+ const base::android::JavaParamRef<jobject>& obj,
+ jboolean menu_expanded);
// TranslateInfoBarDelegate::Observer implementation.
void OnTranslateStepChanged(translate::TranslateStep step,
translate::TranslateErrors::Type error_type) override;
+ // Returns true if the user didn't take any affirmative action.
+ // The function will be called when the translate infobar is dismissed.
+ // If it's true, we will record a declined event.
bool IsDeclinedByUser() override;
private:
@@ -61,10 +65,10 @@ class TranslateCompactInfoBar
translate::TranslateInfoBarDelegate* GetDelegate();
- // Bits for trace user actions.
+ // Bits for trace user's affirmative actions.
unsigned int action_flags_;
- // User action flags to record what the user has done in each session.
+ // Affirmative action flags to record what the user has done in one session.
enum ActionFlag {
FLAG_NONE = 0,
FLAG_TRANSLATE = 1 << 0,
@@ -72,6 +76,7 @@ class TranslateCompactInfoBar
FLAG_ALWAYS_TRANSLATE = 1 << 2,
FLAG_NEVER_LANGUAGE = 1 << 3,
FLAG_NEVER_SITE = 1 << 4,
+ FLAG_EXPAND_MENU = 1 << 5,
};
// If number of consecutive translations is equal to this number, infobar will

Powered by Google App Engine
This is Rietveld 408576698