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 451 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
462 | 462 |
463 void ExtensionInstallPrompt::OnMintTokenFailure( | 463 void ExtensionInstallPrompt::OnMintTokenFailure( |
464 const GoogleServiceAuthError& error) { | 464 const GoogleServiceAuthError& error) { |
465 ShowConfirmation(); | 465 ShowConfirmation(); |
466 } | 466 } |
467 | 467 |
468 void ExtensionInstallPrompt::ShowConfirmation() { | 468 void ExtensionInstallPrompt::ShowConfirmation() { |
469 prompt_.set_type(prompt_type_); | 469 prompt_.set_type(prompt_type_); |
470 | 470 |
471 if (permissions_) | 471 if (permissions_) |
472 prompt_.SetPermissions(permissions_->GetWarningMessages()); | 472 prompt_.SetPermissions(permissions_->GetWarningMessages(extension_)); |
473 | 473 |
474 switch (prompt_type_) { | 474 switch (prompt_type_) { |
475 case PERMISSIONS_PROMPT: | 475 case PERMISSIONS_PROMPT: |
476 case RE_ENABLE_PROMPT: | 476 case RE_ENABLE_PROMPT: |
477 case INLINE_INSTALL_PROMPT: | 477 case INLINE_INSTALL_PROMPT: |
478 case INSTALL_PROMPT: { | 478 case INSTALL_PROMPT: { |
479 prompt_.set_extension(extension_); | 479 prompt_.set_extension(extension_); |
480 prompt_.set_icon(gfx::Image(icon_)); | 480 prompt_.set_icon(gfx::Image(icon_)); |
481 ShowExtensionInstallDialog(parent_, navigator_, delegate_, prompt_); | 481 ShowExtensionInstallDialog(parent_, navigator_, delegate_, prompt_); |
482 break; | 482 break; |
(...skipping 21 matching lines...) Expand all Loading... |
504 Browser* browser) { | 504 Browser* browser) { |
505 // |browser| can be NULL in unit tests. | 505 // |browser| can be NULL in unit tests. |
506 if (!browser) | 506 if (!browser) |
507 return new ExtensionInstallPrompt(NULL, NULL, NULL); | 507 return new ExtensionInstallPrompt(NULL, NULL, NULL); |
508 gfx::NativeWindow parent = | 508 gfx::NativeWindow parent = |
509 browser->window() ? browser->window()->GetNativeWindow() : NULL; | 509 browser->window() ? browser->window()->GetNativeWindow() : NULL; |
510 return new ExtensionInstallPrompt(parent, browser, browser->profile()); | 510 return new ExtensionInstallPrompt(parent, browser, browser->profile()); |
511 } | 511 } |
512 | 512 |
513 } // namespace chrome | 513 } // namespace chrome |
OLD | NEW |