| Index: chrome/browser/google/google_url_tracker_infobar_delegate.cc
|
| ===================================================================
|
| --- chrome/browser/google/google_url_tracker_infobar_delegate.cc (revision 226624)
|
| +++ chrome/browser/google/google_url_tracker_infobar_delegate.cc (working copy)
|
| @@ -6,6 +6,7 @@
|
|
|
| #include "chrome/browser/google/google_url_tracker.h"
|
| #include "chrome/browser/google/google_util.h"
|
| +#include "chrome/browser/infobars/infobar.h"
|
| #include "chrome/browser/infobars/infobar_service.h"
|
| #include "content/public/browser/navigation_details.h"
|
| #include "content/public/browser/navigation_entry.h"
|
| @@ -17,14 +18,13 @@
|
|
|
|
|
| // static
|
| -GoogleURLTrackerInfoBarDelegate* GoogleURLTrackerInfoBarDelegate::Create(
|
| +InfoBar* GoogleURLTrackerInfoBarDelegate::Create(
|
| InfoBarService* infobar_service,
|
| GoogleURLTracker* google_url_tracker,
|
| const GURL& search_url) {
|
| - return static_cast<GoogleURLTrackerInfoBarDelegate*>(
|
| - infobar_service->AddInfoBar(scoped_ptr<InfoBarDelegate>(
|
| - new GoogleURLTrackerInfoBarDelegate(
|
| - infobar_service, google_url_tracker, search_url))));
|
| + return infobar_service->AddInfoBar(ConfirmInfoBarDelegate::CreateInfoBar(
|
| + scoped_ptr<ConfirmInfoBarDelegate>(new GoogleURLTrackerInfoBarDelegate(
|
| + google_url_tracker, search_url))));
|
| }
|
|
|
| bool GoogleURLTrackerInfoBarDelegate::Accept() {
|
| @@ -45,9 +45,9 @@
|
|
|
| void GoogleURLTrackerInfoBarDelegate::Close(bool redo_search) {
|
| // It's not obvious whether calling OpenURL() with a search URL would
|
| - // auto-close us or not. If it did, we wouldn't want to try to
|
| - // RemoveInfoBar() afterwards. So for safety, we always call RemoveInfoBar()
|
| - // directly, and then navigate if necessary afterwards.
|
| + // auto-close us or not. If it did, we wouldn't want to try to RemoveSelf()
|
| + // afterwards. So for safety, we always call RemoveSelf() directly, and then
|
| + // navigate if necessary afterwards.
|
| GURL new_search_url;
|
| if (redo_search) {
|
| // Re-do the user's search on the new domain.
|
| @@ -59,7 +59,7 @@
|
| }
|
|
|
| content::WebContents* contents = web_contents();
|
| - owner()->RemoveInfoBar(this);
|
| + infobar()->RemoveSelf();
|
| // WARNING: |this| may be deleted at this point! Do not access any members!
|
|
|
| if (new_search_url.is_valid()) {
|
| @@ -70,10 +70,9 @@
|
| }
|
|
|
| GoogleURLTrackerInfoBarDelegate::GoogleURLTrackerInfoBarDelegate(
|
| - InfoBarService* infobar_service,
|
| GoogleURLTracker* google_url_tracker,
|
| const GURL& search_url)
|
| - : ConfirmInfoBarDelegate(infobar_service),
|
| + : ConfirmInfoBarDelegate(),
|
| google_url_tracker_(google_url_tracker),
|
| search_url_(search_url),
|
| pending_id_(0) {
|
|
|