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 470 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
481 } | 481 } |
482 pending_requests_.clear(); | 482 pending_requests_.clear(); |
483 } else { // if (translate_script_request_pending_.get() == source) | 483 } else { // if (translate_script_request_pending_.get() == source) |
484 scoped_ptr<const net::URLFetcher> delete_ptr( | 484 scoped_ptr<const net::URLFetcher> delete_ptr( |
485 language_list_request_pending_.release()); | 485 language_list_request_pending_.release()); |
486 if (!error) { | 486 if (!error) { |
487 std::string data; | 487 std::string data; |
488 source->GetResponseAsString(&data); | 488 source->GetResponseAsString(&data); |
489 SetSupportedLanguages(data); | 489 SetSupportedLanguages(data); |
490 } else { | 490 } else { |
491 VLOG(1) << "Failed to Fetch languages from: " << kLanguageListFetchURL; | 491 VLOG(9) << "Failed to Fetch languages from: " << kLanguageListFetchURL; |
492 } | 492 } |
493 } | 493 } |
494 } | 494 } |
495 | 495 |
496 // static | 496 // static |
497 bool TranslateManager::IsShowingTranslateInfobar(WebContents* web_contents) { | 497 bool TranslateManager::IsShowingTranslateInfobar(WebContents* web_contents) { |
498 return GetTranslateInfoBarDelegate(web_contents) != NULL; | 498 return GetTranslateInfoBarDelegate(web_contents) != NULL; |
499 } | 499 } |
500 | 500 |
501 TranslateManager::TranslateManager() | 501 TranslateManager::TranslateManager() |
(...skipping 397 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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->infobar_count(); ++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 |