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 <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/callback_helpers.h" | 9 #include "base/callback_helpers.h" |
10 #include "base/location.h" | 10 #include "base/location.h" |
(...skipping 581 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
592 localized_manifest->SetString(extensions::manifest_keys::kName, | 592 localized_manifest->SetString(extensions::manifest_keys::kName, |
593 localized_name); | 593 localized_name); |
594 } | 594 } |
595 if (!localized_description.empty()) { | 595 if (!localized_description.empty()) { |
596 localized_manifest->SetString(extensions::manifest_keys::kDescription, | 596 localized_manifest->SetString(extensions::manifest_keys::kDescription, |
597 localized_description); | 597 localized_description); |
598 } | 598 } |
599 } | 599 } |
600 | 600 |
601 return Extension::Create( | 601 return Extension::Create( |
602 base::FilePath(), | 602 base::FilePath(), Manifest::INTERNAL, |
603 Manifest::INTERNAL, | 603 localized_manifest.get() ? *localized_manifest : *manifest, flags, id, |
604 localized_manifest.get() ? *localized_manifest.get() : *manifest, | |
605 flags, | |
606 id, | |
607 error); | 604 error); |
608 } | 605 } |
609 | 606 |
610 ExtensionInstallPrompt::ExtensionInstallPrompt(content::WebContents* contents) | 607 ExtensionInstallPrompt::ExtensionInstallPrompt(content::WebContents* contents) |
611 : profile_(ProfileForWebContents(contents)), | 608 : profile_(ProfileForWebContents(contents)), |
612 extension_(NULL), | 609 extension_(NULL), |
613 install_ui_(extensions::CreateExtensionInstallUI( | 610 install_ui_(extensions::CreateExtensionInstallUI( |
614 ProfileForWebContents(contents))), | 611 ProfileForWebContents(contents))), |
615 show_params_(new ExtensionInstallPromptShowParams(contents)), | 612 show_params_(new ExtensionInstallPromptShowParams(contents)), |
616 did_call_show_dialog_(false), | 613 did_call_show_dialog_(false), |
(...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
826 | 823 |
827 if (AutoConfirmPrompt(&done_callback_)) | 824 if (AutoConfirmPrompt(&done_callback_)) |
828 return; | 825 return; |
829 | 826 |
830 if (show_dialog_callback_.is_null()) | 827 if (show_dialog_callback_.is_null()) |
831 show_dialog_callback_ = GetDefaultShowDialogCallback(); | 828 show_dialog_callback_ = GetDefaultShowDialogCallback(); |
832 base::ResetAndReturn(&show_dialog_callback_) | 829 base::ResetAndReturn(&show_dialog_callback_) |
833 .Run(show_params_.get(), base::ResetAndReturn(&done_callback_), | 830 .Run(show_params_.get(), base::ResetAndReturn(&done_callback_), |
834 std::move(prompt_)); | 831 std::move(prompt_)); |
835 } | 832 } |
OLD | NEW |