| 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_infobar_delegate.h" | 5 #include "chrome/browser/translate/translate_infobar_delegate.h" | 
| 6 | 6 | 
| 7 #include <algorithm> | 7 #include <algorithm> | 
| 8 | 8 | 
| 9 #include "base/metrics/histogram.h" | 9 #include "base/metrics/histogram.h" | 
| 10 #include "chrome/browser/browser_process.h" | 10 #include "chrome/browser/browser_process.h" | 
| 11 #include "chrome/browser/profiles/profile.h" | 11 #include "chrome/browser/profiles/profile.h" | 
| 12 #include "chrome/browser/translate/translate_infobar_view.h" | 12 #include "chrome/browser/translate/translate_infobar_view.h" | 
| 13 #include "chrome/browser/translate/translate_manager.h" | 13 #include "chrome/browser/translate/translate_manager.h" | 
| 14 #include "chrome/browser/translate/translate_tab_helper.h" | 14 #include "chrome/browser/translate/translate_tab_helper.h" | 
| 15 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" | 15 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" | 
| 16 #include "chrome/common/chrome_constants.h" | 16 #include "chrome/common/chrome_constants.h" | 
| 17 #include "content/browser/tab_contents/tab_contents.h" | 17 #include "content/browser/tab_contents/tab_contents.h" | 
| 18 #include "grit/generated_resources.h" | 18 #include "grit/generated_resources.h" | 
| 19 #include "grit/theme_resources.h" | 19 #include "grit/theme_resources_standard.h" | 
| 20 #include "ui/base/l10n/l10n_util.h" | 20 #include "ui/base/l10n/l10n_util.h" | 
| 21 #include "ui/base/resource/resource_bundle.h" | 21 #include "ui/base/resource/resource_bundle.h" | 
| 22 | 22 | 
| 23 // static | 23 // static | 
| 24 const size_t TranslateInfoBarDelegate::kNoIndex = static_cast<size_t>(-1); | 24 const size_t TranslateInfoBarDelegate::kNoIndex = static_cast<size_t>(-1); | 
| 25 | 25 | 
| 26 // static | 26 // static | 
| 27 TranslateInfoBarDelegate* TranslateInfoBarDelegate::CreateDelegate( | 27 TranslateInfoBarDelegate* TranslateInfoBarDelegate::CreateDelegate( | 
| 28     Type type, | 28     Type type, | 
| 29     TabContents* tab_contents, | 29     TabContents* tab_contents, | 
| (...skipping 344 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 374 | 374 | 
| 375 TranslateInfoBarDelegate* | 375 TranslateInfoBarDelegate* | 
| 376     TranslateInfoBarDelegate::AsTranslateInfoBarDelegate() { | 376     TranslateInfoBarDelegate::AsTranslateInfoBarDelegate() { | 
| 377   return this; | 377   return this; | 
| 378 } | 378 } | 
| 379 | 379 | 
| 380 std::string TranslateInfoBarDelegate::GetPageHost() { | 380 std::string TranslateInfoBarDelegate::GetPageHost() { | 
| 381   NavigationEntry* entry = tab_contents_->controller().GetActiveEntry(); | 381   NavigationEntry* entry = tab_contents_->controller().GetActiveEntry(); | 
| 382   return entry ? entry->url().HostNoBrackets() : std::string(); | 382   return entry ? entry->url().HostNoBrackets() : std::string(); | 
| 383 } | 383 } | 
| OLD | NEW | 
|---|