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

Unified Diff: chrome/browser/tab_contents/infobar_container.h

Issue 7046080: When replacing an infobar, maintain the old infobar's position. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 9 years, 6 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
« no previous file with comments | « no previous file | chrome/browser/tab_contents/infobar_container.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/tab_contents/infobar_container.h
===================================================================
--- chrome/browser/tab_contents/infobar_container.h (revision 88583)
+++ chrome/browser/tab_contents/infobar_container.h (working copy)
@@ -92,7 +92,8 @@
// These must be implemented on each platform to e.g. adjust the visible
// object hierarchy.
- virtual void PlatformSpecificAddInfoBar(InfoBar* infobar) = 0;
+ virtual void PlatformSpecificAddInfoBar(InfoBar* infobar,
+ size_t position) = 0;
virtual void PlatformSpecificRemoveInfoBar(InfoBar* infobar) = 0;
private:
@@ -105,16 +106,18 @@
// Removes an InfoBar for the specified delegate, in response to a
// notification from the selected TabContentsWrapper. The InfoBar's
- // disappearance will be animated if |use_animation| is true.
- void RemoveInfoBar(InfoBarDelegate* delegate, bool use_animation);
+ // disappearance will be animated if |use_animation| is true. Returns the
+ // position within |infobars_| the infobar was previously at.
+ size_t RemoveInfoBar(InfoBarDelegate* delegate, bool use_animation);
- // Adds |infobar| to this container and calls Show() on it. |animate| is
- // passed along to infobar->Show(). Depending on the value of
- // |callback_status|, this calls infobar->set_container(this) either before or
- // after the call to Show() so that OnInfoBarAnimated() either will or won't
- // be called as a result.
+ // Adds |infobar| to this container before the existing infobar at position
+ // |position| and calls Show() on it. |animate| is passed along to
+ // infobar->Show(). Depending on the value of |callback_status|, this calls
+ // infobar->set_container(this) either before or after the call to Show() so
+ // that OnInfoBarStateChanged() either will or won't be called as a result.
enum CallbackStatus { NO_CALLBACK, WANT_CALLBACK };
void AddInfoBar(InfoBar* infobar,
+ size_t position,
bool animate,
CallbackStatus callback_status);
« no previous file with comments | « no previous file | chrome/browser/tab_contents/infobar_container.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698