OLD | NEW |
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 15 matching lines...) Expand all Loading... |
26 public: | 26 public: |
27 virtual void OnDelegateDeleted() = 0; | 27 virtual void OnDelegateDeleted() = 0; |
28 | 28 |
29 protected: | 29 protected: |
30 virtual ~DelegateObserver() {} | 30 virtual ~DelegateObserver() {} |
31 }; | 31 }; |
32 | 32 |
33 ExtensionInfoBarDelegate(Browser* browser, | 33 ExtensionInfoBarDelegate(Browser* browser, |
34 TabContents* contents, | 34 TabContents* contents, |
35 const Extension* extension, | 35 const Extension* extension, |
36 const GURL& url); | 36 const GURL& url, |
| 37 int height); |
37 | 38 |
38 const Extension* extension() { return extension_; } | 39 const Extension* extension() { return extension_; } |
39 ExtensionHost* extension_host() { return extension_host_.get(); } | 40 ExtensionHost* extension_host() { return extension_host_.get(); } |
| 41 int height() { return height_; } |
40 | 42 |
41 void set_observer(DelegateObserver* observer) { observer_ = observer; } | 43 void set_observer(DelegateObserver* observer) { observer_ = observer; } |
42 | 44 |
43 bool closing() const { return closing_; } | 45 bool closing() const { return closing_; } |
44 | 46 |
45 private: | 47 private: |
46 virtual ~ExtensionInfoBarDelegate(); | 48 virtual ~ExtensionInfoBarDelegate(); |
47 | 49 |
48 // InfoBarDelegate: | 50 // InfoBarDelegate: |
49 virtual InfoBar* CreateInfoBar(TabContentsWrapper* owner) OVERRIDE; | 51 virtual InfoBar* CreateInfoBar(TabContentsWrapper* owner) OVERRIDE; |
(...skipping 12 matching lines...) Expand all Loading... |
62 // and come back (and we don't want the user's interaction with the InfoBar to | 64 // and come back (and we don't want the user's interaction with the InfoBar to |
63 // get lost at that point). | 65 // get lost at that point). |
64 scoped_ptr<ExtensionHost> extension_host_; | 66 scoped_ptr<ExtensionHost> extension_host_; |
65 | 67 |
66 // The observer monitoring when the delegate dies. | 68 // The observer monitoring when the delegate dies. |
67 DelegateObserver* observer_; | 69 DelegateObserver* observer_; |
68 | 70 |
69 const Extension* extension_; | 71 const Extension* extension_; |
70 NotificationRegistrar registrar_; | 72 NotificationRegistrar registrar_; |
71 | 73 |
| 74 // The requested height of the infobar (in pixels). |
| 75 int height_; |
| 76 |
72 // Whether we are currently animating to close. This is used to ignore | 77 // Whether we are currently animating to close. This is used to ignore |
73 // ExtensionView::PreferredSizeChanged notifications. | 78 // ExtensionView::PreferredSizeChanged notifications. |
74 bool closing_; | 79 bool closing_; |
75 | 80 |
76 DISALLOW_COPY_AND_ASSIGN(ExtensionInfoBarDelegate); | 81 DISALLOW_COPY_AND_ASSIGN(ExtensionInfoBarDelegate); |
77 }; | 82 }; |
78 | 83 |
79 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_INFOBAR_DELEGATE_H_ | 84 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_INFOBAR_DELEGATE_H_ |
OLD | NEW |