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

Unified Diff: chrome/browser/browser_main_win.cc

Issue 3076042: Use Environment::SetVar in more places. (Closed) Base URL: git://git.chromium.org/chromium.git
Patch Set: rebased to ToT Created 10 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/app/client_util.cc ('k') | chrome/browser/first_run/first_run_win.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/browser_main_win.cc
diff --git a/chrome/browser/browser_main_win.cc b/chrome/browser/browser_main_win.cc
index 553b9123db33b4e93c86ae68da3f4d54d90f74ba..32a7bb4e14f9e5e07f6a31a4fd0a32ca691607b8 100644
--- a/chrome/browser/browser_main_win.cc
+++ b/chrome/browser/browser_main_win.cc
@@ -13,9 +13,11 @@
#include "app/l10n_util.h"
#include "app/win_util.h"
#include "base/command_line.h"
+#include "base/environment.h"
#include "base/i18n/rtl.h"
#include "base/nss_util.h"
#include "base/path_service.h"
+#include "base/scoped_ptr.h"
#include "base/utf_string_conversions.h"
#include "base/win_util.h"
#include "chrome/browser/browser_list.h"
@@ -109,13 +111,12 @@ int DoUninstallTasks(bool chrome_still_running) {
// chrome executable's lifetime.
void PrepareRestartOnCrashEnviroment(const CommandLine &parsed_command_line) {
// Clear this var so child processes don't show the dialog by default.
- ::SetEnvironmentVariableW(ASCIIToWide(env_vars::kShowRestart).c_str(), NULL);
+ scoped_ptr<base::Environment> env(base::Environment::Create());
+ env->UnSetVar(env_vars::kShowRestart);
// For non-interactive tests we don't restart on crash.
- if (::GetEnvironmentVariableW(ASCIIToWide(env_vars::kHeadless).c_str(),
- NULL, 0)) {
+ if (env->HasVar(env_vars::kHeadless))
return;
- }
// If the known command-line test options are used we don't create the
// environment block which means we don't get the restart dialog.
@@ -137,8 +138,7 @@ void PrepareRestartOnCrashEnviroment(const CommandLine &parsed_command_line) {
else
dlg_strings.append(ASCIIToWide(env_vars::kLtrLocale));
- ::SetEnvironmentVariableW(ASCIIToWide(env_vars::kRestartInfo).c_str(),
- dlg_strings.c_str());
+ env->SetVar(env_vars::kRestartInfo, WideToUTF8(dlg_strings));
}
// This method handles the --hide-icons and --show-icons command line options
« no previous file with comments | « chrome/app/client_util.cc ('k') | chrome/browser/first_run/first_run_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698