Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(5945)

Unified Diff: chrome/browser/infobars/infobar_delegate.h

Issue 190063006: Infobar Componentization Proof of Concept (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: minor fixes Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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 {
droger 2014/03/18 15:59:53 This structure is used instead of content::LoadCom
+ 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();
Peter Kasting 2014/03/18 18:29:17 Nit: Add comments about when and why this function
+
// 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
Peter Kasting 2014/03/18 18:29:17 Nit: Seems like this shouldn't refer to WebContent
// 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_; }

Powered by Google App Engine
This is Rietveld 408576698