diff options
author | miguelg@chromium.org <miguelg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-03-28 13:16:30 +0000 |
---|---|---|
committer | miguelg@chromium.org <miguelg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-03-28 13:16:30 +0000 |
commit | 108d7f756b27b7a929a92e6416d982ceea299a1e (patch) | |
tree | 81ad3c312807a7ad2782354f34e5716121396772 | |
parent | 9df098754bab56a011a55deec1bb3cf0ffe89b40 (diff) | |
download | chromium_src-108d7f756b27b7a929a92e6416d982ceea299a1e.zip chromium_src-108d7f756b27b7a929a92e6416d982ceea299a1e.tar.gz chromium_src-108d7f756b27b7a929a92e6416d982ceea299a1e.tar.bz2 |
Revert 257612 "Merge 256887 Expose manually triggered translatio..."
> Merge 256887 Expose manually triggered translations on the translate delegate
>
> >On Android: Do not show Always Translate when the translation is triggered
> >manually.
>
> >Also set the target language if needed on the Translating... infobar
> >since for manually translated pages the first infobar does not show.
>
> R=dfalcantara@chromium.org, dfalcantara
>
> BUG=350932
>
> Review URL: https://codereview.chromium.org/201983002
TBR=miguelg@chromium.org
Review URL: https://codereview.chromium.org/216673004
git-svn-id: svn://svn.chromium.org/chrome/branches/1847/src@260112 0039d316-1c4b-4281-b951-d872f2087c98
15 files changed, 44 insertions, 90 deletions
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/infobar/TranslateAlwaysPanel.java b/chrome/android/java/src/org/chromium/chrome/browser/infobar/TranslateAlwaysPanel.java index e0d413b..4a68bf3 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/infobar/TranslateAlwaysPanel.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/infobar/TranslateAlwaysPanel.java @@ -27,10 +27,8 @@ public class TranslateAlwaysPanel implements TranslateSubPanel { panelMessage.setText(context.getString( R.string.translate_infobar_translation_done, mOptions.targetLanguage())); - if (!mOptions.triggeredFromMenu()) { - TranslateCheckBox checkBox = new TranslateCheckBox(mOptions, mListener); - checkBox.createContent(context, layout); - } + TranslateCheckBox checkBox = new TranslateCheckBox(mOptions, mListener); + checkBox.createContent(context, layout); layout.addButtons(context.getString(R.string.translate_button_done), context.getString(R.string.translate_show_original)); diff --git a/chrome/android/java/src/org/chromium/chrome/browser/infobar/TranslateInfoBar.java b/chrome/android/java/src/org/chromium/chrome/browser/infobar/TranslateInfoBar.java index dc99bef..0232105 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/infobar/TranslateInfoBar.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/infobar/TranslateInfoBar.java @@ -43,13 +43,12 @@ public class TranslateInfoBar extends TwoButtonInfoBar implements SubPanelListen public TranslateInfoBar(long nativeInfoBarPtr, TranslateInfoBarDelegate delegate, int infoBarType, int sourceLanguageIndex, int targetLanguageIndex, - boolean autoTranslatePair, boolean shouldShowNeverBar, - boolean triggeredFromMenu, String[] languages) { + boolean autoTranslatePair, boolean shouldShowNeverBar, String[] languages) { super(null, BACKGROUND_TYPE_INFO, R.drawable.infobar_translate); mTranslateDelegate = delegate; mOptions = new TranslateOptions(sourceLanguageIndex, targetLanguageIndex, languages, - autoTranslatePair, triggeredFromMenu); + autoTranslatePair); mInfoBarType = infoBarType; mShouldShowNeverBar = shouldShowNeverBar; mOptionsPanelViewType = NO_PANEL; @@ -181,12 +180,10 @@ public class TranslateInfoBar extends TwoButtonInfoBar implements SubPanelListen return; } - if (getInfoBarType() == AFTER_TRANSLATE_INFOBAR && - !needsAlwaysPanel() && - !mOptions.triggeredFromMenu()) { + if (getInfoBarType() == AFTER_TRANSLATE_INFOBAR && !needsAlwaysPanel()) { // Long always translate version - TranslateCheckBox checkBox = new TranslateCheckBox(mOptions, this); - checkBox.createContent(getContext(), layout); + TranslateCheckBox checkBox = new TranslateCheckBox(mOptions, this); + checkBox.createContent(getContext(), layout); } super.createContent(layout); @@ -333,12 +330,10 @@ public class TranslateInfoBar extends TwoButtonInfoBar implements SubPanelListen return mInfoBarType; } - void changeInfoBarTypeAndNativePointer( - int infoBarType,int newTargetLanguage, long newNativePointer) { + void changeInfoBarTypeAndNativePointer(int infoBarType, long newNativePointer) { if (infoBarType >= 0 && infoBarType < MAX_INFOBAR_INDEX) { mInfoBarType = infoBarType; replaceNativePointer(newNativePointer); - mOptions.setTargetLanguage(newTargetLanguage); updateViewForCurrentState(createView()); } else { assert false : "Trying to change the InfoBar to a type that is invalid."; diff --git a/chrome/android/java/src/org/chromium/chrome/browser/infobar/TranslateInfoBarDelegate.java b/chrome/android/java/src/org/chromium/chrome/browser/infobar/TranslateInfoBarDelegate.java index 4d63b58..f0a5d9a 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/infobar/TranslateInfoBarDelegate.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/infobar/TranslateInfoBarDelegate.java @@ -21,9 +21,8 @@ public class TranslateInfoBarDelegate { @CalledByNative boolean changeTranslateInfoBarTypeAndPointer( - long newNativeInfoBar, int translateBarType, int new_target_language) { - mInfoBar.changeInfoBarTypeAndNativePointer( - translateBarType, new_target_language, newNativeInfoBar); + long newNativeInfoBar, int translateBarType) { + mInfoBar.changeInfoBarTypeAndNativePointer(translateBarType, newNativeInfoBar); return true; } @@ -31,11 +30,10 @@ public class TranslateInfoBarDelegate { InfoBar showTranslateInfoBar( long nativeInfoBar, int translateBarType, int sourceLanguageIndex, int targetLanguageIndex, boolean autoTranslatePair, - boolean showNeverInfobar, boolean triggeredFromMenu, - String[] languages) { + boolean showNeverInfobar, String[] languages) { mInfoBar = new TranslateInfoBar(nativeInfoBar, this, translateBarType, sourceLanguageIndex, targetLanguageIndex, autoTranslatePair, showNeverInfobar, - triggeredFromMenu, languages); + languages); return mInfoBar; } diff --git a/chrome/android/java/src/org/chromium/chrome/browser/infobar/TranslateOptions.java b/chrome/android/java/src/org/chromium/chrome/browser/infobar/TranslateOptions.java index 59b2c6a..4992640 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/infobar/TranslateOptions.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/infobar/TranslateOptions.java @@ -31,15 +31,13 @@ public class TranslateOptions { private final boolean[] mOptions; private int mSourceLanguageIndex; private int mTargetLanguageIndex; - private final boolean mTriggeredFromMenu; private TranslateOptions(int sourceLanguageCode, int targetLanguageCode, String[] allLanguages, boolean neverLanguage, boolean neverDomain, boolean alwaysLanguage, - boolean triggeredFromMenu, boolean[] originalOptions) { + boolean[] originalOptions) { mAllLanguages = allLanguages; mSourceLanguageIndex = sourceLanguageCode; mTargetLanguageIndex = targetLanguageCode; - mTriggeredFromMenu = triggeredFromMenu; mOptions = new boolean[3]; mOptions[NEVER_LANGUAGE] = neverLanguage; @@ -58,9 +56,9 @@ public class TranslateOptions { } public TranslateOptions(int sourceLanguageCode, int targetLanguageCode, String[] allLanguages, - boolean alwaysTranslate, boolean triggeredFromMenu) { + boolean alwaysTranslate) { this(sourceLanguageCode, targetLanguageCode, allLanguages, false, false, alwaysTranslate, - triggeredFromMenu, null); + null); } /** @@ -69,8 +67,7 @@ public class TranslateOptions { public TranslateOptions(TranslateOptions other) { this(other.mSourceLanguageIndex, other.mTargetLanguageIndex, other.mAllLanguages, other.mOptions[NEVER_LANGUAGE], other.mOptions[NEVER_DOMAIN], - other.mOptions[ALWAYS_LANGUAGE], other.mTriggeredFromMenu, - other.mOriginalOptions); + other.mOptions[ALWAYS_LANGUAGE], other.mOriginalOptions); } public String sourceLanguage() { @@ -93,10 +90,6 @@ public class TranslateOptions { return checkLanguageBoundaries(mTargetLanguageIndex) ? mTargetLanguageIndex : 0; } - public boolean triggeredFromMenu() { - return mTriggeredFromMenu; - } - public boolean optionsChanged() { return (mSourceLanguageIndex != mOriginalSourceLanguageIndex) || (mTargetLanguageIndex != mOriginalTargetLanguageIndex) || diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/translate/TranslateOptionsTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/translate/TranslateOptionsTest.java index 7447810..494e0bb 100644 --- a/chrome/android/javatests/src/org/chromium/chrome/browser/translate/TranslateOptionsTest.java +++ b/chrome/android/javatests/src/org/chromium/chrome/browser/translate/TranslateOptionsTest.java @@ -20,7 +20,7 @@ public class TranslateOptionsTest extends AndroidTestCase { @SmallTest @Feature({"Translate"}) public void testNoChanges() { - TranslateOptions options = new TranslateOptions(0, 1, languages, ALWAYS_TRANSLATE, false); + TranslateOptions options = new TranslateOptions(0, 1, languages, ALWAYS_TRANSLATE); assertEquals("English", options.sourceLanguage()); assertEquals("Spanish", options.targetLanguage()); assertEquals(0, options.sourceLanguageIndex()); @@ -34,14 +34,13 @@ public class TranslateOptionsTest extends AndroidTestCase { @SmallTest @Feature({"Translate"}) public void testBasicLanguageChanges() { - TranslateOptions options = new TranslateOptions(0, 1, languages, !ALWAYS_TRANSLATE, true); + TranslateOptions options = new TranslateOptions(0, 1, languages, !ALWAYS_TRANSLATE); options.setTargetLanguage(2); options.setSourceLanguage(1); assertEquals("Spanish", options.sourceLanguage()); assertEquals("French", options.targetLanguage()); assertEquals(1, options.sourceLanguageIndex()); assertEquals(2, options.targetLanguageIndex()); - assertTrue(options.triggeredFromMenu()); assertTrue(options.optionsChanged()); // Switch back to the original @@ -53,7 +52,7 @@ public class TranslateOptionsTest extends AndroidTestCase { @SmallTest @Feature({"Translate"}) public void testInvalidLanguageChanges() { - TranslateOptions options = new TranslateOptions(0, 1, languages, ALWAYS_TRANSLATE, false); + TranslateOptions options = new TranslateOptions(0, 1, languages, ALWAYS_TRANSLATE); // Same target language as source assertFalse(options.setTargetLanguage(0)); @@ -75,7 +74,7 @@ public class TranslateOptionsTest extends AndroidTestCase { @SmallTest @Feature({"Translate"}) public void testBasicOptionsChanges() { - TranslateOptions options = new TranslateOptions(0, 1, languages, !ALWAYS_TRANSLATE, false); + TranslateOptions options = new TranslateOptions(0, 1, languages, !ALWAYS_TRANSLATE); assertFalse(options.optionsChanged()); options.toggleNeverTranslateDomainState(true); assertTrue(options.neverTranslateDomainState()); @@ -99,7 +98,7 @@ public class TranslateOptionsTest extends AndroidTestCase { @SmallTest @Feature({"Translate"}) public void testInvalidOptionsChanges() { - TranslateOptions options = new TranslateOptions(0, 1, languages, ALWAYS_TRANSLATE, false); + TranslateOptions options = new TranslateOptions(0, 1, languages, ALWAYS_TRANSLATE); // Never translate language should not work, but never translate domain should assertFalse(options.toggleNeverTranslateLanguageState(true)); diff --git a/chrome/browser/tab_contents/render_view_context_menu.cc b/chrome/browser/tab_contents/render_view_context_menu.cc index e7ec877..99058ef 100644 --- a/chrome/browser/tab_contents/render_view_context_menu.cc +++ b/chrome/browser/tab_contents/render_view_context_menu.cc @@ -1832,7 +1832,7 @@ void RenderViewContextMenu::ExecuteCommand(int id, int event_flags) { prefs->UnblockLanguage(original_lang); prefs->RemoveSiteFromBlacklist(params_.page_url.HostNoBrackets()); TranslateManager::GetInstance()->TranslatePage( - source_web_contents_, original_lang, target_lang, false); + source_web_contents_, original_lang, target_lang); break; } diff --git a/chrome/browser/translate/translate_infobar_delegate.cc b/chrome/browser/translate/translate_infobar_delegate.cc index 65f714aa..a2b8254 100644 --- a/chrome/browser/translate/translate_infobar_delegate.cc +++ b/chrome/browser/translate/translate_infobar_delegate.cc @@ -60,8 +60,7 @@ void TranslateInfoBarDelegate::Create(bool replace_existing_infobar, const std::string& original_language, const std::string& target_language, TranslateErrors::Type error_type, - PrefService* prefs, - bool triggered_from_menu) { + PrefService* prefs) { // Check preconditions. if (step != TranslateTabHelper::TRANSLATE_ERROR) { DCHECK(TranslateDownloadManager::IsSupportedLanguage(target_language)); @@ -104,8 +103,7 @@ void TranslateInfoBarDelegate::Create(bool replace_existing_infobar, scoped_ptr<InfoBar> infobar(CreateInfoBar( scoped_ptr<TranslateInfoBarDelegate>(new TranslateInfoBarDelegate( web_contents, step, old_delegate, original_language, - target_language, error_type, prefs, - triggered_from_menu)))); + target_language, error_type, prefs)))); if (old_delegate) infobar_service->ReplaceInfoBar(old_infobar, infobar.Pass()); else @@ -253,7 +251,7 @@ void TranslateInfoBarDelegate::MessageInfoBarButtonPressed() { } // This is the "Try again..." case. TranslateManager::GetInstance()->TranslatePage( - web_contents(), original_language_code(), target_language_code(), false); + web_contents(), original_language_code(), target_language_code()); } bool TranslateInfoBarDelegate::ShouldShowMessageInfoBarButton() { @@ -323,15 +321,13 @@ TranslateInfoBarDelegate::TranslateInfoBarDelegate( const std::string& original_language, const std::string& target_language, TranslateErrors::Type error_type, - PrefService* prefs, - bool triggered_from_menu) + PrefService* prefs) : InfoBarDelegate(), step_(step), background_animation_(NONE), ui_delegate_(web_contents, original_language, target_language), error_type_(error_type), - prefs_(TranslateTabHelper::CreateTranslatePrefs(prefs)), - triggered_from_menu_(triggered_from_menu) { + prefs_(TranslateTabHelper::CreateTranslatePrefs(prefs)) { DCHECK_NE((step_ == TranslateTabHelper::TRANSLATE_ERROR), (error_type_ == TranslateErrors::NONE)); diff --git a/chrome/browser/translate/translate_infobar_delegate.h b/chrome/browser/translate/translate_infobar_delegate.h index 1b919cac..6bb278e 100644 --- a/chrome/browser/translate/translate_infobar_delegate.h +++ b/chrome/browser/translate/translate_infobar_delegate.h @@ -51,8 +51,7 @@ class TranslateInfoBarDelegate : public InfoBarDelegate { const std::string& original_language, const std::string& target_language, TranslateErrors::Type error_type, - PrefService* prefs, - bool triggered_from_menu); + PrefService* prefs); // Returns the number of languages supported. size_t num_languages() const { return ui_delegate_.GetNumberOfLanguages(); } @@ -93,13 +92,6 @@ class TranslateInfoBarDelegate : public InfoBarDelegate { // should get a yellow background instead of a blue one). bool is_error() const { return step_ == TranslateTabHelper::TRANSLATE_ERROR; } - - // Return true if the translation was triggered by a menu entry instead of - // via an infobar/bubble or preference. - bool triggered_from_menu() const { - return triggered_from_menu_; - } - // Returns what kind of background fading effect the infobar should use when // its is shown. BackgroundAnimationType background_animation_type() const { @@ -171,8 +163,7 @@ class TranslateInfoBarDelegate : public InfoBarDelegate { const std::string& original_language, const std::string& target_language, TranslateErrors::Type error_type, - PrefService* prefs, - bool triggered_from_menu); + PrefService* prefs); private: friend class TranslationInfoBarTest; @@ -204,9 +195,6 @@ class TranslateInfoBarDelegate : public InfoBarDelegate { // The translation related preferences. scoped_ptr<TranslatePrefs> prefs_; - // Whether the translation was triggered via a menu click vs automatically - // (due to language detection, preferences...) - bool triggered_from_menu_; DISALLOW_COPY_AND_ASSIGN(TranslateInfoBarDelegate); }; diff --git a/chrome/browser/translate/translate_manager.cc b/chrome/browser/translate/translate_manager.cc index 387874a..5eb19be 100644 --- a/chrome/browser/translate/translate_manager.cc +++ b/chrome/browser/translate/translate_manager.cc @@ -329,7 +329,7 @@ void TranslateManager::InitiateTranslation(WebContents* web_contents, if (!auto_target_lang.empty()) { TranslateBrowserMetrics::ReportInitiationStatus( TranslateBrowserMetrics::INITIATION_STATUS_AUTO_BY_CONFIG); - TranslatePage(web_contents, language_code, auto_target_lang, false); + TranslatePage(web_contents, language_code, auto_target_lang); return; } } @@ -340,7 +340,7 @@ void TranslateManager::InitiateTranslation(WebContents* web_contents, // This page was navigated through a click from a translated page. TranslateBrowserMetrics::ReportInitiationStatus( TranslateBrowserMetrics::INITIATION_STATUS_AUTO_BY_LINK); - TranslatePage(web_contents, language_code, auto_translate_to, false); + TranslatePage(web_contents, language_code, auto_translate_to); return; } @@ -352,8 +352,7 @@ void TranslateManager::InitiateTranslation(WebContents* web_contents, web_contents, language_code, target_lang, - TranslateErrors::NONE, - false); + TranslateErrors::NONE); } void TranslateManager::InitiateTranslationPosted(int process_id, @@ -391,9 +390,7 @@ void TranslateManager::InitiateTranslationPosted(int process_id, void TranslateManager::TranslatePage(WebContents* web_contents, const std::string& original_source_lang, - const std::string& target_lang, - bool triggered_from_menu) { - + const std::string& target_lang) { NavigationEntry* entry = web_contents->GetController().GetActiveEntry(); if (!entry) { NOTREACHED(); @@ -415,8 +412,7 @@ void TranslateManager::TranslatePage(WebContents* web_contents, web_contents, source_lang, target_lang, - TranslateErrors::NONE, - triggered_from_menu); + TranslateErrors::NONE); TranslateScript* script = TranslateDownloadManager::GetInstance()->script(); DCHECK(script != NULL); @@ -524,8 +520,7 @@ void TranslateManager::PageTranslated(WebContents* web_contents, web_contents, details->source_language, details->target_language, - details->error_type, - false); + details->error_type); if (details->error_type != TranslateErrors::NONE && !web_contents->GetBrowserContext()->IsOffTheRecord()) { @@ -567,8 +562,7 @@ void TranslateManager::OnTranslateScriptFetchComplete(PendingRequest request, web_contents, request.source_lang, request.target_lang, - TranslateErrors::NETWORK, - false); + TranslateErrors::NETWORK); if (!web_contents->GetBrowserContext()->IsOffTheRecord()) { TranslateErrorDetails error_details; error_details.time = base::Time::Now(); diff --git a/chrome/browser/translate/translate_manager.h b/chrome/browser/translate/translate_manager.h index 4e4a0510..b3e779a 100644 --- a/chrome/browser/translate/translate_manager.h +++ b/chrome/browser/translate/translate_manager.h @@ -59,8 +59,7 @@ class TranslateManager : public content::NotificationObserver { // script is not yet available. void TranslatePage(content::WebContents* web_contents, const std::string& source_lang, - const std::string& target_lang, - bool triggered_from_menu); + const std::string& target_lang); // Reverts the contents of the page in |web_contents| to its original // language. diff --git a/chrome/browser/translate/translate_tab_helper.cc b/chrome/browser/translate/translate_tab_helper.cc index e9eba12..35a6b4f 100644 --- a/chrome/browser/translate/translate_tab_helper.cc +++ b/chrome/browser/translate/translate_tab_helper.cc @@ -59,8 +59,7 @@ void TranslateTabHelper::ShowTranslateUI(TranslateTabHelper::TranslateStep step, content::WebContents* web_contents, const std::string source_language, const std::string target_language, - TranslateErrors::Type error_type, - bool triggered_from_menu) { + TranslateErrors::Type error_type) { if (error_type != TranslateErrors::NONE) step = TranslateTabHelper::TRANSLATE_ERROR; @@ -86,8 +85,7 @@ void TranslateTabHelper::ShowTranslateUI(TranslateTabHelper::TranslateStep step, source_language, target_language, error_type, - original_profile->GetPrefs(), - triggered_from_menu); + original_profile->GetPrefs()); } bool TranslateTabHelper::OnMessageReceived(const IPC::Message& message) { diff --git a/chrome/browser/translate/translate_tab_helper.h b/chrome/browser/translate/translate_tab_helper.h index e16a6a2..3c35d4a 100644 --- a/chrome/browser/translate/translate_tab_helper.h +++ b/chrome/browser/translate/translate_tab_helper.h @@ -59,8 +59,7 @@ class TranslateTabHelper content::WebContents* web_contents, const std::string source_language, const std::string target_language, - TranslateErrors::Type error_type, - bool triggered_from_menu); + TranslateErrors::Type error_type); private: explicit TranslateTabHelper(content::WebContents* web_contents); diff --git a/chrome/browser/translate/translate_ui_delegate.cc b/chrome/browser/translate/translate_ui_delegate.cc index 34342af..c9114b7 100644 --- a/chrome/browser/translate/translate_ui_delegate.cc +++ b/chrome/browser/translate/translate_ui_delegate.cc @@ -159,8 +159,7 @@ void TranslateUIDelegate::Translate() { } TranslateManager::GetInstance()->TranslatePage(web_contents(), GetOriginalLanguageCode(), - GetTargetLanguageCode(), - false); + GetTargetLanguageCode()); UMA_HISTOGRAM_BOOLEAN(kPerformTranslate, true); } diff --git a/chrome/browser/ui/android/infobars/translate_infobar.cc b/chrome/browser/ui/android/infobars/translate_infobar.cc index 4e31605..04758b60 100644 --- a/chrome/browser/ui/android/infobars/translate_infobar.cc +++ b/chrome/browser/ui/android/infobars/translate_infobar.cc @@ -47,8 +47,7 @@ ScopedJavaLocalRef<jobject> TranslateInfoBar::CreateRenderInfoBar(JNIEnv* env) { env, java_translate_delegate_.obj(), reinterpret_cast<intptr_t>(this), delegate->translate_step(), delegate->original_language_index(), delegate->target_language_index(), delegate->ShouldAlwaysTranslate(), - ShouldDisplayNeverTranslateInfoBarOnCancel(), - delegate->triggered_from_menu(), java_languages.obj()); + ShouldDisplayNeverTranslateInfoBarOnCancel(), java_languages.obj()); } void TranslateInfoBar::ProcessButton(int action, @@ -106,11 +105,10 @@ void TranslateInfoBar::ApplyTranslateOptions(JNIEnv* env, void TranslateInfoBar::TransferOwnership( TranslateInfoBar* destination, TranslateTabHelper::TranslateStep new_type) { - int new_target_language = destination->GetDelegate()->target_language_index(); JNIEnv* env = base::android::AttachCurrentThread(); if (Java_TranslateInfoBarDelegate_changeTranslateInfoBarTypeAndPointer( env, java_translate_delegate_.obj(), - reinterpret_cast<intptr_t>(destination), new_type, new_target_language)) { + reinterpret_cast<intptr_t>(destination), new_type)) { ReassignJavaInfoBar(destination); destination->SetJavaDelegate(java_translate_delegate_.Release()); } diff --git a/chrome/browser/ui/cocoa/infobars/translate_infobar_unittest.mm b/chrome/browser/ui/cocoa/infobars/translate_infobar_unittest.mm index fe8d9e9..ff70e2b 100644 --- a/chrome/browser/ui/cocoa/infobars/translate_infobar_unittest.mm +++ b/chrome/browser/ui/cocoa/infobars/translate_infobar_unittest.mm @@ -42,7 +42,7 @@ class MockTranslateInfoBarDelegate : public TranslateInfoBarDelegate { TranslateErrors::Type error, PrefService* prefs) : TranslateInfoBarDelegate(web_contents, step, NULL, "en", "es", error, - prefs, false) { + prefs) { } MOCK_METHOD0(Translate, void()); |