OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 "build/build_config.h" | 5 #include "build/build_config.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/field_trial.h" | 10 #include "base/field_trial.h" |
(...skipping 384 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
395 | 395 |
396 // Importing other browser settings is done in a browser-like process | 396 // Importing other browser settings is done in a browser-like process |
397 // that exits when this task has finished. | 397 // that exits when this task has finished. |
398 if (parsed_command_line.HasSwitch(switches::kImport)) | 398 if (parsed_command_line.HasSwitch(switches::kImport)) |
399 return FirstRun::ImportNow(profile, parsed_command_line); | 399 return FirstRun::ImportNow(profile, parsed_command_line); |
400 | 400 |
401 // When another process is running, use it instead of starting us. | 401 // When another process is running, use it instead of starting us. |
402 if (process_singleton.NotifyOtherProcess()) | 402 if (process_singleton.NotifyOtherProcess()) |
403 return ResultCodes::NORMAL_EXIT; | 403 return ResultCodes::NORMAL_EXIT; |
404 | 404 |
405 process_singleton.HuntForZombieChromeProcesses(); | |
406 | |
407 // Do the tasks if chrome has been upgraded while it was last running. | 405 // Do the tasks if chrome has been upgraded while it was last running. |
408 if (!already_running && DoUpgradeTasks(parsed_command_line)) { | 406 if (!already_running && DoUpgradeTasks(parsed_command_line)) { |
409 return ResultCodes::NORMAL_EXIT; | 407 return ResultCodes::NORMAL_EXIT; |
410 } | 408 } |
411 | 409 |
412 // Check if there is any machine level Chrome installed on the current | 410 // Check if there is any machine level Chrome installed on the current |
413 // machine. If yes and the current Chrome process is user level, we do not | 411 // machine. If yes and the current Chrome process is user level, we do not |
414 // allow the user level Chrome to run. So we notify the user and uninstall | 412 // allow the user level Chrome to run. So we notify the user and uninstall |
415 // user level Chrome. | 413 // user level Chrome. |
416 // Note this check should only happen here, after all the checks above | 414 // Note this check should only happen here, after all the checks above |
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
571 if (metrics) | 569 if (metrics) |
572 metrics->Stop(); | 570 metrics->Stop(); |
573 | 571 |
574 // browser_shutdown takes care of deleting browser_process, so we need to | 572 // browser_shutdown takes care of deleting browser_process, so we need to |
575 // release it. | 573 // release it. |
576 browser_process.release(); | 574 browser_process.release(); |
577 browser_shutdown::Shutdown(); | 575 browser_shutdown::Shutdown(); |
578 | 576 |
579 return result_code; | 577 return result_code; |
580 } | 578 } |
OLD | NEW |