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

Unified Diff: chrome/browser/first_run/upgrade_utils.cc

Issue 6840003: first-run: Refactor Upgrade class into a common upgrade_util API. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/first_run/upgrade_utils.cc
diff --git a/chrome/browser/first_run/upgrade_utils.cc b/chrome/browser/first_run/upgrade_utils.cc
new file mode 100644
index 0000000000000000000000000000000000000000..d74a2beb2e611b56c6a6e62b1eeedecf3f6ec99d
--- /dev/null
+++ b/chrome/browser/first_run/upgrade_utils.cc
@@ -0,0 +1,34 @@
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "chrome/browser/first_run/upgrade_utils.h"
+
+#include "base/command_line.h"
+#include "base/logging.h"
+
+namespace {
+
+CommandLine* command_line;
+
+} // namespace
+
+namespace upgrade_utils {
+
+void SetNewCommandLine(CommandLine* new_command_line) {
+ command_line = new_command_line;
+}
+
+void RelaunchChromeBrowserWithNewCommandLineIfNeeded() {
+ if (command_line) {
+ if (!RelaunchChromeBrowser(*command_line)) {
+ DLOG(ERROR) << "Launching a new instance of the browser failed.";
+ } else {
+ DLOG(WARNING) << "Launched a new instance of the browser.";
+ }
+ delete command_line;
+ command_line = NULL;
+ }
+}
+
+} // namespace upgrade_utils

Powered by Google App Engine
This is Rietveld 408576698