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

Side by Side Diff: chrome/browser/ui/gtk/infobars/infobar_gtk.h

Issue 11775019: Add InitWidgets() phase for GTK infobars. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 7 years, 8 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CHROME_BROWSER_UI_GTK_INFOBARS_INFOBAR_GTK_H_ 5 #ifndef CHROME_BROWSER_UI_GTK_INFOBARS_INFOBAR_GTK_H_
6 #define CHROME_BROWSER_UI_GTK_INFOBARS_INFOBAR_GTK_H_ 6 #define CHROME_BROWSER_UI_GTK_INFOBARS_INFOBAR_GTK_H_
7 7
8 #include <gtk/gtk.h> 8 #include <gtk/gtk.h>
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
91 // InfoBar: 91 // InfoBar:
92 virtual void PlatformSpecificShow(bool animate) OVERRIDE; 92 virtual void PlatformSpecificShow(bool animate) OVERRIDE;
93 virtual void PlatformSpecificOnCloseSoon() OVERRIDE; 93 virtual void PlatformSpecificOnCloseSoon() OVERRIDE;
94 virtual void PlatformSpecificOnHeightsRecalculated() OVERRIDE; 94 virtual void PlatformSpecificOnHeightsRecalculated() OVERRIDE;
95 95
96 // content::NotificationObserver: 96 // content::NotificationObserver:
97 virtual void Observe(int type, 97 virtual void Observe(int type,
98 const content::NotificationSource& source, 98 const content::NotificationSource& source,
99 const content::NotificationDetails& details) OVERRIDE; 99 const content::NotificationDetails& details) OVERRIDE;
100 100
101 // Called the first time we try to show the infobar. Inits any widgets and
102 // related objects necessary.
103 //
104 // NOTE: Subclasses who need to init widgets should override this function and
105 // explicitly call their parent's implementation first, then continue with
106 // further work they need to do. Failing to call the parent implementation
107 // first (or at all), or setting up widgets in the constructor instead of
108 // here, will lead to bad side effects like crashing or having this function
109 // get called repeatedly.
110 virtual void InitWidgets();
111
101 // The second highest widget in the hierarchy (after the |widget_|). 112 // The second highest widget in the hierarchy (after the |widget_|).
102 GtkWidget* bg_box_; 113 GtkWidget* bg_box_;
103 114
104 // The hbox that holds infobar elements (button, text, icon, etc.). 115 // The hbox that holds infobar elements (button, text, icon, etc.).
105 GtkWidget* hbox_; 116 GtkWidget* hbox_;
106 117
107 // The x that closes the bar. 118 // The x that closes the bar.
108 scoped_ptr<CustomDrawButton> close_button_; 119 scoped_ptr<CustomDrawButton> close_button_;
109 120
110 // The theme provider, used for getting border colors. 121 // The theme provider, used for getting border colors.
(...skipping 19 matching lines...) Expand all
130 scoped_ptr<ui::GtkSignalRegistrar> signals_; 141 scoped_ptr<ui::GtkSignalRegistrar> signals_;
131 142
132 // The current menu displayed. Can be null. We own this on the base class so 143 // The current menu displayed. Can be null. We own this on the base class so
133 // we can cancel the menu while we're closing. 144 // we can cancel the menu while we're closing.
134 scoped_ptr<MenuGtk> menu_; 145 scoped_ptr<MenuGtk> menu_;
135 146
136 DISALLOW_COPY_AND_ASSIGN(InfoBarGtk); 147 DISALLOW_COPY_AND_ASSIGN(InfoBarGtk);
137 }; 148 };
138 149
139 #endif // CHROME_BROWSER_UI_GTK_INFOBARS_INFOBAR_GTK_H_ 150 #endif // CHROME_BROWSER_UI_GTK_INFOBARS_INFOBAR_GTK_H_
OLDNEW
« no previous file with comments | « chrome/browser/ui/gtk/infobars/extension_infobar_gtk.cc ('k') | chrome/browser/ui/gtk/infobars/infobar_gtk.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698