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

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

Issue 10823243: Fix crash in bundle install dialog. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 4 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/extension_install_prompt.h ('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/extensions/extension_install_prompt.h" 5 #include "chrome/browser/extensions/extension_install_prompt.h"
6 6
7 #include <map> 7 #include <map>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/file_util.h" 10 #include "base/file_util.h"
(...skipping 452 matching lines...) Expand 10 before | Expand all | Expand 10 after
463 463
464 void ExtensionInstallPrompt::OnMintTokenFailure( 464 void ExtensionInstallPrompt::OnMintTokenFailure(
465 const GoogleServiceAuthError& error) { 465 const GoogleServiceAuthError& error) {
466 ShowConfirmation(); 466 ShowConfirmation();
467 } 467 }
468 468
469 void ExtensionInstallPrompt::ShowConfirmation() { 469 void ExtensionInstallPrompt::ShowConfirmation() {
470 prompt_.set_type(prompt_type_); 470 prompt_.set_type(prompt_type_);
471 471
472 if (permissions_) { 472 if (permissions_) {
473 prompt_.SetPermissions( 473 Extension::Type extension_type = prompt_type_ == BUNDLE_INSTALL_PROMPT ?
474 permissions_->GetWarningMessages(extension_->GetType())); 474 Extension::TYPE_UNKNOWN : extension_->GetType();
475 prompt_.SetPermissions(permissions_->GetWarningMessages(extension_type));
475 } 476 }
476 477
477 switch (prompt_type_) { 478 switch (prompt_type_) {
478 case PERMISSIONS_PROMPT: 479 case PERMISSIONS_PROMPT:
479 case RE_ENABLE_PROMPT: 480 case RE_ENABLE_PROMPT:
480 case INLINE_INSTALL_PROMPT: 481 case INLINE_INSTALL_PROMPT:
481 case INSTALL_PROMPT: { 482 case INSTALL_PROMPT: {
482 prompt_.set_extension(extension_); 483 prompt_.set_extension(extension_);
483 prompt_.set_icon(gfx::Image(icon_)); 484 prompt_.set_icon(gfx::Image(icon_));
484 ShowExtensionInstallDialog(parent_, navigator_, delegate_, prompt_); 485 ShowExtensionInstallDialog(parent_, navigator_, delegate_, prompt_);
(...skipping 22 matching lines...) Expand all
507 Browser* browser) { 508 Browser* browser) {
508 // |browser| can be NULL in unit tests. 509 // |browser| can be NULL in unit tests.
509 if (!browser) 510 if (!browser)
510 return new ExtensionInstallPrompt(NULL, NULL, NULL); 511 return new ExtensionInstallPrompt(NULL, NULL, NULL);
511 gfx::NativeWindow parent = 512 gfx::NativeWindow parent =
512 browser->window() ? browser->window()->GetNativeWindow() : NULL; 513 browser->window() ? browser->window()->GetNativeWindow() : NULL;
513 return new ExtensionInstallPrompt(parent, browser, browser->profile()); 514 return new ExtensionInstallPrompt(parent, browser, browser->profile());
514 } 515 }
515 516
516 } // namespace chrome 517 } // namespace chrome
OLDNEW
« no previous file with comments | « chrome/browser/extensions/extension_install_prompt.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698