| OLD | NEW |
| 1 // Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2009 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 | 8 |
| 9 #include "app/l10n_util.h" | 9 #include "app/l10n_util.h" |
| 10 #include "app/resource_bundle.h" | 10 #include "app/resource_bundle.h" |
| (...skipping 531 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 542 | 542 |
| 543 // Try to create/load the profile. | 543 // Try to create/load the profile. |
| 544 ProfileManager* profile_manager = browser_process->profile_manager(); | 544 ProfileManager* profile_manager = browser_process->profile_manager(); |
| 545 Profile* profile = profile_manager->GetDefaultProfile(user_data_dir); | 545 Profile* profile = profile_manager->GetDefaultProfile(user_data_dir); |
| 546 #if defined(OS_WIN) | 546 #if defined(OS_WIN) |
| 547 if (!profile) { | 547 if (!profile) { |
| 548 // Ideally, we should be able to run w/o access to disk. For now, we | 548 // Ideally, we should be able to run w/o access to disk. For now, we |
| 549 // prompt the user to pick a different user-data-dir and restart chrome | 549 // prompt the user to pick a different user-data-dir and restart chrome |
| 550 // with the new dir. | 550 // with the new dir. |
| 551 // http://code.google.com/p/chromium/issues/detail?id=11510 | 551 // http://code.google.com/p/chromium/issues/detail?id=11510 |
| 552 user_data_dir = FilePath::FromWStringHack( | 552 user_data_dir = UserDataDirDialog::RunUserDataDirDialog(user_data_dir); |
| 553 UserDataDirDialog::RunUserDataDirDialog(user_data_dir.ToWStringHack())); | |
| 554 if (!parameters.ui_task && browser_shutdown::delete_resources_on_shutdown) { | 553 if (!parameters.ui_task && browser_shutdown::delete_resources_on_shutdown) { |
| 555 // Only delete the resources if we're not running tests. If we're running | 554 // Only delete the resources if we're not running tests. If we're running |
| 556 // tests the resources need to be reused as many places in the UI cache | 555 // tests the resources need to be reused as many places in the UI cache |
| 557 // SkBitmaps from the ResourceBundle. | 556 // SkBitmaps from the ResourceBundle. |
| 558 ResourceBundle::CleanupSharedInstance(); | 557 ResourceBundle::CleanupSharedInstance(); |
| 559 } | 558 } |
| 560 | 559 |
| 561 if (!user_data_dir.empty()) { | 560 if (!user_data_dir.empty()) { |
| 562 // Because of the way CommandLine parses, it's sufficient to append a new | 561 // Because of the way CommandLine parses, it's sufficient to append a new |
| 563 // --user-data-dir switch. The last flag of the same name wins. | 562 // --user-data-dir switch. The last flag of the same name wins. |
| (...skipping 325 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 889 if (metrics) | 888 if (metrics) |
| 890 metrics->Stop(); | 889 metrics->Stop(); |
| 891 | 890 |
| 892 // browser_shutdown takes care of deleting browser_process, so we need to | 891 // browser_shutdown takes care of deleting browser_process, so we need to |
| 893 // release it. | 892 // release it. |
| 894 browser_process.release(); | 893 browser_process.release(); |
| 895 browser_shutdown::Shutdown(); | 894 browser_shutdown::Shutdown(); |
| 896 | 895 |
| 897 return result_code; | 896 return result_code; |
| 898 } | 897 } |
| OLD | NEW |