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

Side by Side Diff: chrome/browser/ui/extensions/extension_install_ui_default.cc

Issue 168823004: Fix crash with --load-extension for extensions with plugins (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix unit_tests (load_extension_crash) Created 6 years, 10 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 | Annotate | Revision Log
« no previous file with comments | « chrome/browser/extensions/unpacked_installer.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) 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 #include "chrome/browser/ui/extensions/extension_install_ui_default.h" 5 #include "chrome/browser/ui/extensions/extension_install_ui_default.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/strings/utf_string_conversions.h" 9 #include "base/strings/utf_string_conversions.h"
10 #include "chrome/browser/chrome_notification_types.h" 10 #include "chrome/browser/chrome_notification_types.h"
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after
184 if (browser) 184 if (browser)
185 web_contents = browser->tab_strip_model()->GetActiveWebContents(); 185 web_contents = browser->tab_strip_model()->GetActiveWebContents();
186 return new ExtensionInstallPrompt(web_contents); 186 return new ExtensionInstallPrompt(web_contents);
187 } 187 }
188 188
189 // static 189 // static
190 ExtensionInstallPrompt* ExtensionInstallUI::CreateInstallPromptWithProfile( 190 ExtensionInstallPrompt* ExtensionInstallUI::CreateInstallPromptWithProfile(
191 Profile* profile) { 191 Profile* profile) {
192 Browser* browser = chrome::FindLastActiveWithProfile(profile, 192 Browser* browser = chrome::FindLastActiveWithProfile(profile,
193 chrome::GetActiveDesktop()); 193 chrome::GetActiveDesktop());
194 return CreateInstallPromptWithBrowser(browser); 194 if (browser)
195 return CreateInstallPromptWithBrowser(browser);
196 // No browser window is open yet. Create a free-standing dialog associated
197 // with |profile|.
198 return new ExtensionInstallPrompt(profile, NULL, NULL);
195 } 199 }
196 200
197 201
198 // ExtensionInstallUIDefault -------------------------------------------------- 202 // ExtensionInstallUIDefault --------------------------------------------------
199 203
200 ExtensionInstallUIDefault::ExtensionInstallUIDefault(Profile* profile) 204 ExtensionInstallUIDefault::ExtensionInstallUIDefault(Profile* profile)
201 : ExtensionInstallUI(profile), 205 : ExtensionInstallUI(profile),
202 previous_using_native_theme_(false), 206 previous_using_native_theme_(false),
203 use_app_installed_bubble_(false) { 207 use_app_installed_bubble_(false) {
204 // |profile| can be NULL during tests. 208 // |profile| can be NULL during tests.
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
284 browser->tab_strip_model()->GetActiveWebContents(); 288 browser->tab_strip_model()->GetActiveWebContents();
285 if (!web_contents) 289 if (!web_contents)
286 return; 290 return;
287 ErrorInfoBarDelegate::Create(InfoBarService::FromWebContents(web_contents), 291 ErrorInfoBarDelegate::Create(InfoBarService::FromWebContents(web_contents),
288 error); 292 error);
289 } 293 }
290 294
291 void ExtensionInstallUIDefault::SetUseAppInstalledBubble(bool use_bubble) { 295 void ExtensionInstallUIDefault::SetUseAppInstalledBubble(bool use_bubble) {
292 use_app_installed_bubble_ = use_bubble; 296 use_app_installed_bubble_ = use_bubble;
293 } 297 }
OLDNEW
« no previous file with comments | « chrome/browser/extensions/unpacked_installer.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698