Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(73)

Side by Side Diff: chrome/browser/extensions/pack_extension_job.cc

Issue 12256041: Fix a bug where extensions created with locale info from the command line is broken. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 7 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/pack_extension_job.h" 5 #include "chrome/browser/extensions/pack_extension_job.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/message_loop.h" 8 #include "base/message_loop.h"
9 #include "base/sys_string_conversions.h" 9 #include "base/sys_string_conversions.h"
10 #include "base/utf_string_conversions.h" 10 #include "base/utf_string_conversions.h"
11 #include "chrome/browser/extensions/extension_creator.h" 11 #include "chrome/browser/extensions/extension_creator.h"
12 #include "chrome/common/chrome_constants.h" 12 #include "chrome/common/chrome_constants.h"
13 #include "chrome/common/extensions/api/i18n/default_locale_handler.h"
14 #include "chrome/common/extensions/extension_manifest_constants.h"
15 #include "chrome/common/extensions/manifest_handler.h"
13 #include "grit/generated_resources.h" 16 #include "grit/generated_resources.h"
14 #include "ui/base/l10n/l10n_util.h" 17 #include "ui/base/l10n/l10n_util.h"
15 18
16 using content::BrowserThread; 19 using content::BrowserThread;
17 20
18 namespace extensions { 21 namespace extensions {
19 22
20 PackExtensionJob::PackExtensionJob(Client* client, 23 PackExtensionJob::PackExtensionJob(Client* client,
21 const base::FilePath& root_directory, 24 const base::FilePath& root_directory,
22 const base::FilePath& key_file, 25 const base::FilePath& key_file,
23 int run_flags) 26 int run_flags)
24 : client_(client), key_file_(key_file), asynchronous_(true), 27 : client_(client), key_file_(key_file), asynchronous_(true),
25 run_flags_(run_flags | ExtensionCreator::kRequireModernManifestVersion) { 28 run_flags_(run_flags | ExtensionCreator::kRequireModernManifestVersion) {
26 root_directory_ = root_directory.StripTrailingSeparators(); 29 root_directory_ = root_directory.StripTrailingSeparators();
27 CHECK(BrowserThread::GetCurrentThreadIdentifier(&client_thread_id_)); 30 CHECK(BrowserThread::GetCurrentThreadIdentifier(&client_thread_id_));
31 ManifestHandler::Register(extension_manifest_keys::kDefaultLocale,
32 make_linked_ptr(new DefaultLocaleHandler));
Joe Thomas 2013/02/14 18:14:42 We can also move this registration to StartupHelpe
Yoyo Zhou 2013/02/14 18:41:02 I think it belongs in StartupHelper, probably the
Joe Thomas 2013/02/14 18:48:47 I thought about that. Then I found that we just de
Joe Thomas 2013/02/14 19:16:28 Done.
28 } 33 }
29 34
30 void PackExtensionJob::Start() { 35 void PackExtensionJob::Start() {
31 if (asynchronous_) { 36 if (asynchronous_) {
32 BrowserThread::PostTask( 37 BrowserThread::PostTask(
33 BrowserThread::FILE, FROM_HERE, 38 BrowserThread::FILE, FROM_HERE,
34 base::Bind(&PackExtensionJob::Run, this)); 39 base::Bind(&PackExtensionJob::Run, this));
35 } else { 40 } else {
36 Run(); 41 Run();
37 } 42 }
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
101 crx_file_string); 106 crx_file_string);
102 } else { 107 } else {
103 return l10n_util::GetStringFUTF16( 108 return l10n_util::GetStringFUTF16(
104 IDS_EXTENSION_PACK_DIALOG_SUCCESS_BODY_NEW, 109 IDS_EXTENSION_PACK_DIALOG_SUCCESS_BODY_NEW,
105 crx_file_string, 110 crx_file_string,
106 key_file_string); 111 key_file_string);
107 } 112 }
108 } 113 }
109 114
110 } // namespace extensions 115 } // namespace extensions
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698