| 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 | 8 |
| 9 #include "base/i18n/string_compare.h" | 9 #include "base/i18n/string_compare.h" |
| 10 #include "base/metrics/histogram.h" | 10 #include "base/metrics/histogram.h" |
| (...skipping 24 matching lines...) Expand all Loading... |
| 35 // Android the last event is not counted. | 35 // Android the last event is not counted. |
| 36 const int kAlwaysTranslateMinCount = 1; | 36 const int kAlwaysTranslateMinCount = 1; |
| 37 const int kNeverTranslateMinCount = 2; | 37 const int kNeverTranslateMinCount = 2; |
| 38 #else | 38 #else |
| 39 const int kAlwaysTranslateMinCount = 3; | 39 const int kAlwaysTranslateMinCount = 3; |
| 40 const int kNeverTranslateMinCount = 3; | 40 const int kNeverTranslateMinCount = 3; |
| 41 #endif | 41 #endif |
| 42 | 42 |
| 43 } // namespace | 43 } // namespace |
| 44 | 44 |
| 45 const size_t TranslateInfoBarDelegate::kNoIndex = TranslateUIDelegate::NO_INDEX; | |
| 46 | 45 |
| 47 TranslateInfoBarDelegate::~TranslateInfoBarDelegate() { | 46 TranslateInfoBarDelegate::~TranslateInfoBarDelegate() { |
| 48 } | 47 } |
| 49 | 48 |
| 50 // static | 49 // static |
| 51 void TranslateInfoBarDelegate::Create( | 50 void TranslateInfoBarDelegate::Create( |
| 52 bool replace_existing_infobar, | 51 bool replace_existing_infobar, |
| 53 const base::WeakPtr<TranslateManager>& translate_manager, | 52 const base::WeakPtr<TranslateManager>& translate_manager, |
| 54 infobars::InfoBarManager* infobar_manager, | 53 infobars::InfoBarManager* infobar_manager, |
| 55 bool is_off_the_record, | 54 bool is_off_the_record, |
| (...skipping 303 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 359 if (!details.is_navigation_to_different_page && !details.is_main_frame) | 358 if (!details.is_navigation_to_different_page && !details.is_main_frame) |
| 360 return false; | 359 return false; |
| 361 | 360 |
| 362 return infobars::InfoBarDelegate::ShouldExpireInternal(details); | 361 return infobars::InfoBarDelegate::ShouldExpireInternal(details); |
| 363 } | 362 } |
| 364 | 363 |
| 365 TranslateInfoBarDelegate* | 364 TranslateInfoBarDelegate* |
| 366 TranslateInfoBarDelegate::AsTranslateInfoBarDelegate() { | 365 TranslateInfoBarDelegate::AsTranslateInfoBarDelegate() { |
| 367 return this; | 366 return this; |
| 368 } | 367 } |
| OLD | NEW |