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

Side by Side Diff: chrome/browser/extensions/extension_infobar_delegate.h

Issue 8068020: Converts usage of GetBrowserViewForNativeWindow to (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Tweaks Created 9 years, 2 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) 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_EXTENSIONS_EXTENSION_INFOBAR_DELEGATE_H_ 5 #ifndef CHROME_BROWSER_EXTENSIONS_EXTENSION_INFOBAR_DELEGATE_H_
6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_INFOBAR_DELEGATE_H_ 6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_INFOBAR_DELEGATE_H_
7 #pragma once 7 #pragma once
8 8
9 #include "base/memory/scoped_ptr.h" 9 #include "base/memory/scoped_ptr.h"
10 #include "chrome/browser/tab_contents/confirm_infobar_delegate.h" 10 #include "chrome/browser/tab_contents/confirm_infobar_delegate.h"
(...skipping 26 matching lines...) Expand all
37 int height); 37 int height);
38 38
39 const Extension* extension() { return extension_; } 39 const Extension* extension() { return extension_; }
40 ExtensionHost* extension_host() { return extension_host_.get(); } 40 ExtensionHost* extension_host() { return extension_host_.get(); }
41 int height() { return height_; } 41 int height() { return height_; }
42 42
43 void set_observer(DelegateObserver* observer) { observer_ = observer; } 43 void set_observer(DelegateObserver* observer) { observer_ = observer; }
44 44
45 bool closing() const { return closing_; } 45 bool closing() const { return closing_; }
46 46
47 Browser* browser() { return browser_; }
Peter Kasting 2011/09/29 17:39:20 Nit: Not necessary. The only caller is an Extensi
48
47 private: 49 private:
48 virtual ~ExtensionInfoBarDelegate(); 50 virtual ~ExtensionInfoBarDelegate();
49 51
50 // InfoBarDelegate: 52 // InfoBarDelegate:
51 virtual InfoBar* CreateInfoBar(TabContentsWrapper* owner) OVERRIDE; 53 virtual InfoBar* CreateInfoBar(TabContentsWrapper* owner) OVERRIDE;
52 virtual bool EqualsDelegate(InfoBarDelegate* delegate) const OVERRIDE; 54 virtual bool EqualsDelegate(InfoBarDelegate* delegate) const OVERRIDE;
53 virtual void InfoBarDismissed() OVERRIDE; 55 virtual void InfoBarDismissed() OVERRIDE;
54 virtual Type GetInfoBarType() const OVERRIDE; 56 virtual Type GetInfoBarType() const OVERRIDE;
55 virtual ExtensionInfoBarDelegate* AsExtensionInfoBarDelegate() OVERRIDE; 57 virtual ExtensionInfoBarDelegate* AsExtensionInfoBarDelegate() OVERRIDE;
56 58
57 // NotificationObserver: 59 // NotificationObserver:
58 virtual void Observe(int type, 60 virtual void Observe(int type,
59 const NotificationSource& source, 61 const NotificationSource& source,
60 const NotificationDetails& details) OVERRIDE; 62 const NotificationDetails& details) OVERRIDE;
61 63
64 Browser* browser_;
65
62 // The extension host we are showing the InfoBar for. The delegate needs to 66 // The extension host we are showing the InfoBar for. The delegate needs to
63 // own this since the InfoBar gets deleted and recreated when you switch tabs 67 // own this since the InfoBar gets deleted and recreated when you switch tabs
64 // and come back (and we don't want the user's interaction with the InfoBar to 68 // and come back (and we don't want the user's interaction with the InfoBar to
65 // get lost at that point). 69 // get lost at that point).
66 scoped_ptr<ExtensionHost> extension_host_; 70 scoped_ptr<ExtensionHost> extension_host_;
67 71
68 // The observer monitoring when the delegate dies. 72 // The observer monitoring when the delegate dies.
69 DelegateObserver* observer_; 73 DelegateObserver* observer_;
70 74
71 const Extension* extension_; 75 const Extension* extension_;
72 NotificationRegistrar registrar_; 76 NotificationRegistrar registrar_;
73 77
74 // The requested height of the infobar (in pixels). 78 // The requested height of the infobar (in pixels).
75 int height_; 79 int height_;
76 80
77 // Whether we are currently animating to close. This is used to ignore 81 // Whether we are currently animating to close. This is used to ignore
78 // ExtensionView::PreferredSizeChanged notifications. 82 // ExtensionView::PreferredSizeChanged notifications.
79 bool closing_; 83 bool closing_;
80 84
81 DISALLOW_COPY_AND_ASSIGN(ExtensionInfoBarDelegate); 85 DISALLOW_COPY_AND_ASSIGN(ExtensionInfoBarDelegate);
82 }; 86 };
83 87
84 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_INFOBAR_DELEGATE_H_ 88 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_INFOBAR_DELEGATE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698