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 931 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
942 // (first run) UI is undesired. | 942 // (first run) UI is undesired. |
943 do_first_run_tasks_ = ( | 943 do_first_run_tasks_ = ( |
944 !force_skip_first_run_tasks && | 944 !force_skip_first_run_tasks && |
945 pmp_result != first_run::SKIP_FIRST_RUN_TASKS && | 945 pmp_result != first_run::SKIP_FIRST_RUN_TASKS && |
946 !parsed_command_line().HasSwitch(switches::kApp) && | 946 !parsed_command_line().HasSwitch(switches::kApp) && |
947 !parsed_command_line().HasSwitch(switches::kAppId) && | 947 !parsed_command_line().HasSwitch(switches::kAppId) && |
948 !parsed_command_line().HasSwitch(switches::kShowAppList)); | 948 !parsed_command_line().HasSwitch(switches::kShowAppList)); |
949 | 949 |
950 if (do_first_run_tasks_) { | 950 if (do_first_run_tasks_) { |
951 AddFirstRunNewTabs(browser_creator_.get(), master_prefs_->new_tabs); | 951 AddFirstRunNewTabs(browser_creator_.get(), master_prefs_->new_tabs); |
| 952 |
| 953 // Store the initial VariationsService seed in local state, if it exists |
| 954 // in master prefs. |
| 955 if (!master_prefs_->variations_seed.empty()) { |
| 956 local_state_->SetString(prefs::kVariationsSeed, |
| 957 master_prefs_->variations_seed); |
| 958 // Set the variation seed date to the current system time. If the user's |
| 959 // clock is incorrect, this may cause some field trial expiry checks to |
| 960 // not do the right thing until the next seed update from the server, |
| 961 // when this value will be updated. |
| 962 local_state_->SetInt64(prefs::kVariationsSeedDate, |
| 963 base::Time::Now().ToInternalValue()); |
| 964 } |
952 } else if (parsed_command_line().HasSwitch(switches::kNoFirstRun)) { | 965 } else if (parsed_command_line().HasSwitch(switches::kNoFirstRun)) { |
953 // Create the First Run beacon anyways if --no-first-run was passed on the | 966 // Create the First Run beacon anyways if --no-first-run was passed on the |
954 // command line. | 967 // command line. |
955 first_run::CreateSentinel(); | 968 first_run::CreateSentinel(); |
956 } | 969 } |
957 } | 970 } |
958 #endif | 971 #endif |
959 | 972 |
960 // TODO(viettrungluu): why don't we run this earlier? | 973 // TODO(viettrungluu): why don't we run this earlier? |
961 if (!parsed_command_line().HasSwitch(switches::kNoErrorDialogs)) | 974 if (!parsed_command_line().HasSwitch(switches::kNoErrorDialogs)) |
(...skipping 823 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1785 if (base::win::GetVersion() <= base::win::VERSION_XP) | 1798 if (base::win::GetVersion() <= base::win::VERSION_XP) |
1786 uma_name += "_XP"; | 1799 uma_name += "_XP"; |
1787 | 1800 |
1788 uma_name += "_PreRead_"; | 1801 uma_name += "_PreRead_"; |
1789 uma_name += pre_read_percentage; | 1802 uma_name += pre_read_percentage; |
1790 AddPreReadHistogramTime(uma_name.c_str(), time); | 1803 AddPreReadHistogramTime(uma_name.c_str(), time); |
1791 } | 1804 } |
1792 #endif | 1805 #endif |
1793 #endif | 1806 #endif |
1794 } | 1807 } |
OLD | NEW |