OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |