| 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/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 52 return PROCEED; | 52 return PROCEED; |
| 53 else if (value == "cancel") | 53 else if (value == "cancel") |
| 54 return ABORT; | 54 return ABORT; |
| 55 else | 55 else |
| 56 NOTREACHED(); | 56 NOTREACHED(); |
| 57 return DO_NOT_SKIP; | 57 return DO_NOT_SKIP; |
| 58 } | 58 } |
| 59 | 59 |
| 60 } // namespace | 60 } // namespace |
| 61 | 61 |
| 62 void ShowExtensionInstallDialog(gfx::NativeWindow parent, | 62 void ShowExtensionInstallDialog( |
| 63 content::PageNavigator* navigator, | 63 gfx::NativeWindow parent, |
| 64 ExtensionInstallPrompt::Delegate* delegate, | 64 content::PageNavigator* navigator, |
| 65 const ExtensionInstallPrompt::Prompt& prompt) { | 65 ExtensionInstallPrompt::Delegate* delegate, |
| 66 const ExtensionInstallPrompt::Prompt& prompt, |
| 67 const ExtensionInstallPrompt::ShowDialogCallback& show_dialog_callback) { |
| 66 AutoConfirmForTest auto_confirm = CheckAutoConfirmCommandLineSwitch(); | 68 AutoConfirmForTest auto_confirm = CheckAutoConfirmCommandLineSwitch(); |
| 67 if (auto_confirm != DO_NOT_SKIP) { | 69 if (auto_confirm != DO_NOT_SKIP) { |
| 68 DoAutoConfirm(auto_confirm, delegate); | 70 DoAutoConfirm(auto_confirm, delegate); |
| 69 return; | 71 return; |
| 70 } | 72 } |
| 73 if (!show_dialog_callback.is_null()) { |
| 74 show_dialog_callback.Run(parent, navigator, delegate, prompt); |
| 75 return; |
| 76 } |
| 71 ShowExtensionInstallDialogImpl(parent, navigator, delegate, prompt); | 77 ShowExtensionInstallDialogImpl(parent, navigator, delegate, prompt); |
| 72 } | 78 } |
| OLD | NEW |