diff options
author | estade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-04-06 23:33:08 +0000 |
---|---|---|
committer | estade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-04-06 23:33:08 +0000 |
commit | 3dda0dcf7d4856d598a2a0e7553e71dbd59134eb (patch) | |
tree | a9f2f93ce239ff603b05f900e34fa6a2a460227b /chrome/browser/gtk/infobar_gtk.h | |
parent | ae0f44dd31b81be0d9e0ef5d4478e0ef5ca2805d (diff) | |
download | chromium_src-3dda0dcf7d4856d598a2a0e7553e71dbd59134eb.zip chromium_src-3dda0dcf7d4856d598a2a0e7553e71dbd59134eb.tar.gz chromium_src-3dda0dcf7d4856d598a2a0e7553e71dbd59134eb.tar.bz2 |
Basic infobars on linux.
All infobars consist of nothing but a non-functioning close button.
Review URL: http://codereview.chromium.org/62070
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@13206 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/gtk/infobar_gtk.h')
-rw-r--r-- | chrome/browser/gtk/infobar_gtk.h | 66 |
1 files changed, 66 insertions, 0 deletions
diff --git a/chrome/browser/gtk/infobar_gtk.h b/chrome/browser/gtk/infobar_gtk.h new file mode 100644 index 0000000..0dff963 --- /dev/null +++ b/chrome/browser/gtk/infobar_gtk.h @@ -0,0 +1,66 @@ +// Copyright (c) 2009 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_GTK_INFOBAR_GTK_H_ +#define CHROME_BROWSER_GTK_INFOBAR_GTK_H_ + +#include "base/basictypes.h" +#include "base/scoped_ptr.h" +#include "chrome/browser/tab_contents/infobar_delegate.h" +#include "chrome/common/owned_widget_gtk.h" + +class CustomDrawButton; +class InfoBarContainerGtk; + +class InfoBar { + public: + explicit InfoBar(InfoBarDelegate* delegate); + virtual ~InfoBar(); + + InfoBarDelegate* delegate() const { return delegate_; } + + // Get the top level native GTK widget for this infobar. + GtkWidget* widget() { return widget_.get(); } + + // Set a link to the parent InfoBarContainer. This must be set before the + // InfoBar is added to the view hierarchy. + void set_container(InfoBarContainerGtk* container) { container_ = container; } + + // Starts animating the InfoBar open. + void AnimateOpen(); + + // Opens the InfoBar immediately. + void Open(); + + // Starts animating the InfoBar closed. It will not be closed until the + // animation has completed, when |Close| will be called. + void AnimateClose(); + + // Closes the InfoBar immediately and removes it from its container. Notifies + // the delegate that it has closed. The InfoBar is deleted after this function + // is called. + void Close(); + + protected: + // Removes our associated InfoBarDelegate from the associated TabContents. + // (Will lead to this InfoBar being closed). + void RemoveInfoBar() const; + + private: + // The top level GTK widget. + OwnedWidgetGtk widget_; + + // The x that closes the bar. + scoped_ptr<CustomDrawButton> close_button_; + + // The InfoBar's container + InfoBarContainerGtk* container_; + + // The InfoBar's delegate. + InfoBarDelegate* delegate_; + + DISALLOW_COPY_AND_ASSIGN(InfoBar); +}; + +#endif // CHROME_BROWSER_GTK_INFOBAR_GTK_H_ |