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; | 45 const size_t TranslateInfoBarDelegate::kNoIndex = TranslateUIDelegate::kNoIndex; |
46 | 46 |
47 TranslateInfoBarDelegate::~TranslateInfoBarDelegate() { | 47 TranslateInfoBarDelegate::~TranslateInfoBarDelegate() { |
48 } | 48 } |
49 | 49 |
50 // static | 50 // static |
51 void TranslateInfoBarDelegate::Create( | 51 void TranslateInfoBarDelegate::Create( |
52 bool replace_existing_infobar, | 52 bool replace_existing_infobar, |
53 const base::WeakPtr<TranslateManager>& translate_manager, | 53 const base::WeakPtr<TranslateManager>& translate_manager, |
54 infobars::InfoBarManager* infobar_manager, | 54 infobars::InfoBarManager* infobar_manager, |
55 bool is_off_the_record, | 55 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) | 359 if (!details.is_navigation_to_different_page && !details.is_main_frame) |
360 return false; | 360 return false; |
361 | 361 |
362 return infobars::InfoBarDelegate::ShouldExpireInternal(details); | 362 return infobars::InfoBarDelegate::ShouldExpireInternal(details); |
363 } | 363 } |
364 | 364 |
365 TranslateInfoBarDelegate* | 365 TranslateInfoBarDelegate* |
366 TranslateInfoBarDelegate::AsTranslateInfoBarDelegate() { | 366 TranslateInfoBarDelegate::AsTranslateInfoBarDelegate() { |
367 return this; | 367 return this; |
368 } | 368 } |
OLD | NEW |