| Index: chrome/browser/infobars/infobar_delegate.h
|
| diff --git a/chrome/browser/infobars/infobar_delegate.h b/chrome/browser/infobars/infobar_delegate.h
|
| index fc37dddef99cd754cab08923df0711fefa41f65f..f211ad18559a51d0280848ac187be2b9629f36fc 100644
|
| --- a/chrome/browser/infobars/infobar_delegate.h
|
| +++ b/chrome/browser/infobars/infobar_delegate.h
|
| @@ -7,7 +7,6 @@
|
|
|
| #include "base/basictypes.h"
|
| #include "base/strings/string16.h"
|
| -#include "chrome/browser/infobars/infobar_service.h"
|
| #include "ui/base/window_open_disposition.h"
|
|
|
| class AutoLoginInfoBarDelegate;
|
| @@ -59,18 +58,27 @@ class InfoBarDelegate {
|
|
|
| // Returns true if the supplied |delegate| is equal to this one. Equality is
|
| // left to the implementation to define. This function is called by the
|
| - // InfoBarService when determining whether or not a delegate should be
|
| + // InfoBarManager when determining whether or not a delegate should be
|
| // added because a matching one already exists. If this function returns true,
|
| - // the InfoBarService will not add the new delegate because it considers
|
| + // the InfoBarManager will not add the new delegate because it considers
|
| // one to already be present.
|
| virtual bool EqualsDelegate(InfoBarDelegate* delegate) const;
|
|
|
| + struct NavigationDetails {
|
| + int entry_id;
|
| + bool is_navigation_to_different_page;
|
| + bool is_reload;
|
| + bool is_redirect;
|
| + bool did_replace_entry;
|
| + bool is_main_frame;
|
| + };
|
| +
|
| // Returns true if the InfoBar should be closed automatically after the page
|
| // is navigated. By default this returns true if the navigation is to a new
|
| // page (not including reloads). Subclasses wishing to change this behavior
|
| // can override either this function or ShouldExpireInternal(), depending on
|
| // what level of control they need.
|
| - virtual bool ShouldExpire(const content::LoadCommittedDetails& details) const;
|
| + virtual bool ShouldExpire(const NavigationDetails& details) const;
|
|
|
| // Called when the user clicks on the close button to dismiss the infobar.
|
| virtual void InfoBarDismissed();
|
| @@ -83,6 +91,8 @@ class InfoBarDelegate {
|
| // as background color) of the infobar.
|
| virtual Type GetInfoBarType() const;
|
|
|
| + virtual void CleanUp();
|
| +
|
| // Type-checking downcast routines:
|
| virtual AutoLoginInfoBarDelegate* AsAutoLoginInfoBarDelegate();
|
| virtual ConfirmInfoBarDelegate* AsConfirmInfoBarDelegate();
|
| @@ -102,22 +112,16 @@ class InfoBarDelegate {
|
| // Store the unique id for the active entry in our WebContents, to be used
|
| // later upon navigation to determine if this InfoBarDelegate should be
|
| // expired.
|
| - void StoreActiveEntryUniqueID();
|
| + void StoreActiveEntryUniqueID(int entry_id);
|
|
|
| // Return the icon to be shown for this InfoBar. If the returned Image is
|
| // empty, no icon is shown.
|
| virtual gfx::Image GetIcon() const;
|
|
|
| - // This trivial getter is defined out-of-line in order to avoid needing to
|
| - // #include infobar.h, which would lead to circular #includes.
|
| - content::WebContents* web_contents();
|
| -
|
| - protected:
|
| InfoBarDelegate();
|
|
|
| // Returns true if the navigation is to a new URL or a reload occured.
|
| - virtual bool ShouldExpireInternal(
|
| - const content::LoadCommittedDetails& details) const;
|
| + virtual bool ShouldExpireInternal(const NavigationDetails& details) const;
|
|
|
| int contents_unique_id() const { return contents_unique_id_; }
|
| InfoBar* infobar() { return infobar_; }
|
|
|