| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/extensions_ui.h" | 5 #include "chrome/browser/extensions/extensions_ui.h" |
| 6 | 6 |
| 7 #include "app/l10n_util.h" | 7 #include "app/l10n_util.h" |
| 8 #include "app/resource_bundle.h" | 8 #include "app/resource_bundle.h" |
| 9 #include "base/base64.h" | 9 #include "base/base64.h" |
| 10 #include "base/callback.h" | 10 #include "base/callback.h" |
| (...skipping 610 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 621 IDS_EXTENSION_PACK_DIALOG_ERROR_KEY_INVALID)); | 621 IDS_EXTENSION_PACK_DIALOG_ERROR_KEY_INVALID)); |
| 622 return; | 622 return; |
| 623 } | 623 } |
| 624 | 624 |
| 625 pack_job_ = new PackExtensionJob(this, root_directory, key_file); | 625 pack_job_ = new PackExtensionJob(this, root_directory, key_file); |
| 626 pack_job_->Start(); | 626 pack_job_->Start(); |
| 627 } | 627 } |
| 628 | 628 |
| 629 void ExtensionsDOMHandler::OnPackSuccess(const FilePath& crx_file, | 629 void ExtensionsDOMHandler::OnPackSuccess(const FilePath& crx_file, |
| 630 const FilePath& pem_file) { | 630 const FilePath& pem_file) { |
| 631 std::string message; | 631 ShowAlert(WideToUTF8(PackExtensionJob::StandardSuccessMessage(crx_file, |
| 632 if (!pem_file.empty()) { | 632 pem_file))); |
| 633 message = l10n_util::GetStringFUTF8( | |
| 634 IDS_EXTENSION_PACK_DIALOG_SUCCESS_BODY_NEW, | |
| 635 WideToUTF16(crx_file.ToWStringHack()), | |
| 636 WideToUTF16(pem_file.ToWStringHack())); | |
| 637 } else { | |
| 638 message = l10n_util::GetStringFUTF8( | |
| 639 IDS_EXTENSION_PACK_DIALOG_SUCCESS_BODY_UPDATE, | |
| 640 WideToUTF16(crx_file.ToWStringHack())); | |
| 641 } | |
| 642 ShowAlert(message); | |
| 643 | 633 |
| 644 ListValue results; | 634 ListValue results; |
| 645 dom_ui_->CallJavascriptFunction(L"hidePackDialog", results); | 635 dom_ui_->CallJavascriptFunction(L"hidePackDialog", results); |
| 646 } | 636 } |
| 647 | 637 |
| 648 void ExtensionsDOMHandler::OnPackFailure(const std::string& error) { | 638 void ExtensionsDOMHandler::OnPackFailure(const std::string& error) { |
| 649 ShowAlert(error); | 639 ShowAlert(error); |
| 650 } | 640 } |
| 651 | 641 |
| 652 void ExtensionsDOMHandler::HandleAutoUpdateMessage(const Value* value) { | 642 void ExtensionsDOMHandler::HandleAutoUpdateMessage(const Value* value) { |
| (...skipping 293 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 946 // static | 936 // static |
| 947 RefCountedMemory* ExtensionsUI::GetFaviconResourceBytes() { | 937 RefCountedMemory* ExtensionsUI::GetFaviconResourceBytes() { |
| 948 return ResourceBundle::GetSharedInstance(). | 938 return ResourceBundle::GetSharedInstance(). |
| 949 LoadDataResourceBytes(IDR_PLUGIN); | 939 LoadDataResourceBytes(IDR_PLUGIN); |
| 950 } | 940 } |
| 951 | 941 |
| 952 // static | 942 // static |
| 953 void ExtensionsUI::RegisterUserPrefs(PrefService* prefs) { | 943 void ExtensionsUI::RegisterUserPrefs(PrefService* prefs) { |
| 954 prefs->RegisterBooleanPref(prefs::kExtensionsUIDeveloperMode, false); | 944 prefs->RegisterBooleanPref(prefs::kExtensionsUIDeveloperMode, false); |
| 955 } | 945 } |
| OLD | NEW |