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 23 matching lines...) Expand all Loading... |
34 #include "chrome/browser/chrome_thread.h" | 34 #include "chrome/browser/chrome_thread.h" |
35 #include "chrome/browser/dom_ui/chrome_url_data_manager.h" | 35 #include "chrome/browser/dom_ui/chrome_url_data_manager.h" |
36 #include "chrome/browser/extensions/extension_protocols.h" | 36 #include "chrome/browser/extensions/extension_protocols.h" |
37 #include "chrome/browser/first_run.h" | 37 #include "chrome/browser/first_run.h" |
38 #include "chrome/browser/memory_purger.h" | 38 #include "chrome/browser/memory_purger.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/plugin_service.h" | 43 #include "chrome/browser/plugin_service.h" |
44 #include "chrome/browser/privacy_blacklist/blacklist.h" | |
45 #include "chrome/browser/process_singleton.h" | 44 #include "chrome/browser/process_singleton.h" |
46 #include "chrome/browser/profile_manager.h" | 45 #include "chrome/browser/profile_manager.h" |
47 #include "chrome/browser/renderer_host/resource_dispatcher_host.h" | 46 #include "chrome/browser/renderer_host/resource_dispatcher_host.h" |
48 #include "chrome/browser/shell_integration.h" | 47 #include "chrome/browser/shell_integration.h" |
49 #include "chrome/browser/user_data_manager.h" | 48 #include "chrome/browser/user_data_manager.h" |
50 #include "chrome/common/chrome_constants.h" | 49 #include "chrome/common/chrome_constants.h" |
51 #include "chrome/common/chrome_paths.h" | 50 #include "chrome/common/chrome_paths.h" |
52 #include "chrome/common/chrome_switches.h" | 51 #include "chrome/common/chrome_switches.h" |
53 #include "chrome/common/histogram_synchronizer.h" | 52 #include "chrome/common/histogram_synchronizer.h" |
54 #include "chrome/common/jstemplate_builder.h" | 53 #include "chrome/common/jstemplate_builder.h" |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
95 #include "app/win_util.h" | 94 #include "app/win_util.h" |
96 #include "base/registry.h" | 95 #include "base/registry.h" |
97 #include "base/win_util.h" | 96 #include "base/win_util.h" |
98 #include "chrome/browser/browser.h" | 97 #include "chrome/browser/browser.h" |
99 #include "chrome/browser/browser_trial.h" | 98 #include "chrome/browser/browser_trial.h" |
100 #include "chrome/browser/jankometer.h" | 99 #include "chrome/browser/jankometer.h" |
101 #include "chrome/browser/metrics/user_metrics.h" | 100 #include "chrome/browser/metrics/user_metrics.h" |
102 #include "chrome/browser/net/url_fixer_upper.h" | 101 #include "chrome/browser/net/url_fixer_upper.h" |
103 #include "chrome/browser/profile.h" | 102 #include "chrome/browser/profile.h" |
104 #include "chrome/browser/rlz/rlz.h" | 103 #include "chrome/browser/rlz/rlz.h" |
105 #include "chrome/browser/views/blacklist_error_dialog.h" | |
106 #include "chrome/browser/views/user_data_dir_dialog.h" | 104 #include "chrome/browser/views/user_data_dir_dialog.h" |
107 #include "chrome/common/env_vars.h" | 105 #include "chrome/common/env_vars.h" |
108 #include "chrome/installer/util/helper.h" | 106 #include "chrome/installer/util/helper.h" |
109 #include "chrome/installer/util/install_util.h" | 107 #include "chrome/installer/util/install_util.h" |
110 #include "chrome/installer/util/shell_util.h" | 108 #include "chrome/installer/util/shell_util.h" |
111 #include "chrome/installer/util/version.h" | 109 #include "chrome/installer/util/version.h" |
112 #include "net/base/net_util.h" | 110 #include "net/base/net_util.h" |
113 #include "net/base/sdch_manager.h" | 111 #include "net/base/sdch_manager.h" |
114 #include "net/base/winsock_init.h" | 112 #include "net/base/winsock_init.h" |
115 #include "net/http/http_network_layer.h" | 113 #include "net/http/http_network_layer.h" |
(...skipping 456 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
572 | 570 |
573 return ResultCodes::NORMAL_EXIT; | 571 return ResultCodes::NORMAL_EXIT; |
574 } | 572 } |
575 #else | 573 #else |
576 // TODO(port): fix this. See comments near the definition of | 574 // TODO(port): fix this. See comments near the definition of |
577 // user_data_dir. It is better to CHECK-fail here than it is to | 575 // user_data_dir. It is better to CHECK-fail here than it is to |
578 // silently exit because of missing code in the above test. | 576 // silently exit because of missing code in the above test. |
579 CHECK(profile) << "Cannot get default profile."; | 577 CHECK(profile) << "Cannot get default profile."; |
580 #endif | 578 #endif |
581 | 579 |
582 if (profile->GetBlacklist() && !profile->GetBlacklist()->is_good()) { | |
583 // TODO(idanan): Enable this for other platforms once the dispatching | |
584 // support code has been ported. See ifdefs in message_loop.h. | |
585 #if defined(OS_WIN) | |
586 bool accepted = BlacklistErrorDialog::RunBlacklistErrorDialog(); | |
587 if (!accepted) | |
588 return ResultCodes::NORMAL_EXIT; | |
589 #else | |
590 return ResultCodes::NORMAL_EXIT; | |
591 #endif | |
592 } | |
593 | |
594 | |
595 PrefService* user_prefs = profile->GetPrefs(); | 580 PrefService* user_prefs = profile->GetPrefs(); |
596 DCHECK(user_prefs); | 581 DCHECK(user_prefs); |
597 | 582 |
598 // Now that local state and user prefs have been loaded, make the two pref | 583 // Now that local state and user prefs have been loaded, make the two pref |
599 // services aware of all our preferences. | 584 // services aware of all our preferences. |
600 browser::RegisterAllPrefs(user_prefs, local_state); | 585 browser::RegisterAllPrefs(user_prefs, local_state); |
601 | 586 |
602 // Now that all preferences have been registered, set the install date | 587 // Now that all preferences have been registered, set the install date |
603 // for the uninstall metrics if this is our first run. This only actually | 588 // for the uninstall metrics if this is our first run. This only actually |
604 // gets used if the user has metrics reporting enabled at uninstall time. | 589 // gets used if the user has metrics reporting enabled at uninstall time. |
(...skipping 292 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
897 if (metrics) | 882 if (metrics) |
898 metrics->Stop(); | 883 metrics->Stop(); |
899 | 884 |
900 // browser_shutdown takes care of deleting browser_process, so we need to | 885 // browser_shutdown takes care of deleting browser_process, so we need to |
901 // release it. | 886 // release it. |
902 browser_process.release(); | 887 browser_process.release(); |
903 browser_shutdown::Shutdown(); | 888 browser_shutdown::Shutdown(); |
904 | 889 |
905 return result_code; | 890 return result_code; |
906 } | 891 } |
OLD | NEW |