| 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/webstore_startup_installer.h" | 5 #include "chrome/browser/extensions/webstore_startup_installer.h" |
| 6 | 6 |
| 7 #include "base/memory/ptr_util.h" | 7 #include "base/memory/ptr_util.h" |
| 8 | 8 |
| 9 namespace extensions { | 9 namespace extensions { |
| 10 | 10 |
| 11 WebstoreStartupInstaller::WebstoreStartupInstaller( | 11 WebstoreStartupInstaller::WebstoreStartupInstaller( |
| 12 const std::string& webstore_item_id, | 12 const std::string& webstore_item_id, |
| 13 Profile* profile, | 13 Profile* profile, |
| 14 bool show_prompt, | 14 bool show_prompt, |
| 15 const Callback& callback) | 15 const Callback& callback) |
| 16 : WebstoreInstallWithPrompt(webstore_item_id, profile, callback), | 16 : WebstoreInstallWithPrompt(webstore_item_id, profile, callback), |
| 17 show_prompt_(show_prompt) { | 17 show_prompt_(show_prompt) { |
| 18 set_install_source(WebstoreInstaller::INSTALL_SOURCE_INLINE); | 18 set_install_source(WebstoreInstaller::INSTALL_SOURCE_INLINE); |
| 19 set_show_post_install_ui(false); | 19 set_show_post_install_ui(false); |
| 20 } | 20 } |
| 21 | 21 |
| 22 WebstoreStartupInstaller::~WebstoreStartupInstaller() {} | 22 WebstoreStartupInstaller::~WebstoreStartupInstaller() {} |
| 23 | 23 |
| 24 std::unique_ptr<ExtensionInstallPrompt::Prompt> | 24 std::unique_ptr<ExtensionInstallPrompt::Prompt> |
| 25 WebstoreStartupInstaller::CreateInstallPrompt() const { | 25 WebstoreStartupInstaller::CreateInstallPrompt() const { |
| 26 if (show_prompt_) { | 26 if (show_prompt_) { |
| 27 return base::WrapUnique(new ExtensionInstallPrompt::Prompt( | 27 return base::MakeUnique<ExtensionInstallPrompt::Prompt>( |
| 28 ExtensionInstallPrompt::INSTALL_PROMPT)); | 28 ExtensionInstallPrompt::INSTALL_PROMPT); |
| 29 } | 29 } |
| 30 return NULL; | 30 return NULL; |
| 31 } | 31 } |
| 32 | 32 |
| 33 } // namespace extensions | 33 } // namespace extensions |
| OLD | NEW |