OLD | NEW |
1 // Copyright (c) 2010 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 #include "chrome/browser/extensions/extension_infobar_delegate.h" | 5 #include "chrome/browser/extensions/extension_infobar_delegate.h" |
6 | 6 |
7 #include "chrome/browser/browser.h" | 7 #include "chrome/browser/browser.h" |
8 #include "chrome/browser/profile.h" | 8 #include "chrome/browser/profile.h" |
9 #include "chrome/browser/extensions/extension_host.h" | 9 #include "chrome/browser/extensions/extension_host.h" |
10 #include "chrome/browser/extensions/extension_process_manager.h" | 10 #include "chrome/browser/extensions/extension_process_manager.h" |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
50 | 50 |
51 // Only allow one InfoBar at a time per extension. | 51 // Only allow one InfoBar at a time per extension. |
52 return extension_delegate->extension_host()->extension() == | 52 return extension_delegate->extension_host()->extension() == |
53 extension_host_->extension(); | 53 extension_host_->extension(); |
54 } | 54 } |
55 | 55 |
56 void ExtensionInfoBarDelegate::InfoBarClosed() { | 56 void ExtensionInfoBarDelegate::InfoBarClosed() { |
57 delete this; | 57 delete this; |
58 } | 58 } |
59 | 59 |
60 #if defined(OS_MACOSX) | |
61 InfoBar* ExtensionInfoBarDelegate::CreateInfoBar() { | |
62 NOTIMPLEMENTED(); | |
63 return NULL; | |
64 } | |
65 #endif // OS_MACOSX | |
66 | |
67 void ExtensionInfoBarDelegate::Observe(NotificationType type, | 60 void ExtensionInfoBarDelegate::Observe(NotificationType type, |
68 const NotificationSource& source, | 61 const NotificationSource& source, |
69 const NotificationDetails& details) { | 62 const NotificationDetails& details) { |
70 switch (type.value) { | 63 switch (type.value) { |
71 case NotificationType::EXTENSION_HOST_VIEW_SHOULD_CLOSE: { | 64 case NotificationType::EXTENSION_HOST_VIEW_SHOULD_CLOSE: { |
72 const ExtensionHost* result = Details<ExtensionHost>(details).ptr(); | 65 const ExtensionHost* result = Details<ExtensionHost>(details).ptr(); |
73 if (extension_host_.get() == result) | 66 if (extension_host_.get() == result) |
74 tab_contents_->RemoveInfoBar(this); | 67 tab_contents_->RemoveInfoBar(this); |
75 break; | 68 break; |
76 } | 69 } |
77 case NotificationType::EXTENSION_UNLOADED: { | 70 case NotificationType::EXTENSION_UNLOADED: { |
78 Extension* extension = Details<Extension>(details).ptr(); | 71 Extension* extension = Details<Extension>(details).ptr(); |
79 if (extension_ == extension) | 72 if (extension_ == extension) |
80 tab_contents_->RemoveInfoBar(this); | 73 tab_contents_->RemoveInfoBar(this); |
81 break; | 74 break; |
82 } | 75 } |
83 default: { | 76 default: { |
84 NOTREACHED() << "Unknown message"; | 77 NOTREACHED() << "Unknown message"; |
85 break; | 78 break; |
86 } | 79 } |
87 } | 80 } |
88 } | 81 } |
OLD | NEW |