OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 27 matching lines...) Expand all Loading... |
38 #include "chrome/browser/jankometer.h" | 38 #include "chrome/browser/jankometer.h" |
39 #include "chrome/browser/metrics/histogram_synchronizer.h" | 39 #include "chrome/browser/metrics/histogram_synchronizer.h" |
40 #include "chrome/browser/metrics/metrics_service.h" | 40 #include "chrome/browser/metrics/metrics_service.h" |
41 #include "chrome/browser/net/dns_global.h" | 41 #include "chrome/browser/net/dns_global.h" |
42 #include "chrome/browser/net/metadata_url_request.h" | 42 #include "chrome/browser/net/metadata_url_request.h" |
43 #include "chrome/browser/net/sdch_dictionary_fetcher.h" | 43 #include "chrome/browser/net/sdch_dictionary_fetcher.h" |
44 #include "chrome/browser/net/websocket_experiment/websocket_experiment_runner.h" | 44 #include "chrome/browser/net/websocket_experiment/websocket_experiment_runner.h" |
45 #include "chrome/browser/plugin_service.h" | 45 #include "chrome/browser/plugin_service.h" |
46 #include "chrome/browser/pref_service.h" | 46 #include "chrome/browser/pref_service.h" |
47 #include "chrome/browser/process_singleton.h" | 47 #include "chrome/browser/process_singleton.h" |
| 48 #include "chrome/browser/profile.h" |
48 #include "chrome/browser/profile_manager.h" | 49 #include "chrome/browser/profile_manager.h" |
49 #include "chrome/browser/renderer_host/resource_dispatcher_host.h" | 50 #include "chrome/browser/renderer_host/resource_dispatcher_host.h" |
50 #include "chrome/browser/shell_integration.h" | 51 #include "chrome/browser/shell_integration.h" |
51 #include "chrome/browser/translate/translate_manager.h" | 52 #include "chrome/browser/translate/translate_manager.h" |
52 #include "chrome/browser/user_data_manager.h" | 53 #include "chrome/browser/user_data_manager.h" |
53 #include "chrome/common/chrome_constants.h" | 54 #include "chrome/common/chrome_constants.h" |
54 #include "chrome/common/chrome_paths.h" | 55 #include "chrome/common/chrome_paths.h" |
55 #include "chrome/common/chrome_switches.h" | 56 #include "chrome/common/chrome_switches.h" |
56 #include "chrome/common/jstemplate_builder.h" | 57 #include "chrome/common/jstemplate_builder.h" |
57 #include "chrome/common/main_function_params.h" | 58 #include "chrome/common/main_function_params.h" |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
100 | 101 |
101 #include "app/l10n_util_win.h" | 102 #include "app/l10n_util_win.h" |
102 #include "app/win_util.h" | 103 #include "app/win_util.h" |
103 #include "base/nss_util.h" | 104 #include "base/nss_util.h" |
104 #include "base/registry.h" | 105 #include "base/registry.h" |
105 #include "base/win_util.h" | 106 #include "base/win_util.h" |
106 #include "chrome/browser/browser.h" | 107 #include "chrome/browser/browser.h" |
107 #include "chrome/browser/browser_trial.h" | 108 #include "chrome/browser/browser_trial.h" |
108 #include "chrome/browser/metrics/user_metrics.h" | 109 #include "chrome/browser/metrics/user_metrics.h" |
109 #include "chrome/browser/net/url_fixer_upper.h" | 110 #include "chrome/browser/net/url_fixer_upper.h" |
110 #include "chrome/browser/profile.h" | |
111 #include "chrome/browser/rlz/rlz.h" | 111 #include "chrome/browser/rlz/rlz.h" |
112 #include "chrome/browser/views/user_data_dir_dialog.h" | 112 #include "chrome/browser/views/user_data_dir_dialog.h" |
113 #include "chrome/common/env_vars.h" | 113 #include "chrome/common/env_vars.h" |
114 #include "chrome/common/sandbox_policy.h" | 114 #include "chrome/common/sandbox_policy.h" |
115 #include "chrome/installer/util/helper.h" | 115 #include "chrome/installer/util/helper.h" |
116 #include "chrome/installer/util/install_util.h" | 116 #include "chrome/installer/util/install_util.h" |
117 #include "chrome/installer/util/shell_util.h" | 117 #include "chrome/installer/util/shell_util.h" |
118 #include "chrome/installer/util/version.h" | 118 #include "chrome/installer/util/version.h" |
119 #include "net/base/net_util.h" | 119 #include "net/base/net_util.h" |
120 #include "net/base/sdch_manager.h" | 120 #include "net/base/sdch_manager.h" |
(...skipping 848 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
969 // | 969 // |
970 // A simpler way of doing all this would be to have some function which could | 970 // A simpler way of doing all this would be to have some function which could |
971 // give the time elapsed since startup, and simply have these objects check | 971 // give the time elapsed since startup, and simply have these objects check |
972 // that when asked to initialize themselves, but this doesn't seem to exist. | 972 // that when asked to initialize themselves, but this doesn't seem to exist. |
973 // | 973 // |
974 // These can't be created in the BrowserProcessImpl constructor because they | 974 // These can't be created in the BrowserProcessImpl constructor because they |
975 // need to read prefs that get set after that runs. | 975 // need to read prefs that get set after that runs. |
976 browser_process->google_url_tracker(); | 976 browser_process->google_url_tracker(); |
977 browser_process->intranet_redirect_detector(); | 977 browser_process->intranet_redirect_detector(); |
978 | 978 |
979 // Have Chrome plugins write their data to the profile directory. | 979 // Do initialize the plug-in service (and related preferences). |
980 PluginService::GetInstance()->SetChromePluginDataDir(profile->GetPath()); | 980 PluginService::InitGlobalInstance(profile); |
981 | 981 |
982 // Prepare for memory caching of SDCH dictionaries. | 982 // Prepare for memory caching of SDCH dictionaries. |
983 // Perform A/B test to measure global impact of SDCH support. | 983 // Perform A/B test to measure global impact of SDCH support. |
984 // Set up a field trial to see what disabling SDCH does to latency of page | 984 // Set up a field trial to see what disabling SDCH does to latency of page |
985 // layout globally. | 985 // layout globally. |
986 FieldTrial::Probability kSDCH_DIVISOR = 100; | 986 FieldTrial::Probability kSDCH_DIVISOR = 100; |
987 FieldTrial::Probability kSDCH_DISABLE_PROBABILITY = 5; // 5% probability. | 987 FieldTrial::Probability kSDCH_DISABLE_PROBABILITY = 5; // 5% probability. |
988 scoped_refptr<FieldTrial> sdch_trial = | 988 scoped_refptr<FieldTrial> sdch_trial = |
989 new FieldTrial("GlobalSdch", kSDCH_DIVISOR); | 989 new FieldTrial("GlobalSdch", kSDCH_DIVISOR); |
990 | 990 |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1084 if (metrics) | 1084 if (metrics) |
1085 metrics->Stop(); | 1085 metrics->Stop(); |
1086 | 1086 |
1087 // browser_shutdown takes care of deleting browser_process, so we need to | 1087 // browser_shutdown takes care of deleting browser_process, so we need to |
1088 // release it. | 1088 // release it. |
1089 browser_process.release(); | 1089 browser_process.release(); |
1090 browser_shutdown::Shutdown(); | 1090 browser_shutdown::Shutdown(); |
1091 | 1091 |
1092 return result_code; | 1092 return result_code; |
1093 } | 1093 } |
OLD | NEW |