OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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" | 7 #include "app/resource_bundle.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
10 #include "base/metrics/histogram.h" | 10 #include "base/metrics/histogram.h" |
11 #include "base/string_split.h" | 11 #include "base/string_split.h" |
12 #include "base/string_util.h" | 12 #include "base/string_util.h" |
13 #include "chrome/browser/browser.h" | |
14 #include "chrome/browser/browser_list.h" | 13 #include "chrome/browser/browser_list.h" |
15 #include "chrome/browser/browser_process.h" | 14 #include "chrome/browser/browser_process.h" |
16 #include "chrome/browser/prefs/pref_service.h" | 15 #include "chrome/browser/prefs/pref_service.h" |
17 #include "chrome/browser/profile.h" | 16 #include "chrome/browser/profile.h" |
18 #include "chrome/browser/renderer_host/render_process_host.h" | 17 #include "chrome/browser/renderer_host/render_process_host.h" |
19 #include "chrome/browser/renderer_host/render_view_host.h" | 18 #include "chrome/browser/renderer_host/render_view_host.h" |
20 #include "chrome/browser/tab_contents/language_state.h" | 19 #include "chrome/browser/tab_contents/language_state.h" |
21 #include "chrome/browser/tab_contents/navigation_controller.h" | 20 #include "chrome/browser/tab_contents/navigation_controller.h" |
22 #include "chrome/browser/tab_contents/navigation_entry.h" | 21 #include "chrome/browser/tab_contents/navigation_entry.h" |
23 #include "chrome/browser/tab_contents/tab_contents.h" | 22 #include "chrome/browser/tab_contents/tab_contents.h" |
24 #include "chrome/browser/tab_contents/tab_util.h" | 23 #include "chrome/browser/tab_contents/tab_util.h" |
25 #include "chrome/browser/tabs/tab_strip_model.h" | 24 #include "chrome/browser/tabs/tab_strip_model.h" |
26 #include "chrome/browser/translate/page_translated_details.h" | 25 #include "chrome/browser/translate/page_translated_details.h" |
27 #include "chrome/browser/translate/translate_infobar_delegate.h" | 26 #include "chrome/browser/translate/translate_infobar_delegate.h" |
28 #include "chrome/browser/translate/translate_prefs.h" | 27 #include "chrome/browser/translate/translate_prefs.h" |
| 28 #include "chrome/browser/ui/browser.h" |
29 #include "chrome/common/chrome_switches.h" | 29 #include "chrome/common/chrome_switches.h" |
30 #include "chrome/common/notification_details.h" | 30 #include "chrome/common/notification_details.h" |
31 #include "chrome/common/notification_service.h" | 31 #include "chrome/common/notification_service.h" |
32 #include "chrome/common/notification_source.h" | 32 #include "chrome/common/notification_source.h" |
33 #include "chrome/common/notification_type.h" | 33 #include "chrome/common/notification_type.h" |
34 #include "chrome/common/pref_names.h" | 34 #include "chrome/common/pref_names.h" |
35 #include "chrome/common/translate_errors.h" | 35 #include "chrome/common/translate_errors.h" |
36 #include "grit/browser_resources.h" | 36 #include "grit/browser_resources.h" |
37 #include "net/base/escape.h" | 37 #include "net/base/escape.h" |
38 #include "net/url_request/url_request_status.h" | 38 #include "net/url_request/url_request_status.h" |
(...skipping 571 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
610 TranslateInfoBarDelegate* TranslateManager::GetTranslateInfoBarDelegate( | 610 TranslateInfoBarDelegate* TranslateManager::GetTranslateInfoBarDelegate( |
611 TabContents* tab) { | 611 TabContents* tab) { |
612 for (int i = 0; i < tab->infobar_delegate_count(); ++i) { | 612 for (int i = 0; i < tab->infobar_delegate_count(); ++i) { |
613 TranslateInfoBarDelegate* delegate = | 613 TranslateInfoBarDelegate* delegate = |
614 tab->GetInfoBarDelegateAt(i)->AsTranslateInfoBarDelegate(); | 614 tab->GetInfoBarDelegateAt(i)->AsTranslateInfoBarDelegate(); |
615 if (delegate) | 615 if (delegate) |
616 return delegate; | 616 return delegate; |
617 } | 617 } |
618 return NULL; | 618 return NULL; |
619 } | 619 } |
OLD | NEW |