| 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/message_loop.h" | 10 #include "base/message_loop.h" |
| (...skipping 660 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 671 record_oauth2_grant_ = true; | 671 record_oauth2_grant_ = true; |
| 672 ShowConfirmation(); | 672 ShowConfirmation(); |
| 673 } | 673 } |
| 674 | 674 |
| 675 void ExtensionInstallPrompt::OnMintTokenFailure( | 675 void ExtensionInstallPrompt::OnMintTokenFailure( |
| 676 const GoogleServiceAuthError& error) { | 676 const GoogleServiceAuthError& error) { |
| 677 ShowConfirmation(); | 677 ShowConfirmation(); |
| 678 } | 678 } |
| 679 | 679 |
| 680 void ExtensionInstallPrompt::ShowConfirmation() { | 680 void ExtensionInstallPrompt::ShowConfirmation() { |
| 681 if (permissions_ && | 681 if (permissions_.get() && |
| 682 (!extension_ || | 682 (!extension_ || |
| 683 !extensions::PermissionsData::ShouldSkipPermissionWarnings( | 683 !extensions::PermissionsData::ShouldSkipPermissionWarnings( |
| 684 extension_))) { | 684 extension_))) { |
| 685 Manifest::Type extension_type = extension_ ? | 685 Manifest::Type extension_type = extension_ ? |
| 686 extension_->GetType() : Manifest::TYPE_UNKNOWN; | 686 extension_->GetType() : Manifest::TYPE_UNKNOWN; |
| 687 prompt_.SetPermissions(permissions_->GetWarningMessages(extension_type)); | 687 prompt_.SetPermissions(permissions_->GetWarningMessages(extension_type)); |
| 688 } | 688 } |
| 689 | 689 |
| 690 switch (prompt_.type()) { | 690 switch (prompt_.type()) { |
| 691 case PERMISSIONS_PROMPT: | 691 case PERMISSIONS_PROMPT: |
| (...skipping 16 matching lines...) Expand all Loading... |
| 708 } | 708 } |
| 709 | 709 |
| 710 if (AutoConfirmPrompt(delegate_)) | 710 if (AutoConfirmPrompt(delegate_)) |
| 711 return; | 711 return; |
| 712 | 712 |
| 713 if (show_dialog_callback_.is_null()) | 713 if (show_dialog_callback_.is_null()) |
| 714 GetDefaultShowDialogCallback().Run(show_params_, delegate_, prompt_); | 714 GetDefaultShowDialogCallback().Run(show_params_, delegate_, prompt_); |
| 715 else | 715 else |
| 716 show_dialog_callback_.Run(show_params_, delegate_, prompt_); | 716 show_dialog_callback_.Run(show_params_, delegate_, prompt_); |
| 717 } | 717 } |
| OLD | NEW |