OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #include <algorithm> | 7 #include <algorithm> |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 1200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1211 // We use different BrowserProcess when importing so no GoogleURLTracker is | 1211 // We use different BrowserProcess when importing so no GoogleURLTracker is |
1212 // instantiated (as it makes a net::URLRequest and we don't have an IO | 1212 // instantiated (as it makes a net::URLRequest and we don't have an IO |
1213 // thread, see bug #1292702). | 1213 // thread, see bug #1292702). |
1214 browser_process_.reset(new FirstRunBrowserProcess(parsed_command_line())); | 1214 browser_process_.reset(new FirstRunBrowserProcess(parsed_command_line())); |
1215 is_first_run = false; | 1215 is_first_run = false; |
1216 } else { | 1216 } else { |
1217 browser_process_.reset(new BrowserProcessImpl(parsed_command_line())); | 1217 browser_process_.reset(new BrowserProcessImpl(parsed_command_line())); |
1218 } | 1218 } |
1219 | 1219 |
1220 if (parsed_command_line().HasSwitch(switches::kEnableTracking)) { | 1220 if (parsed_command_line().HasSwitch(switches::kEnableTracking)) { |
| 1221 // User wants to override default tracking status. |
1221 std::string flag = | 1222 std::string flag = |
1222 parsed_command_line().GetSwitchValueASCII(switches::kEnableTracking); | 1223 parsed_command_line().GetSwitchValueASCII(switches::kEnableTracking); |
1223 if (flag.compare("0") == 0) | 1224 bool enabled = flag.compare("0") != 0; |
1224 tracked_objects::ThreadData::InitializeAndSetTrackingStatus(false); | 1225 tracked_objects::ThreadData::InitializeAndSetTrackingStatus(enabled); |
1225 } | 1226 } |
1226 | 1227 |
1227 // This forces the TabCloseableStateWatcher to be created and, on chromeos, | 1228 // This forces the TabCloseableStateWatcher to be created and, on chromeos, |
1228 // register for the notifications it needs to track the closeable state of | 1229 // register for the notifications it needs to track the closeable state of |
1229 // tabs. | 1230 // tabs. |
1230 g_browser_process->tab_closeable_state_watcher(); | 1231 g_browser_process->tab_closeable_state_watcher(); |
1231 | 1232 |
1232 PrefService* local_state = InitializeLocalState(parsed_command_line(), | 1233 PrefService* local_state = InitializeLocalState(parsed_command_line(), |
1233 is_first_run); | 1234 is_first_run); |
1234 | 1235 |
(...skipping 891 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2126 if (env->GetVar(chrome::kPreReadEnvironmentVariable, &pre_read) && | 2127 if (env->GetVar(chrome::kPreReadEnvironmentVariable, &pre_read) && |
2127 (pre_read == "0" || pre_read == "1")) { | 2128 (pre_read == "0" || pre_read == "1")) { |
2128 std::string uma_name(name); | 2129 std::string uma_name(name); |
2129 uma_name += "_PreRead"; | 2130 uma_name += "_PreRead"; |
2130 uma_name += pre_read == "1" ? "Enabled" : "Disabled"; | 2131 uma_name += pre_read == "1" ? "Enabled" : "Disabled"; |
2131 AddPreReadHistogramTime(uma_name.c_str(), time); | 2132 AddPreReadHistogramTime(uma_name.c_str(), time); |
2132 } | 2133 } |
2133 #endif | 2134 #endif |
2134 #endif | 2135 #endif |
2135 } | 2136 } |
OLD | NEW |