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

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

Issue 329017: Remove deprecated CommandLine(std::wstring) ctor. (Closed)
Patch Set: Created 11 years, 1 month 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
OLDNEW
1 // Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-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/first_run.h" 5 #include "chrome/browser/first_run.h"
6 6
7 #include <windows.h> 7 #include <windows.h>
8 #include <shellapi.h> 8 #include <shellapi.h>
9 #include <shlobj.h> 9 #include <shlobj.h>
10 10
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
111 } 111 }
112 112
113 bool LaunchSetupWithParam(const std::string& param, const std::wstring& value, 113 bool LaunchSetupWithParam(const std::string& param, const std::wstring& value,
114 int* ret_code) { 114 int* ret_code) {
115 FilePath exe_path; 115 FilePath exe_path;
116 if (!PathService::Get(base::DIR_MODULE, &exe_path)) 116 if (!PathService::Get(base::DIR_MODULE, &exe_path))
117 return false; 117 return false;
118 exe_path = exe_path.Append(installer_util::kInstallerDir); 118 exe_path = exe_path.Append(installer_util::kInstallerDir);
119 exe_path = exe_path.Append(installer_util::kSetupExe); 119 exe_path = exe_path.Append(installer_util::kSetupExe);
120 base::ProcessHandle ph; 120 base::ProcessHandle ph;
121 CommandLine cl(exe_path.ToWStringHack()); 121 CommandLine cl(exe_path);
122 cl.AppendSwitchWithValue(param, value); 122 cl.AppendSwitchWithValue(param, value);
123 if (!base::LaunchApp(cl, false, false, &ph)) 123 if (!base::LaunchApp(cl, false, false, &ph))
124 return false; 124 return false;
125 DWORD wr = ::WaitForSingleObject(ph, INFINITE); 125 DWORD wr = ::WaitForSingleObject(ph, INFINITE);
126 if (wr != WAIT_OBJECT_0) 126 if (wr != WAIT_OBJECT_0)
127 return false; 127 return false;
128 return (TRUE == ::GetExitCodeProcess(ph, reinterpret_cast<DWORD*>(ret_code))); 128 return (TRUE == ::GetExitCodeProcess(ph, reinterpret_cast<DWORD*>(ret_code)));
129 } 129 }
130 130
131 bool WriteEULAtoTempFile(FilePath* eula_path) { 131 bool WriteEULAtoTempFile(FilePath* eula_path) {
(...skipping 424 matching lines...) Expand 10 before | Expand all | Expand 10 after
556 556
557 *window = reinterpret_cast<HWND>(StringToInt64(v[2])); 557 *window = reinterpret_cast<HWND>(StringToInt64(v[2]));
558 return true; 558 return true;
559 } 559 }
560 560
561 } // namespace 561 } // namespace
562 562
563 bool FirstRun::ImportSettings(Profile* profile, int browser_type, 563 bool FirstRun::ImportSettings(Profile* profile, int browser_type,
564 int items_to_import, HWND parent_window) { 564 int items_to_import, HWND parent_window) {
565 const CommandLine& cmdline = *CommandLine::ForCurrentProcess(); 565 const CommandLine& cmdline = *CommandLine::ForCurrentProcess();
566 CommandLine import_cmd(cmdline.program()); 566 CommandLine import_cmd(cmdline.GetProgram());
567 // Propagate user data directory switch. 567 // Propagate user data directory switch.
568 if (cmdline.HasSwitch(switches::kUserDataDir)) { 568 if (cmdline.HasSwitch(switches::kUserDataDir)) {
569 import_cmd.AppendSwitchWithValue( 569 import_cmd.AppendSwitchWithValue(
570 switches::kUserDataDir, 570 switches::kUserDataDir,
571 cmdline.GetSwitchValue(switches::kUserDataDir)); 571 cmdline.GetSwitchValue(switches::kUserDataDir));
572 } 572 }
573 573
574 // Since ImportSettings is called before the local state is stored on disk 574 // Since ImportSettings is called before the local state is stored on disk
575 // we pass the language as an argument. GetApplicationLocale checks the 575 // we pass the language as an argument. GetApplicationLocale checks the
576 // current command line as fallback. 576 // current command line as fallback.
(...skipping 372 matching lines...) Expand 10 before | Expand all | Expand 10 after
949 949
950 DISALLOW_COPY_AND_ASSIGN(TryChromeDialog); 950 DISALLOW_COPY_AND_ASSIGN(TryChromeDialog);
951 }; 951 };
952 952
953 } // namespace 953 } // namespace
954 954
955 Upgrade::TryResult Upgrade::ShowTryChromeDialog(size_t version) { 955 Upgrade::TryResult Upgrade::ShowTryChromeDialog(size_t version) {
956 TryChromeDialog td(version); 956 TryChromeDialog td(version);
957 return td.ShowModal(); 957 return td.ShowModal();
958 } 958 }
OLDNEW
« no previous file with comments | « chrome/browser/extensions/extensions_service_unittest.cc ('k') | chrome/browser/images_uitest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698