| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 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/installer/util/user_experiment.h" | 5 #include "chrome/installer/util/user_experiment.h" |
| 6 | 6 |
| 7 #include <windows.h> | 7 #include <windows.h> |
| 8 #include <sddl.h> | 8 #include <sddl.h> |
| 9 #include <stddef.h> |
| 10 #include <stdint.h> |
| 9 #include <wtsapi32.h> | 11 #include <wtsapi32.h> |
| 10 #include <vector> | 12 #include <vector> |
| 11 | 13 |
| 12 #include "base/command_line.h" | 14 #include "base/command_line.h" |
| 13 #include "base/files/file_path.h" | 15 #include "base/files/file_path.h" |
| 16 #include "base/macros.h" |
| 14 #include "base/path_service.h" | 17 #include "base/path_service.h" |
| 15 #include "base/process/launch.h" | 18 #include "base/process/launch.h" |
| 16 #include "base/rand_util.h" | 19 #include "base/rand_util.h" |
| 17 #include "base/strings/string_number_conversions.h" | 20 #include "base/strings/string_number_conversions.h" |
| 18 #include "base/strings/string_split.h" | 21 #include "base/strings/string_split.h" |
| 19 #include "base/strings/string_util.h" | 22 #include "base/strings/string_util.h" |
| 20 #include "base/strings/utf_string_conversions.h" | 23 #include "base/strings/utf_string_conversions.h" |
| 21 #include "base/win/scoped_handle.h" | 24 #include "base/win/scoped_handle.h" |
| 22 #include "base/win/windows_version.h" | 25 #include "base/win/windows_version.h" |
| 23 #include "chrome/common/chrome_paths.h" | 26 #include "chrome/common/chrome_paths.h" |
| (...skipping 468 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 492 // Prepend the url with a space. | 495 // Prepend the url with a space. |
| 493 base::string16 url(GetWelcomeBackUrl()); | 496 base::string16 url(GetWelcomeBackUrl()); |
| 494 options.AppendArg("--"); | 497 options.AppendArg("--"); |
| 495 options.AppendArgNative(url); | 498 options.AppendArgNative(url); |
| 496 // The command line should now have the url added as: | 499 // The command line should now have the url added as: |
| 497 // "chrome.exe -- <url>" | 500 // "chrome.exe -- <url>" |
| 498 DCHECK_NE(base::string16::npos, | 501 DCHECK_NE(base::string16::npos, |
| 499 options.GetCommandLineString().find(L" -- " + url)); | 502 options.GetCommandLineString().find(L" -- " + url)); |
| 500 | 503 |
| 501 // Launch chrome now. It will show the toast UI. | 504 // Launch chrome now. It will show the toast UI. |
| 502 int32 exit_code = 0; | 505 int32_t exit_code = 0; |
| 503 if (!product.LaunchChromeAndWait(application_path, options, &exit_code)) | 506 if (!product.LaunchChromeAndWait(application_path, options, &exit_code)) |
| 504 return; | 507 return; |
| 505 | 508 |
| 506 // The chrome process has exited, figure out what happened. | 509 // The chrome process has exited, figure out what happened. |
| 507 const wchar_t* outcome = NULL; | 510 const wchar_t* outcome = NULL; |
| 508 switch (exit_code) { | 511 switch (exit_code) { |
| 509 case content::RESULT_CODE_NORMAL_EXIT: | 512 case content::RESULT_CODE_NORMAL_EXIT: |
| 510 outcome = kToastExpTriesOkGroup; | 513 outcome = kToastExpTriesOkGroup; |
| 511 break; | 514 break; |
| 512 case chrome::RESULT_CODE_NORMAL_EXIT_CANCEL: | 515 case chrome::RESULT_CODE_NORMAL_EXIT_CANCEL: |
| (...skipping 15 matching lines...) Expand all Loading... |
| 528 // running. | 531 // running. |
| 529 bool system_level_toast = base::CommandLine::ForCurrentProcess()->HasSwitch( | 532 bool system_level_toast = base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 530 switches::kSystemLevelToast); | 533 switches::kSystemLevelToast); |
| 531 | 534 |
| 532 base::CommandLine cmd(InstallUtil::GetChromeUninstallCmd( | 535 base::CommandLine cmd(InstallUtil::GetChromeUninstallCmd( |
| 533 system_level_toast, product.distribution()->GetType())); | 536 system_level_toast, product.distribution()->GetType())); |
| 534 base::LaunchProcess(cmd, base::LaunchOptions()); | 537 base::LaunchProcess(cmd, base::LaunchOptions()); |
| 535 } | 538 } |
| 536 | 539 |
| 537 } // namespace installer | 540 } // namespace installer |
| OLD | NEW |