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/api/developer_private/developer_private_api.
h" | 5 #include "chrome/browser/extensions/api/developer_private/developer_private_api.
h" |
6 | 6 |
7 #include "base/base64.h" | 7 #include "base/base64.h" |
8 #include "base/file_util.h" | 8 #include "base/file_util.h" |
9 #include "base/strings/string_number_conversions.h" | 9 #include "base/strings/string_number_conversions.h" |
10 #include "base/utf_string_conversions.h" | 10 #include "base/utf_string_conversions.h" |
(...skipping 617 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
628 Release(); | 628 Release(); |
629 } | 629 } |
630 | 630 |
631 bool DeveloperPrivatePackDirectoryFunction::RunImpl() { | 631 bool DeveloperPrivatePackDirectoryFunction::RunImpl() { |
632 int flags; | 632 int flags; |
633 EXTENSION_FUNCTION_VALIDATE(args_->GetString(0, &item_path_str_)); | 633 EXTENSION_FUNCTION_VALIDATE(args_->GetString(0, &item_path_str_)); |
634 EXTENSION_FUNCTION_VALIDATE(args_->GetString(1, &key_path_str_)); | 634 EXTENSION_FUNCTION_VALIDATE(args_->GetString(1, &key_path_str_)); |
635 EXTENSION_FUNCTION_VALIDATE(args_->GetInteger(2, &flags)); | 635 EXTENSION_FUNCTION_VALIDATE(args_->GetInteger(2, &flags)); |
636 | 636 |
637 base::FilePath root_directory = | 637 base::FilePath root_directory = |
638 base::FilePath::FromWStringHack(UTF8ToWide(item_path_str_)); | 638 base::FilePath::FromWStringHack(base::UTF8ToWide(item_path_str_)); |
639 | 639 |
640 base::FilePath key_file = | 640 base::FilePath key_file = |
641 base::FilePath::FromWStringHack(UTF8ToWide(key_path_str_)); | 641 base::FilePath::FromWStringHack(base::UTF8ToWide(key_path_str_)); |
642 | 642 |
643 developer::PackDirectoryResponse response; | 643 developer::PackDirectoryResponse response; |
644 if (root_directory.empty()) { | 644 if (root_directory.empty()) { |
645 if (item_path_str_.empty()) | 645 if (item_path_str_.empty()) |
646 response.message = l10n_util::GetStringUTF8( | 646 response.message = l10n_util::GetStringUTF8( |
647 IDS_EXTENSION_PACK_DIALOG_ERROR_ROOT_REQUIRED); | 647 IDS_EXTENSION_PACK_DIALOG_ERROR_ROOT_REQUIRED); |
648 else | 648 else |
649 response.message = l10n_util::GetStringUTF8( | 649 response.message = l10n_util::GetStringUTF8( |
650 IDS_EXTENSION_PACK_DIALOG_ERROR_ROOT_INVALID); | 650 IDS_EXTENSION_PACK_DIALOG_ERROR_ROOT_INVALID); |
651 | 651 |
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
804 | 804 |
805 #undef SET_STRING | 805 #undef SET_STRING |
806 return true; | 806 return true; |
807 } | 807 } |
808 | 808 |
809 DeveloperPrivateGetStringsFunction::~DeveloperPrivateGetStringsFunction() {} | 809 DeveloperPrivateGetStringsFunction::~DeveloperPrivateGetStringsFunction() {} |
810 | 810 |
811 } // namespace api | 811 } // namespace api |
812 | 812 |
813 } // namespace extensions | 813 } // namespace extensions |
OLD | NEW |