Index: components/translate/core/browser/translate_infobar_delegate.cc |
diff --git a/chrome/browser/translate/translate_infobar_delegate.cc b/components/translate/core/browser/translate_infobar_delegate.cc |
similarity index 95% |
rename from chrome/browser/translate/translate_infobar_delegate.cc |
rename to components/translate/core/browser/translate_infobar_delegate.cc |
index ccb064187259e12ba808146eb9db9bdcb8ee181e..812be03962bcab8643e0ad256a2cd61816c79708 100644 |
--- a/chrome/browser/translate/translate_infobar_delegate.cc |
+++ b/components/translate/core/browser/translate_infobar_delegate.cc |
@@ -2,7 +2,7 @@ |
// Use of this source code is governed by a BSD-style license that can be |
// found in the LICENSE file. |
-#include "chrome/browser/translate/translate_infobar_delegate.h" |
+#include "components/translate/core/browser/translate_infobar_delegate.h" |
#include <algorithm> |
@@ -18,8 +18,6 @@ |
#include "components/translate/core/browser/translate_manager.h" |
#include "components/translate/core/common/translate_constants.h" |
#include "grit/component_strings.h" |
-#include "grit/theme_resources.h" |
-#include "third_party/icu/source/i18n/unicode/coll.h" |
#include "ui/base/l10n/l10n_util.h" |
namespace { |
@@ -29,17 +27,17 @@ namespace { |
// so we are more aggressive about showing the shortcut to never translate. |
// The "Always Translate" option is always shown on iOS and Android. |
#if defined(OS_ANDROID) |
- const int kAlwaysTranslateMinCount = 1; |
- const int kNeverTranslateMinCount = 1; |
+const int kAlwaysTranslateMinCount = 1; |
+const int kNeverTranslateMinCount = 1; |
#elif defined(OS_IOS) |
- // The iOS implementation, like the Android implementation, shows the "Never |
- // translate" infobar after two denials. There is an offset of one because on |
- // Android the last event is not counted. |
- const int kAlwaysTranslateMinCount = 1; |
- const int kNeverTranslateMinCount = 2; |
+// The iOS implementation, like the Android implementation, shows the "Never |
+// translate" infobar after two denials. There is an offset of one because on |
+// Android the last event is not counted. |
+const int kAlwaysTranslateMinCount = 1; |
+const int kNeverTranslateMinCount = 2; |
#else |
- const int kAlwaysTranslateMinCount = 3; |
- const int kNeverTranslateMinCount = 3; |
+const int kAlwaysTranslateMinCount = 3; |
+const int kNeverTranslateMinCount = 3; |
#endif |
} // namespace |
@@ -109,7 +107,6 @@ void TranslateInfoBarDelegate::Create( |
infobar_manager->AddInfoBar(infobar.Pass()); |
} |
- |
void TranslateInfoBarDelegate::UpdateOriginalLanguageIndex( |
size_t language_index) { |
ui_delegate_.UpdateOriginalLanguageIndex(language_index); |
@@ -186,7 +183,7 @@ void TranslateInfoBarDelegate::AlwaysTranslatePageLanguage() { |
void TranslateInfoBarDelegate::NeverTranslatePageLanguage() { |
DCHECK(!ui_delegate_.IsLanguageBlocked()); |
ui_delegate_.SetLanguageBlocked(true); |
- infobar()->RemoveSelf(); |
+ infobar()->RemoveSelf(); |
} |
base::string16 TranslateInfoBarDelegate::GetMessageInfoBarText() { |
@@ -360,7 +357,7 @@ void TranslateInfoBarDelegate::InfoBarDismissed() { |
} |
int TranslateInfoBarDelegate::GetIconID() const { |
- return IDR_INFOBAR_TRANSLATE; |
+ return translate_manager_->translate_client()->GetInfobarIconID(); |
} |
infobars::InfoBarDelegate::Type TranslateInfoBarDelegate::GetInfoBarType() |