OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/chrome_browser_main.h" | 5 #include "chrome/browser/chrome_browser_main.h" |
6 | 6 |
7 #if defined(TOOLKIT_GTK) | 7 #if defined(TOOLKIT_GTK) |
8 #include <gtk/gtk.h> | 8 #include <gtk/gtk.h> |
9 #endif | 9 #endif |
10 | 10 |
(...skipping 1029 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1040 #endif | 1040 #endif |
1041 | 1041 |
1042 // Desktop construction occurs here, (required before profile creation). | 1042 // Desktop construction occurs here, (required before profile creation). |
1043 PreProfileInit(); | 1043 PreProfileInit(); |
1044 | 1044 |
1045 std::string try_chrome = | 1045 std::string try_chrome = |
1046 parsed_command_line().GetSwitchValueASCII(switches::kTryChromeAgain); | 1046 parsed_command_line().GetSwitchValueASCII(switches::kTryChromeAgain); |
1047 if (!try_chrome.empty()) { | 1047 if (!try_chrome.empty()) { |
1048 #if defined(OS_WIN) | 1048 #if defined(OS_WIN) |
1049 // Setup.exe has determined that we need to run a retention experiment | 1049 // Setup.exe has determined that we need to run a retention experiment |
1050 // and has lauched chrome to show the experiment UI. | 1050 // and has lauched chrome to show the experiment UI. It is guaranteed that |
1051 if (process_singleton_->FoundOtherProcessWindow()) { | 1051 // no other Chrome is currently running as the process singleton was |
1052 // It seems that we don't need to run the experiment since chrome | 1052 // sucessfully grabbed above. |
1053 // in the same profile is already running. | |
1054 VLOG(1) << "Retention experiment not required"; | |
1055 return TryChromeDialogView::NOT_NOW; | |
1056 } | |
1057 int try_chrome_int; | 1053 int try_chrome_int; |
1058 base::StringToInt(try_chrome, &try_chrome_int); | 1054 base::StringToInt(try_chrome, &try_chrome_int); |
1059 TryChromeDialogView::Result answer = | 1055 TryChromeDialogView::Result answer = |
1060 TryChromeDialogView::Show(try_chrome_int, process_singleton_.get()); | 1056 TryChromeDialogView::Show(try_chrome_int, process_singleton_.get()); |
1061 if (answer == TryChromeDialogView::NOT_NOW) | 1057 if (answer == TryChromeDialogView::NOT_NOW) |
1062 return chrome::RESULT_CODE_NORMAL_EXIT_CANCEL; | 1058 return chrome::RESULT_CODE_NORMAL_EXIT_CANCEL; |
1063 if (answer == TryChromeDialogView::UNINSTALL_CHROME) | 1059 if (answer == TryChromeDialogView::UNINSTALL_CHROME) |
1064 return chrome::RESULT_CODE_NORMAL_EXIT_EXP2; | 1060 return chrome::RESULT_CODE_NORMAL_EXIT_EXP2; |
1065 // At this point the user is willing to try chrome again. | 1061 // At this point the user is willing to try chrome again. |
1066 if (answer == TryChromeDialogView::TRY_CHROME_AS_DEFAULT) { | 1062 if (answer == TryChromeDialogView::TRY_CHROME_AS_DEFAULT) { |
(...skipping 583 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1650 if (base::win::GetVersion() <= base::win::VERSION_XP) | 1646 if (base::win::GetVersion() <= base::win::VERSION_XP) |
1651 uma_name += "_XP"; | 1647 uma_name += "_XP"; |
1652 | 1648 |
1653 uma_name += "_PreRead_"; | 1649 uma_name += "_PreRead_"; |
1654 uma_name += pre_read_percentage; | 1650 uma_name += pre_read_percentage; |
1655 AddPreReadHistogramTime(uma_name.c_str(), time); | 1651 AddPreReadHistogramTime(uma_name.c_str(), time); |
1656 } | 1652 } |
1657 #endif | 1653 #endif |
1658 #endif | 1654 #endif |
1659 } | 1655 } |
OLD | NEW |