| 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_disabled_ui.h" | 5 #include "chrome/browser/extensions/extension_disabled_ui.h" |
| 6 | 6 |
| 7 #include <bitset> | 7 #include <bitset> |
| 8 #include <memory> | 8 #include <memory> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 100 extension_(extension) { | 100 extension_(extension) { |
| 101 ExtensionInstallPrompt::PromptType type = | 101 ExtensionInstallPrompt::PromptType type = |
| 102 ExtensionInstallPrompt::GetReEnablePromptTypeForExtension( | 102 ExtensionInstallPrompt::GetReEnablePromptTypeForExtension( |
| 103 service_->profile(), extension); | 103 service_->profile(), extension); |
| 104 // Unretained() is safe since this object manages its own lifetime and deletes | 104 // Unretained() is safe since this object manages its own lifetime and deletes |
| 105 // itself only once the prompt finishes. | 105 // itself only once the prompt finishes. |
| 106 install_ui_->ShowDialog( | 106 install_ui_->ShowDialog( |
| 107 base::Bind(&ExtensionDisabledDialogDelegate::InstallPromptDone, | 107 base::Bind(&ExtensionDisabledDialogDelegate::InstallPromptDone, |
| 108 base::Unretained(this)), | 108 base::Unretained(this)), |
| 109 extension_, nullptr, | 109 extension_, nullptr, |
| 110 base::WrapUnique(new ExtensionInstallPrompt::Prompt(type)), | 110 base::MakeUnique<ExtensionInstallPrompt::Prompt>(type), |
| 111 ExtensionInstallPrompt::GetDefaultShowDialogCallback()); | 111 ExtensionInstallPrompt::GetDefaultShowDialogCallback()); |
| 112 } | 112 } |
| 113 | 113 |
| 114 ExtensionDisabledDialogDelegate::~ExtensionDisabledDialogDelegate() { | 114 ExtensionDisabledDialogDelegate::~ExtensionDisabledDialogDelegate() { |
| 115 } | 115 } |
| 116 | 116 |
| 117 void ExtensionDisabledDialogDelegate::InstallPromptDone( | 117 void ExtensionDisabledDialogDelegate::InstallPromptDone( |
| 118 ExtensionInstallPrompt::Result result) { | 118 ExtensionInstallPrompt::Result result) { |
| 119 if (result == ExtensionInstallPrompt::Result::ACCEPTED) { | 119 if (result == ExtensionInstallPrompt::Result::ACCEPTED) { |
| 120 service_->GrantPermissionsAndEnableExtension(extension_); | 120 service_->GrantPermissionsAndEnableExtension(extension_); |
| (...skipping 371 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 492 content::WebContents* web_contents, | 492 content::WebContents* web_contents, |
| 493 const Extension* extension) { | 493 const Extension* extension) { |
| 494 std::unique_ptr<ExtensionInstallPrompt> install_ui( | 494 std::unique_ptr<ExtensionInstallPrompt> install_ui( |
| 495 new ExtensionInstallPrompt(web_contents)); | 495 new ExtensionInstallPrompt(web_contents)); |
| 496 // This object manages its own lifetime. | 496 // This object manages its own lifetime. |
| 497 new ExtensionDisabledDialogDelegate(service, std::move(install_ui), | 497 new ExtensionDisabledDialogDelegate(service, std::move(install_ui), |
| 498 extension); | 498 extension); |
| 499 } | 499 } |
| 500 | 500 |
| 501 } // namespace extensions | 501 } // namespace extensions |
| OLD | NEW |