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

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

Issue 12208091: ExtensionInfobarGtk doesn't handle delegate going away. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 7 years, 10 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
« no previous file with comments | « no previous file | chrome/browser/ui/gtk/infobars/extension_infobar_gtk.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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_EXTENSION_INFOBAR_GTK_H_ 5 #ifndef CHROME_BROWSER_UI_GTK_INFOBARS_EXTENSION_INFOBAR_GTK_H_
6 #define CHROME_BROWSER_UI_GTK_INFOBARS_EXTENSION_INFOBAR_GTK_H_ 6 #define CHROME_BROWSER_UI_GTK_INFOBARS_EXTENSION_INFOBAR_GTK_H_
7 7
8 #include "base/compiler_specific.h" 8 #include "base/compiler_specific.h"
9 #include "chrome/browser/extensions/extension_infobar_delegate.h" 9 #include "chrome/browser/extensions/extension_infobar_delegate.h"
10 #include "chrome/browser/ui/gtk/extensions/extension_view_gtk.h" 10 #include "chrome/browser/ui/gtk/extensions/extension_view_gtk.h"
11 #include "chrome/browser/ui/gtk/infobars/infobar_gtk.h" 11 #include "chrome/browser/ui/gtk/infobars/infobar_gtk.h"
12 #include "chrome/browser/ui/gtk/menu_gtk.h" 12 #include "chrome/browser/ui/gtk/menu_gtk.h"
13 #include "ui/gfx/gtk_util.h" 13 #include "ui/gfx/gtk_util.h"
14 14
15 class ExtensionContextMenuModel; 15 class ExtensionContextMenuModel;
16 class ExtensionResource; 16 class ExtensionResource;
17 class ExtensionViewGtk; 17 class ExtensionViewGtk;
18 class MenuGtk; 18 class MenuGtk;
19 19
20 class ExtensionInfoBarGtk : public InfoBarGtk, 20 class ExtensionInfoBarGtk : public InfoBarGtk,
21 public MenuGtk::Delegate { 21 public MenuGtk::Delegate,
22 public ExtensionInfoBarDelegate::DelegateObserver {
22 public: 23 public:
23 ExtensionInfoBarGtk(InfoBarService* owner, 24 ExtensionInfoBarGtk(InfoBarService* owner,
24 ExtensionInfoBarDelegate* delegate); 25 ExtensionInfoBarDelegate* delegate);
25 virtual ~ExtensionInfoBarGtk(); 26 virtual ~ExtensionInfoBarGtk();
26 27
27 // Overridden from InfoBar (through InfoBarGtk): 28 // Overridden from InfoBar (through InfoBarGtk):
28 virtual void PlatformSpecificHide(bool animate) OVERRIDE; 29 virtual void PlatformSpecificHide(bool animate) OVERRIDE;
29 30
30 // Overridden from InfoBarGtk: 31 // Overridden from InfoBarGtk:
31 virtual void GetTopColor(InfoBarDelegate::Type type, 32 virtual void GetTopColor(InfoBarDelegate::Type type,
32 double* r, double* g, double* b) OVERRIDE; 33 double* r, double* g, double* b) OVERRIDE;
33 virtual void GetBottomColor(InfoBarDelegate::Type type, 34 virtual void GetBottomColor(InfoBarDelegate::Type type,
34 double* r, double* g, double* b) OVERRIDE; 35 double* r, double* g, double* b) OVERRIDE;
35 36
36 // Overridden from MenuGtk::Delegate: 37 // Overridden from MenuGtk::Delegate:
37 virtual void StoppedShowing() OVERRIDE; 38 virtual void StoppedShowing() OVERRIDE;
38 39
40 // Overridden from ExtensionInfoBarDelegate::DelegateObserver:
41 virtual void OnDelegateDeleted() OVERRIDE;
42
39 private: 43 private:
40 // Build the widgets of the Infobar. 44 // Build the widgets of the Infobar.
41 void BuildWidgets(); 45 void BuildWidgets();
42 46
43 void OnImageLoaded(const gfx::Image& image); 47 void OnImageLoaded(const gfx::Image& image);
44 48
45 // Looks at the window the infobar is in and gets the browser. Can return 49 // Looks at the window the infobar is in and gets the browser. Can return
46 // NULL if we aren't attached. 50 // NULL if we aren't attached.
47 Browser* GetBrowser(); 51 Browser* GetBrowser();
48 52
(...skipping 28 matching lines...) Expand all
77 81
78 // The model for the current menu displayed. 82 // The model for the current menu displayed.
79 scoped_refptr<ExtensionContextMenuModel> context_menu_model_; 83 scoped_refptr<ExtensionContextMenuModel> context_menu_model_;
80 84
81 base::WeakPtrFactory<ExtensionInfoBarGtk> weak_ptr_factory_; 85 base::WeakPtrFactory<ExtensionInfoBarGtk> weak_ptr_factory_;
82 86
83 DISALLOW_COPY_AND_ASSIGN(ExtensionInfoBarGtk); 87 DISALLOW_COPY_AND_ASSIGN(ExtensionInfoBarGtk);
84 }; 88 };
85 89
86 #endif // CHROME_BROWSER_UI_GTK_INFOBARS_EXTENSION_INFOBAR_GTK_H_ 90 #endif // CHROME_BROWSER_UI_GTK_INFOBARS_EXTENSION_INFOBAR_GTK_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/ui/gtk/infobars/extension_infobar_gtk.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698