| 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 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 1274 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1285 // specifies --uninstall-extension, attempt the uninstall extension startup | 1285 // specifies --uninstall-extension, attempt the uninstall extension startup |
| 1286 // action. | 1286 // action. |
| 1287 if (parsed_command_line().HasSwitch(switches::kUninstallExtension)) { | 1287 if (parsed_command_line().HasSwitch(switches::kUninstallExtension)) { |
| 1288 extensions::StartupHelper extension_startup_helper; | 1288 extensions::StartupHelper extension_startup_helper; |
| 1289 if (extension_startup_helper.UninstallExtension( | 1289 if (extension_startup_helper.UninstallExtension( |
| 1290 parsed_command_line(), profile_)) | 1290 parsed_command_line(), profile_)) |
| 1291 return content::RESULT_CODE_NORMAL_EXIT; | 1291 return content::RESULT_CODE_NORMAL_EXIT; |
| 1292 return chrome::RESULT_CODE_UNINSTALL_EXTENSION_ERROR; | 1292 return chrome::RESULT_CODE_UNINSTALL_EXTENSION_ERROR; |
| 1293 } | 1293 } |
| 1294 | 1294 |
| 1295 if (parsed_command_line().HasSwitch(switches::kInstallFromWebstore)) { |
| 1296 extensions::StartupHelper helper; |
| 1297 if (helper.InstallFromWebstore(parsed_command_line(), profile_)) |
| 1298 return content::RESULT_CODE_NORMAL_EXIT; |
| 1299 return chrome::RESULT_CODE_INSTALL_FROM_WEBSTORE_ERROR; |
| 1300 } |
| 1301 |
| 1302 |
| 1295 // Start watching for hangs during startup. We disarm this hang detector when | 1303 // Start watching for hangs during startup. We disarm this hang detector when |
| 1296 // ThreadWatcher takes over or when browser is shutdown or when | 1304 // ThreadWatcher takes over or when browser is shutdown or when |
| 1297 // startup_watcher_ is deleted. | 1305 // startup_watcher_ is deleted. |
| 1298 startup_watcher_->Arm(base::TimeDelta::FromSeconds(300)); | 1306 startup_watcher_->Arm(base::TimeDelta::FromSeconds(300)); |
| 1299 | 1307 |
| 1300 // Start watching for a hang. | 1308 // Start watching for a hang. |
| 1301 MetricsService::LogNeedForCleanShutdown(); | 1309 MetricsService::LogNeedForCleanShutdown(); |
| 1302 | 1310 |
| 1303 #if defined(OS_WIN) | 1311 #if defined(OS_WIN) |
| 1304 // We check this here because if the profile is OTR (chromeos possibility) | 1312 // We check this here because if the profile is OTR (chromeos possibility) |
| (...skipping 290 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1595 if (base::win::GetVersion() <= base::win::VERSION_XP) | 1603 if (base::win::GetVersion() <= base::win::VERSION_XP) |
| 1596 uma_name += "_XP"; | 1604 uma_name += "_XP"; |
| 1597 | 1605 |
| 1598 uma_name += "_PreRead_"; | 1606 uma_name += "_PreRead_"; |
| 1599 uma_name += pre_read_percentage; | 1607 uma_name += pre_read_percentage; |
| 1600 AddPreReadHistogramTime(uma_name.c_str(), time); | 1608 AddPreReadHistogramTime(uma_name.c_str(), time); |
| 1601 } | 1609 } |
| 1602 #endif | 1610 #endif |
| 1603 #endif | 1611 #endif |
| 1604 } | 1612 } |
| OLD | NEW |