OLD | NEW |
---|---|
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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/pack_extension_job.h" | 5 #include "chrome/browser/extensions/pack_extension_job.h" |
6 | 6 |
7 #include "app/l10n_util.h" | 7 #include "app/l10n_util.h" |
8 #include "base/message_loop.h" | 8 #include "base/message_loop.h" |
9 #include "base/sys_string_conversions.h" | |
9 #include "base/utf_string_conversions.h" | 10 #include "base/utf_string_conversions.h" |
10 #include "base/task.h" | 11 #include "base/task.h" |
11 #include "chrome/browser/extensions/extension_creator.h" | 12 #include "chrome/browser/extensions/extension_creator.h" |
12 #include "chrome/common/chrome_constants.h" | 13 #include "chrome/common/chrome_constants.h" |
13 #include "grit/generated_resources.h" | 14 #include "grit/generated_resources.h" |
14 | 15 |
15 PackExtensionJob::PackExtensionJob(Client* client, | 16 PackExtensionJob::PackExtensionJob(Client* client, |
16 const FilePath& root_directory, | 17 const FilePath& root_directory, |
17 const FilePath& key_file) | 18 const FilePath& key_file) |
18 : client_(client), key_file_(key_file), asynchronous_(true) { | 19 : client_(client), key_file_(key_file), asynchronous_(true) { |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
73 if (client_) | 74 if (client_) |
74 client_->OnPackSuccess(crx_file_out_, key_file_out_); | 75 client_->OnPackSuccess(crx_file_out_, key_file_out_); |
75 } | 76 } |
76 | 77 |
77 void PackExtensionJob::ReportFailureOnClientThread(const std::string& error) { | 78 void PackExtensionJob::ReportFailureOnClientThread(const std::string& error) { |
78 if (client_) | 79 if (client_) |
79 client_->OnPackFailure(error); | 80 client_->OnPackFailure(error); |
80 } | 81 } |
81 | 82 |
82 // static | 83 // static |
83 std::wstring PackExtensionJob::StandardSuccessMessage(const FilePath& crx_file, | 84 string16 PackExtensionJob::StandardSuccessMessage(const FilePath& crx_file, |
84 const FilePath& key_file) | 85 const FilePath& key_file) { |
85 { | 86 #if defined(OS_WIN) |
86 // TODO(isherman): we should use string16 instead of wstring. | 87 string16 crx_file_string = crx_file.value(); |
87 // See crbug.com/23581 and crbug.com/24672 | 88 string16 key_file_string = key_file.value(); |
88 std::wstring message; | 89 #else |
90 string16 crx_file_string = | |
91 WideToUTF16(base::SysNativeMBToWide(crx_file.value())); | |
viettrungluu
2010/12/29 19:04:15
Don't do this. Use WideToUTF16(..._file.ToWStringH
Avi (use Gerrit)
2010/12/29 19:40:49
Done.
| |
92 string16 key_file_string = | |
93 WideToUTF16(base::SysNativeMBToWide(key_file.value())); | |
94 #endif | |
89 if (key_file.empty()) { | 95 if (key_file.empty()) { |
viettrungluu
2010/12/29 19:04:15
key_file_string, I guess.
Avi (use Gerrit)
2010/12/29 19:40:49
Done.
| |
90 return l10n_util::GetStringF( | 96 return l10n_util::GetStringFUTF16( |
91 IDS_EXTENSION_PACK_DIALOG_SUCCESS_BODY_UPDATE, | 97 IDS_EXTENSION_PACK_DIALOG_SUCCESS_BODY_UPDATE, |
92 crx_file.ToWStringHack()); | 98 crx_file_string); |
93 } else { | 99 } else { |
94 return l10n_util::GetStringF( | 100 return l10n_util::GetStringFUTF16( |
95 IDS_EXTENSION_PACK_DIALOG_SUCCESS_BODY_NEW, | 101 IDS_EXTENSION_PACK_DIALOG_SUCCESS_BODY_NEW, |
96 crx_file.ToWStringHack(), | 102 crx_file_string, |
97 key_file.ToWStringHack()); | 103 key_file_string); |
98 } | 104 } |
99 } | 105 } |
OLD | NEW |