| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "base/bind.h" | 7 #include "base/bind.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/json/json_reader.h" | 10 #include "base/json/json_reader.h" |
| (...skipping 880 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 891 } | 891 } |
| 892 | 892 |
| 893 // static | 893 // static |
| 894 TranslateInfoBarDelegate* TranslateManager::GetTranslateInfoBarDelegate( | 894 TranslateInfoBarDelegate* TranslateManager::GetTranslateInfoBarDelegate( |
| 895 WebContents* web_contents) { | 895 WebContents* web_contents) { |
| 896 TabContents* tab_contents = TabContents::FromWebContents(web_contents); | 896 TabContents* tab_contents = TabContents::FromWebContents(web_contents); |
| 897 if (!tab_contents) | 897 if (!tab_contents) |
| 898 return NULL; | 898 return NULL; |
| 899 InfoBarTabHelper* infobar_helper = tab_contents->infobar_tab_helper(); | 899 InfoBarTabHelper* infobar_helper = tab_contents->infobar_tab_helper(); |
| 900 | 900 |
| 901 for (size_t i = 0; i < infobar_helper->infobar_count(); ++i) { | 901 for (size_t i = 0; i < infobar_helper->GetInfoBarCount(); ++i) { |
| 902 TranslateInfoBarDelegate* delegate = | 902 TranslateInfoBarDelegate* delegate = |
| 903 infobar_helper->GetInfoBarDelegateAt(i)->AsTranslateInfoBarDelegate(); | 903 infobar_helper->GetInfoBarDelegateAt(i)->AsTranslateInfoBarDelegate(); |
| 904 if (delegate) | 904 if (delegate) |
| 905 return delegate; | 905 return delegate; |
| 906 } | 906 } |
| 907 return NULL; | 907 return NULL; |
| 908 } | 908 } |
| OLD | NEW |