| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "chrome/browser/translate/translate_manager.h" | 5 #include "chrome/browser/translate/translate_manager.h" |
| 6 | 6 |
| 7 #include "app/resource_bundle.h" | |
| 8 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 9 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
| 10 #include "base/metrics/histogram.h" | 9 #include "base/metrics/histogram.h" |
| 11 #include "base/singleton.h" | 10 #include "base/singleton.h" |
| 12 #include "base/string_split.h" | 11 #include "base/string_split.h" |
| 13 #include "base/string_util.h" | 12 #include "base/string_util.h" |
| 14 #include "chrome/browser/autofill/autofill_manager.h" | 13 #include "chrome/browser/autofill/autofill_manager.h" |
| 15 #include "chrome/browser/browser_list.h" | 14 #include "chrome/browser/browser_list.h" |
| 16 #include "chrome/browser/browser_process.h" | 15 #include "chrome/browser/browser_process.h" |
| 17 #include "chrome/browser/prefs/pref_service.h" | 16 #include "chrome/browser/prefs/pref_service.h" |
| (...skipping 14 matching lines...) Expand all Loading... |
| 32 #include "chrome/common/notification_details.h" | 31 #include "chrome/common/notification_details.h" |
| 33 #include "chrome/common/notification_service.h" | 32 #include "chrome/common/notification_service.h" |
| 34 #include "chrome/common/notification_source.h" | 33 #include "chrome/common/notification_source.h" |
| 35 #include "chrome/common/notification_type.h" | 34 #include "chrome/common/notification_type.h" |
| 36 #include "chrome/common/pref_names.h" | 35 #include "chrome/common/pref_names.h" |
| 37 #include "chrome/common/translate_errors.h" | 36 #include "chrome/common/translate_errors.h" |
| 38 #include "chrome/common/url_constants.h" | 37 #include "chrome/common/url_constants.h" |
| 39 #include "grit/browser_resources.h" | 38 #include "grit/browser_resources.h" |
| 40 #include "net/base/escape.h" | 39 #include "net/base/escape.h" |
| 41 #include "net/url_request/url_request_status.h" | 40 #include "net/url_request/url_request_status.h" |
| 41 #include "ui/base/resource/resource_bundle.h" |
| 42 | 42 |
| 43 namespace { | 43 namespace { |
| 44 | 44 |
| 45 // Mapping from a locale name to a language code name. | 45 // Mapping from a locale name to a language code name. |
| 46 // Locale names not included are translated as is. | 46 // Locale names not included are translated as is. |
| 47 struct LocaleToCLDLanguage { | 47 struct LocaleToCLDLanguage { |
| 48 const char* locale_language; // Language Chrome locale is in. | 48 const char* locale_language; // Language Chrome locale is in. |
| 49 const char* cld_language; // Language the CLD reports. | 49 const char* cld_language; // Language the CLD reports. |
| 50 }; | 50 }; |
| 51 LocaleToCLDLanguage kLocaleToCLDLanguages[] = { | 51 LocaleToCLDLanguage kLocaleToCLDLanguages[] = { |
| (...skipping 580 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 632 TranslateInfoBarDelegate* TranslateManager::GetTranslateInfoBarDelegate( | 632 TranslateInfoBarDelegate* TranslateManager::GetTranslateInfoBarDelegate( |
| 633 TabContents* tab) { | 633 TabContents* tab) { |
| 634 for (int i = 0; i < tab->infobar_delegate_count(); ++i) { | 634 for (int i = 0; i < tab->infobar_delegate_count(); ++i) { |
| 635 TranslateInfoBarDelegate* delegate = | 635 TranslateInfoBarDelegate* delegate = |
| 636 tab->GetInfoBarDelegateAt(i)->AsTranslateInfoBarDelegate(); | 636 tab->GetInfoBarDelegateAt(i)->AsTranslateInfoBarDelegate(); |
| 637 if (delegate) | 637 if (delegate) |
| 638 return delegate; | 638 return delegate; |
| 639 } | 639 } |
| 640 return NULL; | 640 return NULL; |
| 641 } | 641 } |
| OLD | NEW |