| 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_dialog.h" | 5 #include "chrome/browser/extensions/extension_install_dialog.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/file_path.h" | 9 #include "base/file_path.h" |
| 10 #include "base/message_loop.h" | 10 #include "base/message_loop.h" |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 52 return ABORT; | 52 return ABORT; |
| 53 else | 53 else |
| 54 NOTREACHED(); | 54 NOTREACHED(); |
| 55 return DO_NOT_SKIP; | 55 return DO_NOT_SKIP; |
| 56 } | 56 } |
| 57 | 57 |
| 58 } // namespace | 58 } // namespace |
| 59 | 59 |
| 60 void ShowExtensionInstallDialog(Profile* profile, | 60 void ShowExtensionInstallDialog(Profile* profile, |
| 61 ExtensionInstallUI::Delegate* delegate, | 61 ExtensionInstallUI::Delegate* delegate, |
| 62 const Extension* extension, | |
| 63 SkBitmap* icon, | |
| 64 const ExtensionInstallUI::Prompt& prompt) { | 62 const ExtensionInstallUI::Prompt& prompt) { |
| 65 AutoConfirmForTest auto_confirm = CheckAutoConfirmCommandLineSwitch(); | 63 AutoConfirmForTest auto_confirm = CheckAutoConfirmCommandLineSwitch(); |
| 66 if (auto_confirm != DO_NOT_SKIP) { | 64 if (auto_confirm != DO_NOT_SKIP) { |
| 67 DoAutoConfirm(auto_confirm, delegate); | 65 DoAutoConfirm(auto_confirm, delegate); |
| 68 return; | 66 return; |
| 69 } | 67 } |
| 70 ShowExtensionInstallDialogImpl(profile, delegate, extension, icon, prompt); | 68 ShowExtensionInstallDialogImpl(profile, delegate, prompt); |
| 71 } | 69 } |
| 72 | 70 |
| 73 bool ShowExtensionInstallDialogForManifest( | 71 bool ShowExtensionInstallDialogForManifest( |
| 74 Profile *profile, | 72 Profile* profile, |
| 75 ExtensionInstallUI::Delegate* delegate, | 73 ExtensionInstallUI::Delegate* delegate, |
| 76 const DictionaryValue* manifest, | 74 const DictionaryValue* manifest, |
| 77 const std::string& id, | 75 const std::string& id, |
| 78 const std::string& localized_name, | 76 const std::string& localized_name, |
| 79 const std::string& localized_description, | 77 const std::string& localized_description, |
| 80 SkBitmap* icon, | 78 SkBitmap* icon, |
| 81 const ExtensionInstallUI::Prompt& prompt, | 79 const ExtensionInstallUI::Prompt& prompt, |
| 82 scoped_refptr<Extension>* dummy_extension) { | 80 scoped_refptr<Extension>* dummy_extension) { |
| 83 scoped_ptr<DictionaryValue> localized_manifest; | 81 scoped_ptr<DictionaryValue> localized_manifest; |
| 84 if (!localized_name.empty() || !localized_description.empty()) { | 82 if (!localized_name.empty() || !localized_description.empty()) { |
| (...skipping 28 matching lines...) Expand all Loading... |
| 113 // confirmation dialog. | 111 // confirmation dialog. |
| 114 AutoConfirmForTest auto_confirm = CheckAutoConfirmCommandLineSwitch(); | 112 AutoConfirmForTest auto_confirm = CheckAutoConfirmCommandLineSwitch(); |
| 115 if (auto_confirm != DO_NOT_SKIP) { | 113 if (auto_confirm != DO_NOT_SKIP) { |
| 116 DoAutoConfirm(auto_confirm, delegate); | 114 DoAutoConfirm(auto_confirm, delegate); |
| 117 return true; | 115 return true; |
| 118 } | 116 } |
| 119 | 117 |
| 120 ExtensionInstallUI::Prompt filled_out_prompt = prompt; | 118 ExtensionInstallUI::Prompt filled_out_prompt = prompt; |
| 121 filled_out_prompt.SetPermissions( | 119 filled_out_prompt.SetPermissions( |
| 122 (*dummy_extension)->GetPermissionMessageStrings()); | 120 (*dummy_extension)->GetPermissionMessageStrings()); |
| 121 filled_out_prompt.set_extension(*dummy_extension); |
| 122 filled_out_prompt.set_icon(*icon); |
| 123 | 123 |
| 124 ShowExtensionInstallDialog(profile, | 124 ShowExtensionInstallDialog(profile, delegate, filled_out_prompt); |
| 125 delegate, | |
| 126 dummy_extension->get(), | |
| 127 icon, | |
| 128 filled_out_prompt); | |
| 129 return true; | 125 return true; |
| 130 } | 126 } |
| OLD | NEW |