OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "components/translate/core/browser/translate_infobar_delegate.h" | 5 #include "components/translate/core/browser/translate_infobar_delegate.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <utility> | 8 #include <utility> |
9 | 9 |
10 #include "base/i18n/string_compare.h" | 10 #include "base/i18n/string_compare.h" |
11 #include "base/memory/ptr_util.h" | 11 #include "base/memory/ptr_util.h" |
12 #include "base/metrics/histogram_macros.h" | 12 #include "base/metrics/histogram_macros.h" |
13 #include "build/build_config.h" | 13 #include "build/build_config.h" |
14 #include "components/infobars/core/infobar.h" | 14 #include "components/infobars/core/infobar.h" |
15 #include "components/infobars/core/infobar_manager.h" | 15 #include "components/infobars/core/infobar_manager.h" |
| 16 #include "components/strings/grit/components_strings.h" |
16 #include "components/translate/core/browser/language_state.h" | 17 #include "components/translate/core/browser/language_state.h" |
17 #include "components/translate/core/browser/translate_accept_languages.h" | 18 #include "components/translate/core/browser/translate_accept_languages.h" |
18 #include "components/translate/core/browser/translate_client.h" | 19 #include "components/translate/core/browser/translate_client.h" |
19 #include "components/translate/core/browser/translate_download_manager.h" | 20 #include "components/translate/core/browser/translate_download_manager.h" |
20 #include "components/translate/core/browser/translate_driver.h" | 21 #include "components/translate/core/browser/translate_driver.h" |
21 #include "components/translate/core/browser/translate_manager.h" | 22 #include "components/translate/core/browser/translate_manager.h" |
22 #include "components/translate/core/common/translate_constants.h" | 23 #include "components/translate/core/common/translate_constants.h" |
23 #include "grit/components_strings.h" | |
24 #include "ui/base/l10n/l10n_util.h" | 24 #include "ui/base/l10n/l10n_util.h" |
25 | 25 |
26 namespace translate { | 26 namespace translate { |
27 | 27 |
28 namespace { | 28 namespace { |
29 | 29 |
30 // Counts used to decide whether infobars should be shown. | 30 // Counts used to decide whether infobars should be shown. |
31 // Android and iOS implementations do not offer a drop down (for space reasons), | 31 // Android and iOS implementations do not offer a drop down (for space reasons), |
32 // so we are more aggressive about showing the shortcut to never translate. | 32 // so we are more aggressive about showing the shortcut to never translate. |
33 // The "Always Translate" option is always shown on iOS and Android. | 33 // The "Always Translate" option is always shown on iOS and Android. |
(...skipping 338 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
372 TranslationDeclined(); | 372 TranslationDeclined(); |
373 UMA_HISTOGRAM_BOOLEAN("Translate.DeclineTranslateCloseInfobar", true); | 373 UMA_HISTOGRAM_BOOLEAN("Translate.DeclineTranslateCloseInfobar", true); |
374 } | 374 } |
375 | 375 |
376 TranslateInfoBarDelegate* | 376 TranslateInfoBarDelegate* |
377 TranslateInfoBarDelegate::AsTranslateInfoBarDelegate() { | 377 TranslateInfoBarDelegate::AsTranslateInfoBarDelegate() { |
378 return this; | 378 return this; |
379 } | 379 } |
380 | 380 |
381 } // namespace translate | 381 } // namespace translate |
OLD | NEW |