Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(452)

Side by Side Diff: chrome/browser/extensions/extension_disabled_infobar_delegate.cc

Issue 518083: Make sure that pointer to the ExtensionsService is valid in the extensions infobars. (Closed)
Patch Set: Created 10 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « chrome/browser/extensions/crashed_extension_infobar.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/extension_file_util.h" 9 #include "chrome/browser/extensions/extension_file_util.h"
10 #include "chrome/browser/extensions/extension_install_ui.h" 10 #include "chrome/browser/extensions/extension_install_ui.h"
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
135 break; 135 break;
136 } 136 }
137 default: 137 default:
138 NOTREACHED(); 138 NOTREACHED();
139 } 139 }
140 } 140 }
141 141
142 private: 142 private:
143 NotificationRegistrar registrar_; 143 NotificationRegistrar registrar_;
144 TabContents* tab_contents_; 144 TabContents* tab_contents_;
145 ExtensionsService* service_; 145 scoped_refptr<ExtensionsService> service_;
146 Extension* extension_; 146 Extension* extension_;
147 }; 147 };
148 148
149 void ShowExtensionDisabledUI(ExtensionsService* service, Profile* profile, 149 void ShowExtensionDisabledUI(ExtensionsService* service, Profile* profile,
150 Extension* extension) { 150 Extension* extension) {
151 Browser* browser = BrowserList::GetLastActiveWithProfile(profile); 151 Browser* browser = BrowserList::GetLastActiveWithProfile(profile);
152 if (!browser) 152 if (!browser)
153 return; 153 return;
154 154
155 TabContents* tab_contents = browser->GetSelectedTabContents(); 155 TabContents* tab_contents = browser->GetSelectedTabContents();
156 if (!tab_contents) 156 if (!tab_contents)
157 return; 157 return;
158 158
159 tab_contents->AddInfoBar(new ExtensionDisabledInfobarDelegate( 159 tab_contents->AddInfoBar(new ExtensionDisabledInfobarDelegate(
160 tab_contents, service, extension)); 160 tab_contents, service, extension));
161 } 161 }
162 162
163 void ShowExtensionDisabledDialog(ExtensionsService* service, Profile* profile, 163 void ShowExtensionDisabledDialog(ExtensionsService* service, Profile* profile,
164 Extension* extension) { 164 Extension* extension) {
165 // This object manages its own lifetime. 165 // This object manages its own lifetime.
166 new ExtensionDisabledDialogDelegate(profile, service, extension); 166 new ExtensionDisabledDialogDelegate(profile, service, extension);
167 } 167 }
OLDNEW
« no previous file with comments | « chrome/browser/extensions/crashed_extension_infobar.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698