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/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
9 #include "base/histogram.h" | 9 #include "base/histogram.h" |
10 #include "base/string_util.h" | 10 #include "base/string_util.h" |
(...skipping 438 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
449 report_error_url += | 449 report_error_url += |
450 GetLanguageCode(g_browser_process->GetApplicationLocale()); | 450 GetLanguageCode(g_browser_process->GetApplicationLocale()); |
451 // Open that URL in a new tab so that the user can tell us more. | 451 // Open that URL in a new tab so that the user can tell us more. |
452 Browser* browser = BrowserList::GetLastActive(); | 452 Browser* browser = BrowserList::GetLastActive(); |
453 if (!browser) { | 453 if (!browser) { |
454 NOTREACHED(); | 454 NOTREACHED(); |
455 return; | 455 return; |
456 } | 456 } |
457 browser->AddTabWithURL(GURL(report_error_url), GURL(), | 457 browser->AddTabWithURL(GURL(report_error_url), GURL(), |
458 PageTransition::AUTO_BOOKMARK, -1, | 458 PageTransition::AUTO_BOOKMARK, -1, |
459 TabStripModel::ADD_SELECTED, NULL, std::string()); | 459 TabStripModel::ADD_SELECTED, NULL, std::string(), |
| 460 NULL); |
460 } | 461 } |
461 | 462 |
462 void TranslateManager::DoTranslatePage(TabContents* tab, | 463 void TranslateManager::DoTranslatePage(TabContents* tab, |
463 const std::string& translate_script, | 464 const std::string& translate_script, |
464 const std::string& source_lang, | 465 const std::string& source_lang, |
465 const std::string& target_lang) { | 466 const std::string& target_lang) { |
466 NavigationEntry* entry = tab->controller().GetActiveEntry(); | 467 NavigationEntry* entry = tab->controller().GetActiveEntry(); |
467 if (!entry) { | 468 if (!entry) { |
468 NOTREACHED(); | 469 NOTREACHED(); |
469 return; | 470 return; |
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
586 TranslateInfoBarDelegate* TranslateManager::GetTranslateInfoBarDelegate( | 587 TranslateInfoBarDelegate* TranslateManager::GetTranslateInfoBarDelegate( |
587 TabContents* tab) { | 588 TabContents* tab) { |
588 for (int i = 0; i < tab->infobar_delegate_count(); ++i) { | 589 for (int i = 0; i < tab->infobar_delegate_count(); ++i) { |
589 TranslateInfoBarDelegate* delegate = | 590 TranslateInfoBarDelegate* delegate = |
590 tab->GetInfoBarDelegateAt(i)->AsTranslateInfoBarDelegate(); | 591 tab->GetInfoBarDelegateAt(i)->AsTranslateInfoBarDelegate(); |
591 if (delegate) | 592 if (delegate) |
592 return delegate; | 593 return delegate; |
593 } | 594 } |
594 return NULL; | 595 return NULL; |
595 } | 596 } |
OLD | NEW |