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/browser_main.h" | 5 #include "chrome/browser/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 1366 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1377 (parsed_command_line.HasSwitch(switches::kApp) || | 1377 (parsed_command_line.HasSwitch(switches::kApp) || |
1378 parsed_command_line.HasSwitch(switches::kAppId) || | 1378 parsed_command_line.HasSwitch(switches::kAppId) || |
1379 parsed_command_line.HasSwitch(switches::kNoFirstRun))) | 1379 parsed_command_line.HasSwitch(switches::kNoFirstRun))) |
1380 first_run_ui_bypass = true; | 1380 first_run_ui_bypass = true; |
1381 } | 1381 } |
1382 | 1382 |
1383 // TODO(viettrungluu): why don't we run this earlier? | 1383 // TODO(viettrungluu): why don't we run this earlier? |
1384 if (!parsed_command_line.HasSwitch(switches::kNoErrorDialogs)) | 1384 if (!parsed_command_line.HasSwitch(switches::kNoErrorDialogs)) |
1385 WarnAboutMinimumSystemRequirements(); | 1385 WarnAboutMinimumSystemRequirements(); |
1386 | 1386 |
| 1387 // Convert active labs into switches. Modifies the current command line. |
| 1388 about_flags::ConvertFlagsToSwitches(local_state, |
| 1389 CommandLine::ForCurrentProcess()); |
| 1390 |
1387 InitializeNetworkOptions(parsed_command_line); | 1391 InitializeNetworkOptions(parsed_command_line); |
1388 | 1392 |
1389 // Initialize histogram synchronizer system. This is a singleton and is used | 1393 // Initialize histogram synchronizer system. This is a singleton and is used |
1390 // for posting tasks via NewRunnableMethod. Its deleted when it goes out of | 1394 // for posting tasks via NewRunnableMethod. Its deleted when it goes out of |
1391 // scope. Even though NewRunnableMethod does AddRef and Release, the object | 1395 // scope. Even though NewRunnableMethod does AddRef and Release, the object |
1392 // will not be deleted after the Task is executed. | 1396 // will not be deleted after the Task is executed. |
1393 scoped_refptr<HistogramSynchronizer> histogram_synchronizer( | 1397 scoped_refptr<HistogramSynchronizer> histogram_synchronizer( |
1394 new HistogramSynchronizer()); | 1398 new HistogramSynchronizer()); |
1395 | 1399 |
1396 // Initialize thread watcher system. This is a singleton and is used by | 1400 // Initialize thread watcher system. This is a singleton and is used by |
1397 // WatchDogThread to keep track of information about threads that are being | 1401 // WatchDogThread to keep track of information about threads that are being |
1398 // watched. | 1402 // watched. |
1399 scoped_ptr<ThreadWatcherList> thread_watcher_list(new ThreadWatcherList()); | 1403 scoped_ptr<ThreadWatcherList> thread_watcher_list(new ThreadWatcherList()); |
1400 | 1404 |
1401 // Convert active labs into switches. Modifies the current command line. | |
1402 about_flags::ConvertFlagsToSwitches(local_state, | |
1403 CommandLine::ForCurrentProcess()); | |
1404 | |
1405 // Now the command line has been mutated based on about:flags, we can | 1405 // Now the command line has been mutated based on about:flags, we can |
1406 // set up metrics and initialize field trials. | 1406 // set up metrics and initialize field trials. |
1407 MetricsService* metrics = parts->SetupMetricsAndFieldTrials( | 1407 MetricsService* metrics = parts->SetupMetricsAndFieldTrials( |
1408 parsed_command_line, local_state); | 1408 parsed_command_line, local_state); |
1409 | 1409 |
1410 // Now that all preferences have been registered, set the install date | 1410 // Now that all preferences have been registered, set the install date |
1411 // for the uninstall metrics if this is our first run. This only actually | 1411 // for the uninstall metrics if this is our first run. This only actually |
1412 // gets used if the user has metrics reporting enabled at uninstall time. | 1412 // gets used if the user has metrics reporting enabled at uninstall time. |
1413 int64 install_date = | 1413 int64 install_date = |
1414 local_state->GetInt64(prefs::kUninstallMetricsInstallDate); | 1414 local_state->GetInt64(prefs::kUninstallMetricsInstallDate); |
(...skipping 534 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1949 #if defined(OS_CHROMEOS) | 1949 #if defined(OS_CHROMEOS) |
1950 // To be precise, logout (browser shutdown) is not yet done, but the | 1950 // To be precise, logout (browser shutdown) is not yet done, but the |
1951 // remaining work is negligible, hence we say LogoutDone here. | 1951 // remaining work is negligible, hence we say LogoutDone here. |
1952 chromeos::BootTimesLoader::Get()->AddLogoutTimeMarker("LogoutDone", | 1952 chromeos::BootTimesLoader::Get()->AddLogoutTimeMarker("LogoutDone", |
1953 false); | 1953 false); |
1954 chromeos::BootTimesLoader::Get()->WriteLogoutTimes(); | 1954 chromeos::BootTimesLoader::Get()->WriteLogoutTimes(); |
1955 #endif | 1955 #endif |
1956 TRACE_EVENT_END_ETW("BrowserMain", 0, 0); | 1956 TRACE_EVENT_END_ETW("BrowserMain", 0, 0); |
1957 return result_code; | 1957 return result_code; |
1958 } | 1958 } |
OLD | NEW |