OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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_disabled_infobar_delegate.h" | 5 #include "chrome/browser/extensions/extension_disabled_infobar_delegate.h" |
6 | 6 |
7 #include "app/l10n_util.h" | 7 #include "app/l10n_util.h" |
8 #include "chrome/browser/chrome_thread.h" | 8 #include "chrome/browser/chrome_thread.h" |
9 #include "chrome/browser/extensions/crx_installer.h" | 9 #include "chrome/browser/extensions/crx_installer.h" |
10 #include "chrome/browser/extensions/extension_file_util.h" | 10 #include "chrome/browser/extensions/extension_file_util.h" |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
81 public: | 81 public: |
82 ExtensionDisabledInfobarDelegate(TabContents* tab_contents, | 82 ExtensionDisabledInfobarDelegate(TabContents* tab_contents, |
83 ExtensionsService* service, | 83 ExtensionsService* service, |
84 Extension* extension) | 84 Extension* extension) |
85 : ConfirmInfoBarDelegate(tab_contents), | 85 : ConfirmInfoBarDelegate(tab_contents), |
86 tab_contents_(tab_contents), | 86 tab_contents_(tab_contents), |
87 service_(service), | 87 service_(service), |
88 extension_(extension) { | 88 extension_(extension) { |
89 // The user might re-enable the extension in other ways, so watch for that. | 89 // The user might re-enable the extension in other ways, so watch for that. |
90 registrar_.Add(this, NotificationType::EXTENSION_LOADED, | 90 registrar_.Add(this, NotificationType::EXTENSION_LOADED, |
91 Source<ExtensionsService>(service)); | 91 Source<Profile>(service->profile())); |
92 registrar_.Add(this, NotificationType::EXTENSION_UNLOADED_DISABLED, | 92 registrar_.Add(this, NotificationType::EXTENSION_UNLOADED_DISABLED, |
93 Source<ExtensionsService>(service)); | 93 Source<Profile>(service->profile())); |
94 } | 94 } |
95 virtual ~ExtensionDisabledInfobarDelegate() { | 95 virtual ~ExtensionDisabledInfobarDelegate() { |
96 } | 96 } |
97 virtual std::wstring GetMessageText() const { | 97 virtual std::wstring GetMessageText() const { |
98 return l10n_util::GetStringF(IDS_EXTENSION_DISABLED_INFOBAR_LABEL, | 98 return l10n_util::GetStringF(IDS_EXTENSION_DISABLED_INFOBAR_LABEL, |
99 UTF8ToWide(extension_->name())); | 99 UTF8ToWide(extension_->name())); |
100 } | 100 } |
101 virtual SkBitmap* GetIcon() const { | 101 virtual SkBitmap* GetIcon() const { |
102 return NULL; | 102 return NULL; |
103 } | 103 } |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
146 if (!browser) | 146 if (!browser) |
147 return; | 147 return; |
148 | 148 |
149 TabContents* tab_contents = browser->GetSelectedTabContents(); | 149 TabContents* tab_contents = browser->GetSelectedTabContents(); |
150 if (!tab_contents) | 150 if (!tab_contents) |
151 return; | 151 return; |
152 | 152 |
153 tab_contents->AddInfoBar(new ExtensionDisabledInfobarDelegate( | 153 tab_contents->AddInfoBar(new ExtensionDisabledInfobarDelegate( |
154 tab_contents, service, extension)); | 154 tab_contents, service, extension)); |
155 } | 155 } |
OLD | NEW |