summaryrefslogtreecommitdiffstats
path: root/chrome/browser/autofill
diff options
context:
space:
mode:
authortwiz@google.com <twiz@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2010-08-12 21:24:59 +0000
committertwiz@google.com <twiz@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2010-08-12 21:24:59 +0000
commitb283a75393c7c54e33ca7d25f9eec55ac6a2960b (patch)
treef18455820a1e47b5da8602f7ebc0a99296866e11 /chrome/browser/autofill
parent8e07d29abff1de820b4ca5105534f3bcc6a0510d (diff)
downloadchromium_src-b283a75393c7c54e33ca7d25f9eec55ac6a2960b.zip
chromium_src-b283a75393c7c54e33ca7d25f9eec55ac6a2960b.tar.gz
chromium_src-b283a75393c7c54e33ca7d25f9eec55ac6a2960b.tar.bz2
Clone of issue 2941001. See initial review below.
http://codereview.chromium.org/2941001 Initial submit broke the chromeos build. This patch includes the original change, and fixes to compile ChromeOs properly. BUG=None TEST=None Review URL: http://codereview.chromium.org/2819086 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@55951 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/autofill')
-rw-r--r--chrome/browser/autofill/autofill_cc_infobar_delegate.cc13
-rw-r--r--chrome/browser/autofill/autofill_cc_infobar_delegate.h4
-rw-r--r--chrome/browser/autofill/autofill_manager.h3
3 files changed, 6 insertions, 14 deletions
diff --git a/chrome/browser/autofill/autofill_cc_infobar_delegate.cc b/chrome/browser/autofill/autofill_cc_infobar_delegate.cc
index 89c17ba..7953d86 100644
--- a/chrome/browser/autofill/autofill_cc_infobar_delegate.cc
+++ b/chrome/browser/autofill/autofill_cc_infobar_delegate.cc
@@ -9,7 +9,6 @@
#include "base/histogram.h"
#include "chrome/browser/autofill/autofill_cc_infobar.h"
#include "chrome/browser/autofill/autofill_manager.h"
-#include "chrome/browser/browser.h"
#include "chrome/browser/pref_service.h"
#include "chrome/browser/profile.h"
#include "chrome/browser/tab_contents/tab_contents.h"
@@ -23,15 +22,9 @@
AutoFillCCInfoBarDelegate::AutoFillCCInfoBarDelegate(TabContents* tab_contents,
AutoFillManager* host)
: ConfirmInfoBarDelegate(tab_contents),
- browser_(NULL),
host_(host) {
- if (tab_contents) {
- // This is NULL for TestTabContents.
- if (tab_contents->delegate())
- browser_ = tab_contents->delegate()->GetBrowser();
-
+ if (tab_contents)
tab_contents->AddInfoBar(this);
- }
}
AutoFillCCInfoBarDelegate::~AutoFillCCInfoBarDelegate() {
@@ -103,8 +96,8 @@ std::wstring AutoFillCCInfoBarDelegate::GetLinkText() {
}
bool AutoFillCCInfoBarDelegate::LinkClicked(WindowOpenDisposition disposition) {
- browser_->OpenURL(GURL(kAutoFillLearnMoreUrl), GURL(), NEW_FOREGROUND_TAB,
- PageTransition::TYPED);
+ host_->tab_contents()->OpenURL(GURL(kAutoFillLearnMoreUrl), GURL(),
+ NEW_FOREGROUND_TAB, PageTransition::TYPED);
return false;
}
diff --git a/chrome/browser/autofill/autofill_cc_infobar_delegate.h b/chrome/browser/autofill/autofill_cc_infobar_delegate.h
index 32a7c82..6a8091e 100644
--- a/chrome/browser/autofill/autofill_cc_infobar_delegate.h
+++ b/chrome/browser/autofill/autofill_cc_infobar_delegate.h
@@ -11,7 +11,6 @@
#include "chrome/browser/tab_contents/infobar_delegate.h"
class AutoFillManager;
-class Browser;
class SkBitmap;
class TabContents;
@@ -46,9 +45,6 @@ class AutoFillCCInfoBarDelegate : public ConfirmInfoBarDelegate {
}
private:
- // The browser.
- Browser* browser_;
-
// The AutoFillManager that initiated this InfoBar.
AutoFillManager* host_;
diff --git a/chrome/browser/autofill/autofill_manager.h b/chrome/browser/autofill/autofill_manager.h
index 964b8bc..4858a5e 100644
--- a/chrome/browser/autofill/autofill_manager.h
+++ b/chrome/browser/autofill/autofill_manager.h
@@ -45,6 +45,9 @@ class AutoFillManager : public RenderViewHostDelegate::AutoFill,
// Registers our Enable/Disable AutoFill pref.
static void RegisterUserPrefs(PrefService* prefs);
+ // Returns the TabContents hosting this AutoFillManager.
+ TabContents* tab_contents() const { return tab_contents_; }
+
// RenderViewHostDelegate::AutoFill implementation:
virtual void FormSubmitted(const webkit_glue::FormData& form);
virtual void FormsSeen(const std::vector<webkit_glue::FormData>& forms);