| 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 #include "chrome/browser/extensions/extension_infobar_delegate.h" | 5 #include "chrome/browser/extensions/extension_infobar_delegate.h" |
| 6 | 6 |
| 7 #include "chrome/browser/extensions/extension_host.h" | 7 #include "chrome/browser/extensions/extension_host.h" |
| 8 #include "chrome/browser/extensions/extension_process_manager.h" | 8 #include "chrome/browser/extensions/extension_process_manager.h" |
| 9 #include "chrome/browser/profiles/profile.h" | 9 #include "chrome/browser/profiles/profile.h" |
| 10 #include "chrome/browser/ui/browser.h" | 10 #include "chrome/browser/ui/browser.h" |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 52 | 52 |
| 53 // Only allow one InfoBar at a time per extension. | 53 // Only allow one InfoBar at a time per extension. |
| 54 return extension_delegate->extension_host()->extension() == | 54 return extension_delegate->extension_host()->extension() == |
| 55 extension_host_->extension(); | 55 extension_host_->extension(); |
| 56 } | 56 } |
| 57 | 57 |
| 58 void ExtensionInfoBarDelegate::InfoBarDismissed() { | 58 void ExtensionInfoBarDelegate::InfoBarDismissed() { |
| 59 closing_ = true; | 59 closing_ = true; |
| 60 } | 60 } |
| 61 | 61 |
| 62 void ExtensionInfoBarDelegate::InfoBarClosed() { | |
| 63 delete this; | |
| 64 } | |
| 65 | |
| 66 InfoBarDelegate::Type ExtensionInfoBarDelegate::GetInfoBarType() const { | 62 InfoBarDelegate::Type ExtensionInfoBarDelegate::GetInfoBarType() const { |
| 67 return PAGE_ACTION_TYPE; | 63 return PAGE_ACTION_TYPE; |
| 68 } | 64 } |
| 69 | 65 |
| 70 ExtensionInfoBarDelegate* | 66 ExtensionInfoBarDelegate* |
| 71 ExtensionInfoBarDelegate::AsExtensionInfoBarDelegate() { | 67 ExtensionInfoBarDelegate::AsExtensionInfoBarDelegate() { |
| 72 return this; | 68 return this; |
| 73 } | 69 } |
| 74 | 70 |
| 75 void ExtensionInfoBarDelegate::Observe(NotificationType type, | 71 void ExtensionInfoBarDelegate::Observe(NotificationType type, |
| (...skipping 12 matching lines...) Expand all Loading... |
| 88 if (extension_ == extension) | 84 if (extension_ == extension) |
| 89 tab_contents_->RemoveInfoBar(this); | 85 tab_contents_->RemoveInfoBar(this); |
| 90 break; | 86 break; |
| 91 } | 87 } |
| 92 default: { | 88 default: { |
| 93 NOTREACHED() << "Unknown message"; | 89 NOTREACHED() << "Unknown message"; |
| 94 break; | 90 break; |
| 95 } | 91 } |
| 96 } | 92 } |
| 97 } | 93 } |
| OLD | NEW |