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

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

Issue 4767001: Make TabContents own its infobar delegates.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 10 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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_GTK_INFOBAR_GTK_H_ 5 #ifndef CHROME_BROWSER_GTK_INFOBAR_GTK_H_
6 #define CHROME_BROWSER_GTK_INFOBAR_GTK_H_ 6 #define CHROME_BROWSER_GTK_INFOBAR_GTK_H_
7 #pragma once 7 #pragma once
8 8
9 #include "app/gtk_signal.h" 9 #include "app/gtk_signal.h"
10 #include "app/slide_animation.h" 10 #include "app/slide_animation.h"
11 #include "base/basictypes.h" 11 #include "base/basictypes.h"
12 #include "base/scoped_ptr.h" 12 #include "base/scoped_ptr.h"
13 #include "chrome/browser/gtk/infobar_arrow_model.h" 13 #include "chrome/browser/gtk/infobar_arrow_model.h"
14 #include "chrome/browser/gtk/owned_widget_gtk.h" 14 #include "chrome/browser/gtk/owned_widget_gtk.h"
15 #include "chrome/browser/gtk/slide_animator_gtk.h" 15 #include "chrome/browser/gtk/slide_animator_gtk.h"
16 #include "chrome/browser/tab_contents/infobar_delegate.h" 16 #include "chrome/browser/tab_contents/infobar_delegate.h"
17 #include "chrome/common/notification_observer.h" 17 #include "chrome/common/notification_observer.h"
18 #include "chrome/common/notification_registrar.h" 18 #include "chrome/common/notification_registrar.h"
19 #include "third_party/skia/include/core/SkPaint.h" 19 #include "third_party/skia/include/core/SkPaint.h"
20 20
21 class CustomDrawButton; 21 class CustomDrawButton;
22 class GtkThemeProvider; 22 class GtkThemeProvider;
23 class InfoBarContainerGtk; 23 class InfoBarContainerGtk;
24 class InfoBarDelegate;
25 24
26 class InfoBar : public SlideAnimatorGtk::Delegate, 25 class InfoBar : public SlideAnimatorGtk::Delegate,
27 public NotificationObserver, 26 public NotificationObserver,
28 public InfoBarArrowModel::Observer { 27 public InfoBarArrowModel::Observer {
29 public: 28 public:
30 explicit InfoBar(InfoBarDelegate* delegate); 29 explicit InfoBar(InfoBarDelegate* delegate);
31 virtual ~InfoBar(); 30 virtual ~InfoBar();
32 31
33 InfoBarDelegate* delegate() const { return delegate_; } 32 InfoBarDelegate* delegate() const { return delegate_; }
34 33
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
132 InfoBarArrowModel arrow_model_; 131 InfoBarArrowModel arrow_model_;
133 132
134 NotificationRegistrar registrar_; 133 NotificationRegistrar registrar_;
135 134
136 private: 135 private:
137 CHROMEGTK_CALLBACK_0(InfoBar, void, OnCloseButton); 136 CHROMEGTK_CALLBACK_0(InfoBar, void, OnCloseButton);
138 CHROMEGTK_CALLBACK_1(InfoBar, gboolean, OnBackgroundExpose, GdkEventExpose*); 137 CHROMEGTK_CALLBACK_1(InfoBar, gboolean, OnBackgroundExpose, GdkEventExpose*);
139 138
140 void UpdateBorderColor(); 139 void UpdateBorderColor();
141 140
141 // We cache |delegate_->GetInfoBarType()| for use in OnBackgroundExpose()
142 // since that may be called when there's no longer a delegate (e.g. during
143 // AnimateClose()).
144 InfoBarDelegate::Type cached_infobar_type_;
145
142 DISALLOW_COPY_AND_ASSIGN(InfoBar); 146 DISALLOW_COPY_AND_ASSIGN(InfoBar);
143 }; 147 };
144 148
145 #endif // CHROME_BROWSER_GTK_INFOBAR_GTK_H_ 149 #endif // CHROME_BROWSER_GTK_INFOBAR_GTK_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698