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

Unified Diff: chrome/browser/views/infobars/infobar_container.h

Issue 11318: Beginnings of a new InfoBar system. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 12 years, 1 month 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 | « chrome/browser/views/frame/browser_view.cc ('k') | chrome/browser/views/infobars/infobar_container.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/views/infobars/infobar_container.h
===================================================================
--- chrome/browser/views/infobars/infobar_container.h (revision 0)
+++ chrome/browser/views/infobars/infobar_container.h (revision 0)
@@ -0,0 +1,73 @@
+// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_BROWSER_VIEWS_INFOBARS_INFOBAR_CONTAINER_H_
+#define CHROME_BROWSER_VIEWS_INFOBARS_INFOBAR_CONTAINER_H_
+
+#include "chrome/common/notification_service.h"
+#include "chrome/views/view.h"
+
+class BrowserView;
+class InfoBarDelegate;
+class TabContents;
+
+// A views::View subclass that contains a collection of InfoBars associated with
+// a TabContents.
+class InfoBarContainer : public views::View,
+ public NotificationObserver {
+ public:
+ explicit InfoBarContainer(BrowserView* browser_view);
+ virtual ~InfoBarContainer();
+
+ // Changes the TabContents for which this container is showing InfoBars. Can
+ // be NULL.
+ void ChangeTabContents(TabContents* contents);
+
+ // Called by child InfoBars as they animate. If |completed| is true, the
+ // animation has finished running.
+ void InfoBarAnimated(bool completed);
+
+ // Remove the specified InfoBarDelegate from the selected TabContents. This
+ // will notify us back and cause us to close the View. This is called from
+ // the InfoBar's close button handler.
+ void RemoveDelegate(InfoBarDelegate* delegate);
+
+ // Overridden from views::View:
+ virtual gfx::Size GetPreferredSize();
+ virtual void Layout();
+ protected:
+ virtual void ViewHierarchyChanged(bool is_add,
+ views::View* parent,
+ views::View* child);
+
+ private:
+ // Overridden from NotificationObserver:
+ virtual void Observe(NotificationType type,
+ const NotificationSource& source,
+ const NotificationDetails& details);
+
+ // Constructs the InfoBars needed to reflect the state of the current
+ // TabContents associated with this container. No animations are run during
+ // this process.
+ void UpdateInfoBars();
+
+ // Adds an InfoBar for the specified delegate, in response to a notification
+ // from the selected TabContents. The InfoBar's appearance will be animated.
+ void AddInfoBar(InfoBarDelegate* delegate);
+
+ // Removes an InfoBar for the specified delegate, in response to a
+ // notification from the selected TabContents. The InfoBar's disappearance
+ // will be animated.
+ void RemoveInfoBar(InfoBarDelegate* delegate);
+
+ // The BrowserView that hosts this InfoBarContainer.
+ BrowserView* browser_view_;
+
+ // The TabContents for which we are currently showing InfoBars.
+ TabContents* tab_contents_;
+
+ DISALLOW_COPY_AND_ASSIGN(InfoBarContainer);
+};
+
+#endif // #ifndef CHROME_BROWSER_VIEWS_INFOBARS_INFOBAR_CONTAINER_H_
Property changes on: chrome\browser\views\infobars\infobar_container.h
___________________________________________________________________
Added: svn:eol-style
+ LF
« no previous file with comments | « chrome/browser/views/frame/browser_view.cc ('k') | chrome/browser/views/infobars/infobar_container.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698