Chromium Code Reviews| Index: chrome/browser/geolocation/geolocation_infobar_delegate.cc |
| diff --git a/chrome/browser/geolocation/geolocation_infobar_delegate.cc b/chrome/browser/geolocation/geolocation_infobar_delegate.cc |
| index 4e9c37df573b61b59a1d5e7be525fb3cc6d78701..2629849bc83d24a0f3cbaead76a55fe23a65f0f6 100644 |
| --- a/chrome/browser/geolocation/geolocation_infobar_delegate.cc |
| +++ b/chrome/browser/geolocation/geolocation_infobar_delegate.cc |
| @@ -33,10 +33,20 @@ InfoBarDelegate* GeolocationInfoBarDelegate::Create( |
| const std::string& display_languages) { |
| const content::NavigationEntry* committed_entry = |
| infobar_service->web_contents()->GetController().GetLastCommittedEntry(); |
| - return infobar_service->AddInfoBar(scoped_ptr<InfoBarDelegate>( |
| + DelegateType * const delegate = |
|
Miguel Garcia
2013/08/21 11:46:46
nit: DelegateType* (no space)
acleung1
2013/08/23 23:13:09
Done.
|
| new DelegateType(infobar_service, controller, id, requesting_frame, |
|
Miguel Garcia
2013/08/21 11:46:46
I thin you can push the Initialize/Show thing to t
acleung1
2013/08/23 23:13:09
It difficult to have a sort of polymorphic behavio
|
| committed_entry ? committed_entry->GetUniqueID() : 0, |
| - display_languages))); |
| + display_languages); |
| + delegate->Initialize(infobar_service); |
| + return delegate; |
| +} |
| + |
| +void GeolocationInfoBarDelegate::Initialize(InfoBarService* infobar_service) { |
| + this->Show(infobar_service); |
| +} |
| + |
| +void GeolocationInfoBarDelegate::Show(InfoBarService* infobar_service) { |
| + infobar_service->AddInfoBar(scoped_ptr<InfoBarDelegate>(this)); |
| } |
| GeolocationInfoBarDelegate::GeolocationInfoBarDelegate( |