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/hi_res_timer_manager.h" | 9 #include "app/hi_res_timer_manager.h" |
10 #include "app/l10n_util.h" | 10 #include "app/l10n_util.h" |
(...skipping 26 matching lines...) Expand all Loading... |
37 #include "chrome/browser/first_run.h" | 37 #include "chrome/browser/first_run.h" |
38 #include "chrome/browser/jankometer.h" | 38 #include "chrome/browser/jankometer.h" |
39 #include "chrome/browser/metrics/metrics_service.h" | 39 #include "chrome/browser/metrics/metrics_service.h" |
40 #include "chrome/browser/net/dns_global.h" | 40 #include "chrome/browser/net/dns_global.h" |
41 #include "chrome/browser/net/metadata_url_request.h" | 41 #include "chrome/browser/net/metadata_url_request.h" |
42 #include "chrome/browser/net/sdch_dictionary_fetcher.h" | 42 #include "chrome/browser/net/sdch_dictionary_fetcher.h" |
43 #include "chrome/browser/net/websocket_experiment/websocket_experiment_runner.h" | 43 #include "chrome/browser/net/websocket_experiment/websocket_experiment_runner.h" |
44 #include "chrome/browser/plugin_service.h" | 44 #include "chrome/browser/plugin_service.h" |
45 #include "chrome/browser/process_singleton.h" | 45 #include "chrome/browser/process_singleton.h" |
46 #include "chrome/browser/profile_manager.h" | 46 #include "chrome/browser/profile_manager.h" |
| 47 #include "chrome/browser/profile.h" |
47 #include "chrome/browser/renderer_host/resource_dispatcher_host.h" | 48 #include "chrome/browser/renderer_host/resource_dispatcher_host.h" |
48 #include "chrome/browser/shell_integration.h" | 49 #include "chrome/browser/shell_integration.h" |
49 #include "chrome/browser/user_data_manager.h" | 50 #include "chrome/browser/user_data_manager.h" |
50 #include "chrome/common/chrome_constants.h" | 51 #include "chrome/common/chrome_constants.h" |
51 #include "chrome/common/chrome_paths.h" | 52 #include "chrome/common/chrome_paths.h" |
52 #include "chrome/common/chrome_switches.h" | 53 #include "chrome/common/chrome_switches.h" |
53 #include "chrome/common/histogram_synchronizer.h" | 54 #include "chrome/common/histogram_synchronizer.h" |
54 #include "chrome/common/jstemplate_builder.h" | 55 #include "chrome/common/jstemplate_builder.h" |
55 #include "chrome/common/main_function_params.h" | 56 #include "chrome/common/main_function_params.h" |
56 #include "chrome/common/net/net_resource_provider.h" | 57 #include "chrome/common/net/net_resource_provider.h" |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
93 #include <commctrl.h> | 94 #include <commctrl.h> |
94 #include <shellapi.h> | 95 #include <shellapi.h> |
95 | 96 |
96 #include "app/win_util.h" | 97 #include "app/win_util.h" |
97 #include "base/registry.h" | 98 #include "base/registry.h" |
98 #include "base/win_util.h" | 99 #include "base/win_util.h" |
99 #include "chrome/browser/browser.h" | 100 #include "chrome/browser/browser.h" |
100 #include "chrome/browser/browser_trial.h" | 101 #include "chrome/browser/browser_trial.h" |
101 #include "chrome/browser/metrics/user_metrics.h" | 102 #include "chrome/browser/metrics/user_metrics.h" |
102 #include "chrome/browser/net/url_fixer_upper.h" | 103 #include "chrome/browser/net/url_fixer_upper.h" |
103 #include "chrome/browser/profile.h" | |
104 #include "chrome/browser/rlz/rlz.h" | 104 #include "chrome/browser/rlz/rlz.h" |
105 #include "chrome/browser/views/user_data_dir_dialog.h" | 105 #include "chrome/browser/views/user_data_dir_dialog.h" |
106 #include "chrome/common/env_vars.h" | 106 #include "chrome/common/env_vars.h" |
107 #include "chrome/installer/util/helper.h" | 107 #include "chrome/installer/util/helper.h" |
108 #include "chrome/installer/util/install_util.h" | 108 #include "chrome/installer/util/install_util.h" |
109 #include "chrome/installer/util/shell_util.h" | 109 #include "chrome/installer/util/shell_util.h" |
110 #include "chrome/installer/util/version.h" | 110 #include "chrome/installer/util/version.h" |
111 #include "net/base/net_util.h" | 111 #include "net/base/net_util.h" |
112 #include "net/base/sdch_manager.h" | 112 #include "net/base/sdch_manager.h" |
113 #include "net/base/winsock_init.h" | 113 #include "net/base/winsock_init.h" |
(...skipping 561 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
675 | 675 |
676 return ResultCodes::NORMAL_EXIT; | 676 return ResultCodes::NORMAL_EXIT; |
677 } | 677 } |
678 #else | 678 #else |
679 // TODO(port): fix this. See comments near the definition of | 679 // TODO(port): fix this. See comments near the definition of |
680 // user_data_dir. It is better to CHECK-fail here than it is to | 680 // user_data_dir. It is better to CHECK-fail here than it is to |
681 // silently exit because of missing code in the above test. | 681 // silently exit because of missing code in the above test. |
682 CHECK(profile) << "Cannot get default profile."; | 682 CHECK(profile) << "Cannot get default profile."; |
683 #endif | 683 #endif |
684 | 684 |
| 685 // Now that we have a profile, try to load the visited link master on a |
| 686 // background thread. We want to start this as soon as we can. |
| 687 profile->PreloadVisitedLinkMaster(); |
| 688 |
685 PrefService* user_prefs = profile->GetPrefs(); | 689 PrefService* user_prefs = profile->GetPrefs(); |
686 DCHECK(user_prefs); | 690 DCHECK(user_prefs); |
687 | 691 |
688 // Importing other browser settings is done in a browser-like process | 692 // Importing other browser settings is done in a browser-like process |
689 // that exits when this task has finished. | 693 // that exits when this task has finished. |
690 #if defined(OS_WIN) | 694 #if defined(OS_WIN) |
691 if (parsed_command_line.HasSwitch(switches::kImport)) | 695 if (parsed_command_line.HasSwitch(switches::kImport)) |
692 return FirstRun::ImportNow(profile, parsed_command_line); | 696 return FirstRun::ImportNow(profile, parsed_command_line); |
693 #endif | 697 #endif |
694 | 698 |
(...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
919 if (metrics) | 923 if (metrics) |
920 metrics->Stop(); | 924 metrics->Stop(); |
921 | 925 |
922 // browser_shutdown takes care of deleting browser_process, so we need to | 926 // browser_shutdown takes care of deleting browser_process, so we need to |
923 // release it. | 927 // release it. |
924 browser_process.release(); | 928 browser_process.release(); |
925 browser_shutdown::Shutdown(); | 929 browser_shutdown::Shutdown(); |
926 | 930 |
927 return result_code; | 931 return result_code; |
928 } | 932 } |
OLD | NEW |