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 "app/resource_bundle.h" | 9 #include "app/resource_bundle.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 22 matching lines...) Expand all Loading... |
33 #include "chrome/browser/metrics/metrics_service.h" | 33 #include "chrome/browser/metrics/metrics_service.h" |
34 #include "chrome/browser/net/dns_global.h" | 34 #include "chrome/browser/net/dns_global.h" |
35 #include "chrome/browser/plugin_service.h" | 35 #include "chrome/browser/plugin_service.h" |
36 #include "chrome/browser/process_singleton.h" | 36 #include "chrome/browser/process_singleton.h" |
37 #include "chrome/browser/profile_manager.h" | 37 #include "chrome/browser/profile_manager.h" |
38 #include "chrome/browser/shell_integration.h" | 38 #include "chrome/browser/shell_integration.h" |
39 #include "chrome/browser/user_data_manager.h" | 39 #include "chrome/browser/user_data_manager.h" |
40 #include "chrome/common/chrome_constants.h" | 40 #include "chrome/common/chrome_constants.h" |
41 #include "chrome/common/chrome_paths.h" | 41 #include "chrome/common/chrome_paths.h" |
42 #include "chrome/common/chrome_switches.h" | 42 #include "chrome/common/chrome_switches.h" |
| 43 #include "chrome/common/histogram_synchronizer.h" |
43 #include "chrome/common/jstemplate_builder.h" | 44 #include "chrome/common/jstemplate_builder.h" |
44 #include "chrome/common/l10n_util.h" | 45 #include "chrome/common/l10n_util.h" |
45 #include "chrome/common/main_function_params.h" | 46 #include "chrome/common/main_function_params.h" |
46 #include "chrome/common/pref_names.h" | 47 #include "chrome/common/pref_names.h" |
47 #include "chrome/common/pref_service.h" | 48 #include "chrome/common/pref_service.h" |
48 #include "chrome/common/result_codes.h" | 49 #include "chrome/common/result_codes.h" |
49 #include "grit/chromium_strings.h" | 50 #include "grit/chromium_strings.h" |
50 #include "grit/generated_resources.h" | 51 #include "grit/generated_resources.h" |
51 #include "grit/net_resources.h" | 52 #include "grit/net_resources.h" |
52 #include "net/base/net_module.h" | 53 #include "net/base/net_module.h" |
(...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
333 if (!parsed_command_line.HasSwitch(switches::kNoErrorDialogs)) { | 334 if (!parsed_command_line.HasSwitch(switches::kNoErrorDialogs)) { |
334 // Display a warning if the user is running windows 2000. | 335 // Display a warning if the user is running windows 2000. |
335 // TODO(port): We should probably change this to a "check for minimum | 336 // TODO(port): We should probably change this to a "check for minimum |
336 // requirements" function, implemented by each platform. | 337 // requirements" function, implemented by each platform. |
337 CheckForWin2000(); | 338 CheckForWin2000(); |
338 } | 339 } |
339 | 340 |
340 // Initialize histogram statistics gathering system. | 341 // Initialize histogram statistics gathering system. |
341 StatisticsRecorder statistics; | 342 StatisticsRecorder statistics; |
342 | 343 |
| 344 // Initialize histogram synchronizer system. This is a singleton and is used |
| 345 // for posting tasks via NewRunnableMethod. Its deleted when it goes out of |
| 346 // scope. Even though NewRunnableMethod does AddRef and Release, the object |
| 347 // will not be deleted after the Task is executed. |
| 348 scoped_refptr<HistogramSynchronizer> histogram_synchronizer = |
| 349 new HistogramSynchronizer(); |
| 350 |
343 // Initialize the shared instance of user data manager. | 351 // Initialize the shared instance of user data manager. |
344 scoped_ptr<UserDataManager> user_data_manager(UserDataManager::Create()); | 352 scoped_ptr<UserDataManager> user_data_manager(UserDataManager::Create()); |
345 | 353 |
346 // Try to create/load the profile. | 354 // Try to create/load the profile. |
347 ProfileManager* profile_manager = browser_process->profile_manager(); | 355 ProfileManager* profile_manager = browser_process->profile_manager(); |
348 Profile* profile = profile_manager->GetDefaultProfile(user_data_dir); | 356 Profile* profile = profile_manager->GetDefaultProfile(user_data_dir); |
349 if (!profile) { | 357 if (!profile) { |
350 #if defined(OS_WIN) | 358 #if defined(OS_WIN) |
351 user_data_dir = FilePath::FromWStringHack( | 359 user_data_dir = FilePath::FromWStringHack( |
352 UserDataDirDialog::RunUserDataDirDialog(user_data_dir.ToWStringHack())); | 360 UserDataDirDialog::RunUserDataDirDialog(user_data_dir.ToWStringHack())); |
(...skipping 274 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
627 if (metrics) | 635 if (metrics) |
628 metrics->Stop(); | 636 metrics->Stop(); |
629 | 637 |
630 // browser_shutdown takes care of deleting browser_process, so we need to | 638 // browser_shutdown takes care of deleting browser_process, so we need to |
631 // release it. | 639 // release it. |
632 browser_process.release(); | 640 browser_process.release(); |
633 browser_shutdown::Shutdown(); | 641 browser_shutdown::Shutdown(); |
634 | 642 |
635 return result_code; | 643 return result_code; |
636 } | 644 } |
OLD | NEW |