summaryrefslogtreecommitdiffstats
path: root/chrome/browser/translate/translate_infobar_delegate.h
diff options
context:
space:
mode:
authoravi@chromium.org <avi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-09-30 15:07:08 +0000
committeravi@chromium.org <avi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-09-30 15:07:08 +0000
commit95a33ed6cb8688573249f7cd7032d23518879c6d (patch)
tree77c2f8d28412caa3aeb6cdb94de420bb811113d6 /chrome/browser/translate/translate_infobar_delegate.h
parent14ea9bf12826e740fd77fda742e67605df06ce4a (diff)
downloadchromium_src-95a33ed6cb8688573249f7cd7032d23518879c6d.zip
chromium_src-95a33ed6cb8688573249f7cd7032d23518879c6d.tar.gz
chromium_src-95a33ed6cb8688573249f7cd7032d23518879c6d.tar.bz2
Move infobar handling to a tab helper.
Part 2: - Removed TabContentsWrapper from core infobar classes - Made InfoBarTabHelper the owner of the infobar delegates - Removed all owner references from the delegate subclasses BUG=94741 TEST=no visible change Review URL: http://codereview.chromium.org/7862003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@103463 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/translate/translate_infobar_delegate.h')
-rw-r--r--chrome/browser/translate/translate_infobar_delegate.h18
1 files changed, 9 insertions, 9 deletions
diff --git a/chrome/browser/translate/translate_infobar_delegate.h b/chrome/browser/translate/translate_infobar_delegate.h
index 6010d4e..0670bfc 100644
--- a/chrome/browser/translate/translate_infobar_delegate.h
+++ b/chrome/browser/translate/translate_infobar_delegate.h
@@ -10,10 +10,11 @@
#include <vector>
#include "base/compiler_specific.h"
-#include "chrome/browser/tab_contents/infobar_delegate.h"
+#include "chrome/browser/infobars/infobar_delegate.h"
#include "chrome/browser/translate/translate_prefs.h"
#include "chrome/common/translate_errors.h"
+class PrefService;
class SkBitmap;
class TranslateInfoBarView;
@@ -44,14 +45,16 @@ class TranslateInfoBarDelegate : public InfoBarDelegate {
// |originalLanguage| == kUnknownLanguageCode.
static TranslateInfoBarDelegate* CreateDelegate(
Type infobar_type,
- TabContents* tab_contents,
+ InfoBarTabHelper* infobar_helper,
+ PrefService* prefs,
const std::string& original_language,
const std::string& target_language);
// Factory method to create an error translate infobar.
static TranslateInfoBarDelegate* CreateErrorDelegate(
TranslateErrors::Type error_type,
- TabContents* tab_contents,
+ InfoBarTabHelper* infobar_helper,
+ PrefService* prefs,
const std::string& original_language,
const std::string& target_language);
@@ -66,8 +69,6 @@ class TranslateInfoBarDelegate : public InfoBarDelegate {
// Returns the displayable name for the language at |index|.
string16 GetLanguageDisplayableNameAt(size_t index) const;
- TabContents* tab_contents() const { return tab_contents_; }
-
Type type() const { return type_; }
TranslateErrors::Type error() const { return error_; }
@@ -152,7 +153,8 @@ class TranslateInfoBarDelegate : public InfoBarDelegate {
// For testing.
TranslateInfoBarDelegate(Type infobar_type,
TranslateErrors::Type error,
- TabContents* tab_contents,
+ InfoBarTabHelper* infobar_helper,
+ PrefService* prefs,
const std::string& original_language,
const std::string& target_language);
Type type_;
@@ -161,7 +163,7 @@ class TranslateInfoBarDelegate : public InfoBarDelegate {
typedef std::pair<std::string, string16> LanguageNamePair;
// InfoBarDelegate:
- virtual InfoBar* CreateInfoBar(TabContentsWrapper* owner) OVERRIDE;
+ virtual InfoBar* CreateInfoBar(InfoBarTabHelper* infobar_helper) OVERRIDE;
virtual void InfoBarDismissed() OVERRIDE;
virtual gfx::Image* GetIcon() const OVERRIDE;
virtual InfoBarDelegate::Type GetInfoBarType() const OVERRIDE;
@@ -177,8 +179,6 @@ class TranslateInfoBarDelegate : public InfoBarDelegate {
// infobar.
BackgroundAnimationType background_animation_;
- TabContents* tab_contents_;
-
// The list supported languages for translation.
// The pair first string is the language ISO code (ex: en, fr...), the second
// string is the displayable name on the current locale.