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 <wtsapi32.h> | 9 #include <wtsapi32.h> |
10 #include <vector> | 10 #include <vector> |
(...skipping 458 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
469 VLOG(1) << "User drafted for toast experiment " << flavor; | 469 VLOG(1) << "User drafted for toast experiment " << flavor; |
470 SetClient(base_group + kToastExpBaseGroup, false); | 470 SetClient(base_group + kToastExpBaseGroup, false); |
471 // User level: The experiment needs to be performed in a different process | 471 // User level: The experiment needs to be performed in a different process |
472 // because google_update expects the upgrade process to be quick and nimble. | 472 // because google_update expects the upgrade process to be quick and nimble. |
473 // System level: We have already been relaunched, so we don't need to be | 473 // System level: We have already been relaunched, so we don't need to be |
474 // quick, but we relaunch to follow the exact same codepath. | 474 // quick, but we relaunch to follow the exact same codepath. |
475 CommandLine cmd_line(base_cmd_line); | 475 CommandLine cmd_line(base_cmd_line); |
476 cmd_line.AppendSwitchASCII(switches::kInactiveUserToast, | 476 cmd_line.AppendSwitchASCII(switches::kInactiveUserToast, |
477 base::IntToString(flavor)); | 477 base::IntToString(flavor)); |
478 cmd_line.AppendSwitchASCII(switches::kExperimentGroup, | 478 cmd_line.AppendSwitchASCII(switches::kExperimentGroup, |
479 WideToASCII(base_group)); | 479 base::UTF16ToASCII(base_group)); |
480 LaunchSetup(&cmd_line, system_level); | 480 LaunchSetup(&cmd_line, system_level); |
481 } | 481 } |
482 | 482 |
483 // User qualifies for the experiment. To test, use --try-chrome-again=|flavor| | 483 // User qualifies for the experiment. To test, use --try-chrome-again=|flavor| |
484 // as a parameter to chrome.exe. | 484 // as a parameter to chrome.exe. |
485 void InactiveUserToastExperiment(int flavor, | 485 void InactiveUserToastExperiment(int flavor, |
486 const base::string16& experiment_group, | 486 const base::string16& experiment_group, |
487 const Product& product, | 487 const Product& product, |
488 const base::FilePath& application_path) { | 488 const base::FilePath& application_path) { |
489 // Add the 'welcome back' url for chrome to show. | 489 // Add the 'welcome back' url for chrome to show. |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
529 // running. | 529 // running. |
530 bool system_level_toast = CommandLine::ForCurrentProcess()->HasSwitch( | 530 bool system_level_toast = CommandLine::ForCurrentProcess()->HasSwitch( |
531 switches::kSystemLevelToast); | 531 switches::kSystemLevelToast); |
532 | 532 |
533 CommandLine cmd(InstallUtil::GetChromeUninstallCmd( | 533 CommandLine cmd(InstallUtil::GetChromeUninstallCmd( |
534 system_level_toast, product.distribution()->GetType())); | 534 system_level_toast, product.distribution()->GetType())); |
535 base::LaunchProcess(cmd, base::LaunchOptions(), NULL); | 535 base::LaunchProcess(cmd, base::LaunchOptions(), NULL); |
536 } | 536 } |
537 | 537 |
538 } // namespace installer | 538 } // namespace installer |
OLD | NEW |