OLD | NEW |
---|---|
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_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 | 7 |
8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
9 #include "chrome/browser/api/infobars/confirm_infobar_delegate.h" | 9 #include "chrome/browser/api/infobars/confirm_infobar_delegate.h" |
10 #include "content/public/browser/notification_observer.h" | 10 #include "content/public/browser/notification_observer.h" |
11 #include "content/public/browser/notification_registrar.h" | 11 #include "content/public/browser/notification_registrar.h" |
12 | 12 |
13 class Browser; | 13 class Browser; |
14 class GURL; | 14 class GURL; |
15 class InfoBarTabHelper; | |
erikwright (departed)
2012/08/16 17:25:38
can we just use service here?
Jói
2012/08/17 15:51:24
Done.
| |
16 class InfoBarTabService; | |
15 | 17 |
16 namespace extensions { | 18 namespace extensions { |
17 class Extension; | 19 class Extension; |
18 class ExtensionHost; | 20 class ExtensionHost; |
19 } | 21 } |
20 | 22 |
21 // The InfobarDelegate for creating and managing state for the ExtensionInfobar | 23 // The InfobarDelegate for creating and managing state for the ExtensionInfobar |
22 // plus monitor when the extension goes away. | 24 // plus monitor when the extension goes away. |
23 class ExtensionInfoBarDelegate : public InfoBarDelegate, | 25 class ExtensionInfoBarDelegate : public InfoBarDelegate, |
24 public content::NotificationObserver { | 26 public content::NotificationObserver { |
(...skipping 18 matching lines...) Expand all Loading... | |
43 int height() { return height_; } | 45 int height() { return height_; } |
44 | 46 |
45 void set_observer(DelegateObserver* observer) { observer_ = observer; } | 47 void set_observer(DelegateObserver* observer) { observer_ = observer; } |
46 | 48 |
47 bool closing() const { return closing_; } | 49 bool closing() const { return closing_; } |
48 | 50 |
49 private: | 51 private: |
50 virtual ~ExtensionInfoBarDelegate(); | 52 virtual ~ExtensionInfoBarDelegate(); |
51 | 53 |
52 // InfoBarDelegate: | 54 // InfoBarDelegate: |
53 virtual InfoBar* CreateInfoBar(InfoBarTabHelper* owner) OVERRIDE; | 55 virtual InfoBar* CreateInfoBar(InfoBarTabService* owner) OVERRIDE; |
54 virtual bool EqualsDelegate(InfoBarDelegate* delegate) const OVERRIDE; | 56 virtual bool EqualsDelegate(InfoBarDelegate* delegate) const OVERRIDE; |
55 virtual void InfoBarDismissed() OVERRIDE; | 57 virtual void InfoBarDismissed() OVERRIDE; |
56 virtual Type GetInfoBarType() const OVERRIDE; | 58 virtual Type GetInfoBarType() const OVERRIDE; |
57 virtual ExtensionInfoBarDelegate* AsExtensionInfoBarDelegate() OVERRIDE; | 59 virtual ExtensionInfoBarDelegate* AsExtensionInfoBarDelegate() OVERRIDE; |
58 | 60 |
59 // content::NotificationObserver: | 61 // content::NotificationObserver: |
60 virtual void Observe(int type, | 62 virtual void Observe(int type, |
61 const content::NotificationSource& source, | 63 const content::NotificationSource& source, |
62 const content::NotificationDetails& details) OVERRIDE; | 64 const content::NotificationDetails& details) OVERRIDE; |
63 | 65 |
(...skipping 15 matching lines...) Expand all Loading... | |
79 int height_; | 81 int height_; |
80 | 82 |
81 // Whether we are currently animating to close. This is used to ignore | 83 // Whether we are currently animating to close. This is used to ignore |
82 // ExtensionView::PreferredSizeChanged notifications. | 84 // ExtensionView::PreferredSizeChanged notifications. |
83 bool closing_; | 85 bool closing_; |
84 | 86 |
85 DISALLOW_COPY_AND_ASSIGN(ExtensionInfoBarDelegate); | 87 DISALLOW_COPY_AND_ASSIGN(ExtensionInfoBarDelegate); |
86 }; | 88 }; |
87 | 89 |
88 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_INFOBAR_DELEGATE_H_ | 90 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_INFOBAR_DELEGATE_H_ |
OLD | NEW |