diff options
author | nick@chromium.org <nick@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-08-02 18:24:53 +0000 |
---|---|---|
committer | nick@chromium.org <nick@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-08-02 18:24:53 +0000 |
commit | 9155324b8d7e4b465553e42366319a4e1587ac20 (patch) | |
tree | 6faecbce10a5163ab46782cf654e49c937ce6e1a /chrome/browser/autofill | |
parent | c60bf3db722742386dcf4f8c9dc86e7a812688b7 (diff) | |
download | chromium_src-9155324b8d7e4b465553e42366319a4e1587ac20.zip chromium_src-9155324b8d7e4b465553e42366319a4e1587ac20.tar.gz chromium_src-9155324b8d7e4b465553e42366319a4e1587ac20.tar.bz2 |
Revert 54560 -
Change removing method, GetBrowser from TabContentsDelegate, as this was breaking an abstraction layer. This routine was originally added in CL 434046, which required the Browser* to construct extension popup views from within Chrome-Frame instances.
I changed all accesses to Browser instances from usage of the above method, to either iterating the BrowserList using the situation-specific profile as a search key, or modifying the appropriate delegate interfaces to provide the functionality that was previously used directly via the Browser.
BUG=None
TEST=None
Review URL: http://codereview.chromium.org/2941001
TBR=twiz@google.com
Review URL: http://codereview.chromium.org/3012042
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@54565 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/autofill')
-rw-r--r-- | chrome/browser/autofill/autofill_cc_infobar_delegate.cc | 13 | ||||
-rw-r--r-- | chrome/browser/autofill/autofill_cc_infobar_delegate.h | 4 | ||||
-rw-r--r-- | chrome/browser/autofill/autofill_manager.h | 3 |
3 files changed, 14 insertions, 6 deletions
diff --git a/chrome/browser/autofill/autofill_cc_infobar_delegate.cc b/chrome/browser/autofill/autofill_cc_infobar_delegate.cc index 7953d86..89c17ba 100644 --- a/chrome/browser/autofill/autofill_cc_infobar_delegate.cc +++ b/chrome/browser/autofill/autofill_cc_infobar_delegate.cc @@ -9,6 +9,7 @@ #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" @@ -22,9 +23,15 @@ AutoFillCCInfoBarDelegate::AutoFillCCInfoBarDelegate(TabContents* tab_contents, AutoFillManager* host) : ConfirmInfoBarDelegate(tab_contents), + browser_(NULL), host_(host) { - if (tab_contents) + if (tab_contents) { + // This is NULL for TestTabContents. + if (tab_contents->delegate()) + browser_ = tab_contents->delegate()->GetBrowser(); + tab_contents->AddInfoBar(this); + } } AutoFillCCInfoBarDelegate::~AutoFillCCInfoBarDelegate() { @@ -96,8 +103,8 @@ std::wstring AutoFillCCInfoBarDelegate::GetLinkText() { } bool AutoFillCCInfoBarDelegate::LinkClicked(WindowOpenDisposition disposition) { - host_->tab_contents()->OpenURL(GURL(kAutoFillLearnMoreUrl), GURL(), - NEW_FOREGROUND_TAB, PageTransition::TYPED); + browser_->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 6a8091e..32a7c82 100644 --- a/chrome/browser/autofill/autofill_cc_infobar_delegate.h +++ b/chrome/browser/autofill/autofill_cc_infobar_delegate.h @@ -11,6 +11,7 @@ #include "chrome/browser/tab_contents/infobar_delegate.h" class AutoFillManager; +class Browser; class SkBitmap; class TabContents; @@ -45,6 +46,9 @@ 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 4858a5e..964b8bc 100644 --- a/chrome/browser/autofill/autofill_manager.h +++ b/chrome/browser/autofill/autofill_manager.h @@ -45,9 +45,6 @@ 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); |