diff options
| author | jam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-05-18 18:38:35 +0000 |
|---|---|---|
| committer | jam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-05-18 18:38:35 +0000 |
| commit | c6176905c027930965e93127a707410e5f7c6869 (patch) | |
| tree | 871a04b10b5b27ff94c417a1a4f07a912fe5e363 /chrome/browser/tab_contents/tab_contents_ssl_helper.cc | |
| parent | 13677b86fc97aeab327e476c7de42bc777a54ee4 (diff) | |
| download | chromium_src-c6176905c027930965e93127a707410e5f7c6869.zip chromium_src-c6176905c027930965e93127a707410e5f7c6869.tar.gz chromium_src-c6176905c027930965e93127a707410e5f7c6869.tar.bz2 | |
Get rid of TabContentsSSLHelper dependency from content.
Review URL: http://codereview.chromium.org/7037020
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@85786 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/tab_contents/tab_contents_ssl_helper.cc')
| -rw-r--r-- | chrome/browser/tab_contents/tab_contents_ssl_helper.cc | 27 |
1 files changed, 13 insertions, 14 deletions
diff --git a/chrome/browser/tab_contents/tab_contents_ssl_helper.cc b/chrome/browser/tab_contents/tab_contents_ssl_helper.cc index a0bd215..8bc32d5 100644 --- a/chrome/browser/tab_contents/tab_contents_ssl_helper.cc +++ b/chrome/browser/tab_contents/tab_contents_ssl_helper.cc @@ -100,7 +100,7 @@ bool SSLCertAddedInfoBarDelegate::Accept() { class TabContentsSSLHelper::SSLAddCertData : public NotificationObserver { public: - explicit SSLAddCertData(TabContents* tab_contents); + explicit SSLAddCertData(TabContentsWrapper* tab_contents); virtual ~SSLAddCertData(); // Displays |delegate| as an infobar in |tab_|, replacing our current one if @@ -117,17 +117,18 @@ class TabContentsSSLHelper::SSLAddCertData : public NotificationObserver { const NotificationSource& source, const NotificationDetails& details); - TabContents* tab_contents_; + TabContentsWrapper* tab_contents_; InfoBarDelegate* infobar_delegate_; NotificationRegistrar registrar_; DISALLOW_COPY_AND_ASSIGN(SSLAddCertData); }; -TabContentsSSLHelper::SSLAddCertData::SSLAddCertData(TabContents* tab_contents) +TabContentsSSLHelper::SSLAddCertData::SSLAddCertData( + TabContentsWrapper* tab_contents) : tab_contents_(tab_contents), infobar_delegate_(NULL) { - Source<TabContents> source(tab_contents_); + Source<TabContents> source(tab_contents_->tab_contents()); registrar_.Add(this, NotificationType::TAB_CONTENTS_INFOBAR_REMOVED, source); registrar_.Add(this, NotificationType::TAB_CONTENTS_INFOBAR_REPLACED, source); } @@ -137,19 +138,17 @@ TabContentsSSLHelper::SSLAddCertData::~SSLAddCertData() { void TabContentsSSLHelper::SSLAddCertData::ShowInfoBar( InfoBarDelegate* delegate) { - TabContentsWrapper* wrapper = - TabContentsWrapper::GetCurrentWrapperForContents(tab_contents_); if (infobar_delegate_) - wrapper->ReplaceInfoBar(infobar_delegate_, delegate); + tab_contents_->ReplaceInfoBar(infobar_delegate_, delegate); else - wrapper->AddInfoBar(delegate); + tab_contents_->AddInfoBar(delegate); infobar_delegate_ = delegate; } void TabContentsSSLHelper::SSLAddCertData::ShowErrorInfoBar( const string16& message) { - ShowInfoBar(new SimpleAlertInfoBarDelegate(tab_contents_, GetCertIcon(), - message, true)); + ShowInfoBar(new SimpleAlertInfoBarDelegate( + tab_contents_->tab_contents(), GetCertIcon(), message, true)); } void TabContentsSSLHelper::SSLAddCertData::Observe( @@ -167,7 +166,7 @@ void TabContentsSSLHelper::SSLAddCertData::Observe( // TabContentsSSLHelper ------------------------------------------------------- -TabContentsSSLHelper::TabContentsSSLHelper(TabContents* tab_contents) +TabContentsSSLHelper::TabContentsSSLHelper(TabContentsWrapper* tab_contents) : tab_contents_(tab_contents) { } @@ -177,7 +176,7 @@ TabContentsSSLHelper::~TabContentsSSLHelper() { void TabContentsSSLHelper::ShowClientCertificateRequestDialog( scoped_refptr<SSLClientAuthHandler> handler) { browser::ShowSSLClientCertificateSelector( - tab_contents_, handler->cert_request_info(), handler); + tab_contents_->tab_contents(), handler->cert_request_info(), handler); } void TabContentsSSLHelper::OnVerifyClientCertificateError( @@ -200,8 +199,8 @@ void TabContentsSSLHelper::OnAddClientCertificateSuccess( scoped_refptr<SSLAddCertHandler> handler) { SSLAddCertData* add_cert_data = GetAddCertData(handler); // Display an infobar to inform the user. - add_cert_data->ShowInfoBar( - new SSLCertAddedInfoBarDelegate(tab_contents_, handler->cert())); + add_cert_data->ShowInfoBar(new SSLCertAddedInfoBarDelegate( + tab_contents_->tab_contents(), handler->cert())); } void TabContentsSSLHelper::OnAddClientCertificateError( |
