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

Side by Side Diff: chrome/browser/user_data_dir_extractor_win.cc

Issue 13825003: Fix uninintialized ResourceBundle in ShowUserDataDirDialog. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 8 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 | Annotate | Revision Log
« 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) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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/user_data_dir_extractor_win.h" 5 #include "chrome/browser/user_data_dir_extractor_win.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/file_util.h" 8 #include "base/file_util.h"
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/path_service.h" 10 #include "base/path_service.h"
11 #include "base/process_util.h" 11 #include "base/process_util.h"
12 #include "chrome/browser/ui/user_data_dir_dialog.h" 12 #include "chrome/browser/ui/user_data_dir_dialog.h"
13 #include "chrome/browser/user_data_dir_extractor.h" 13 #include "chrome/browser/user_data_dir_extractor.h"
14 #include "chrome/common/chrome_paths.h" 14 #include "chrome/common/chrome_paths.h"
15 #include "chrome/common/chrome_switches.h" 15 #include "chrome/common/chrome_switches.h"
16 #include "content/public/common/main_function_params.h" 16 #include "content/public/common/main_function_params.h"
17 #include "ui/base/resource/resource_bundle.h"
17 18
18 namespace chrome { 19 namespace chrome {
19 20
20 namespace { 21 namespace {
21 22
22 GetUserDataDirCallback* custom_get_user_data_dir_callback = NULL; 23 GetUserDataDirCallback* custom_get_user_data_dir_callback = NULL;
23 24
24 } // namespace 25 } // namespace
25 26
26 void InstallCustomGetUserDataDirCallbackForTest( 27 void InstallCustomGetUserDataDirCallbackForTest(
(...skipping 12 matching lines...) Expand all
39 40
40 // On Windows, if we fail to get the user data dir, bring up a dialog to 41 // On Windows, if we fail to get the user data dir, bring up a dialog to
41 // prompt the user to pick a different directory, and restart chrome with 42 // prompt the user to pick a different directory, and restart chrome with
42 // the new dir. 43 // the new dir.
43 // http://code.google.com/p/chromium/issues/detail?id=11510 44 // http://code.google.com/p/chromium/issues/detail?id=11510
44 if (!file_util::PathExists(user_data_dir)) { 45 if (!file_util::PathExists(user_data_dir)) {
45 #if defined(USE_AURA) 46 #if defined(USE_AURA)
46 // TODO(beng): 47 // TODO(beng):
47 NOTIMPLEMENTED(); 48 NOTIMPLEMENTED();
48 #else 49 #else
50 // Make sure ResourceBundle is initialized. The user data dialog needs to
51 // access string resources. See http://crbug.com/230432
52 if (!ResourceBundle::HasSharedInstance())
53 ResourceBundle::InitSharedInstanceWithLocale("en-US", NULL);
Nico 2013/04/11 18:29:29 Is "en-US" correct? I suppose prefs::kApplicationL
hshi1 2013/04/11 20:23:19 I've added a check for command line locale switch.
54
49 base::FilePath new_user_data_dir = 55 base::FilePath new_user_data_dir =
50 chrome::ShowUserDataDirDialog(user_data_dir); 56 chrome::ShowUserDataDirDialog(user_data_dir);
51 57
52 if (!new_user_data_dir.empty()) { 58 if (!new_user_data_dir.empty()) {
53 // Because of the way CommandLine parses, it's sufficient to append a new 59 // Because of the way CommandLine parses, it's sufficient to append a new
54 // --user-data-dir switch. The last flag of the same name wins. 60 // --user-data-dir switch. The last flag of the same name wins.
55 // TODO(tc): It would be nice to remove the flag we don't want, but that 61 // TODO(tc): It would be nice to remove the flag we don't want, but that
56 // sounds risky if we parse differently than CommandLineToArgvW. 62 // sounds risky if we parse differently than CommandLineToArgvW.
57 CommandLine new_command_line = parameters.command_line; 63 CommandLine new_command_line = parameters.command_line;
58 new_command_line.AppendSwitchPath(switches::kUserDataDir, 64 new_command_line.AppendSwitchPath(switches::kUserDataDir,
59 new_user_data_dir); 65 new_user_data_dir);
60 base::LaunchProcess(new_command_line, base::LaunchOptions(), NULL); 66 base::LaunchProcess(new_command_line, base::LaunchOptions(), NULL);
61 } 67 }
62 #endif 68 #endif
63 NOTREACHED() << "Failed to get user data directory!"; 69 NOTREACHED() << "Failed to get user data directory!";
64 } 70 }
65 return user_data_dir; 71 return user_data_dir;
66 } 72 }
67 73
68 } // namespace chrome 74 } // namespace chrome
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