Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/chrome_browser_main.h" | 5 #include "chrome/browser/chrome_browser_main.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 51 #include "chrome/browser/metrics/metrics_log.h" | 51 #include "chrome/browser/metrics/metrics_log.h" |
| 52 #include "chrome/browser/metrics/metrics_service.h" | 52 #include "chrome/browser/metrics/metrics_service.h" |
| 53 #include "chrome/browser/metrics/thread_watcher.h" | 53 #include "chrome/browser/metrics/thread_watcher.h" |
| 54 #include "chrome/browser/metrics/tracking_synchronizer.h" | 54 #include "chrome/browser/metrics/tracking_synchronizer.h" |
| 55 #include "chrome/browser/nacl_host/nacl_process_host.h" | 55 #include "chrome/browser/nacl_host/nacl_process_host.h" |
| 56 #include "chrome/browser/net/chrome_net_log.h" | 56 #include "chrome/browser/net/chrome_net_log.h" |
| 57 #include "chrome/browser/net/predictor.h" | 57 #include "chrome/browser/net/predictor.h" |
| 58 #include "chrome/browser/notifications/desktop_notification_service.h" | 58 #include "chrome/browser/notifications/desktop_notification_service.h" |
| 59 #include "chrome/browser/notifications/desktop_notification_service_factory.h" | 59 #include "chrome/browser/notifications/desktop_notification_service_factory.h" |
| 60 #include "chrome/browser/plugin_prefs.h" | 60 #include "chrome/browser/plugin_prefs.h" |
| 61 #include "chrome/browser/policy/browser_policy_connector.h" | |
| 62 #include "chrome/browser/prefs/pref_service.h" | 61 #include "chrome/browser/prefs/pref_service.h" |
| 63 #include "chrome/browser/prefs/pref_value_store.h" | 62 #include "chrome/browser/prefs/pref_value_store.h" |
| 64 #include "chrome/browser/prerender/prerender_field_trial.h" | 63 #include "chrome/browser/prerender/prerender_field_trial.h" |
| 65 #include "chrome/browser/printing/cloud_print/cloud_print_proxy_service.h" | 64 #include "chrome/browser/printing/cloud_print/cloud_print_proxy_service.h" |
| 66 #include "chrome/browser/printing/cloud_print/cloud_print_proxy_service_factory. h" | 65 #include "chrome/browser/printing/cloud_print/cloud_print_proxy_service_factory. h" |
| 67 #include "chrome/browser/process_singleton.h" | 66 #include "chrome/browser/process_singleton.h" |
| 68 #include "chrome/browser/profiles/profile.h" | 67 #include "chrome/browser/profiles/profile.h" |
| 69 #include "chrome/browser/profiles/profile_manager.h" | 68 #include "chrome/browser/profiles/profile_manager.h" |
| 70 #include "chrome/browser/search_engines/search_engine_type.h" | 69 #include "chrome/browser/search_engines/search_engine_type.h" |
| 71 #include "chrome/browser/search_engines/template_url.h" | 70 #include "chrome/browser/search_engines/template_url.h" |
| (...skipping 387 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 459 version_info.is_valid() ? version_info.Version() : "0"; | 458 version_info.is_valid() ? version_info.Version() : "0"; |
| 460 GpuBlacklist* gpu_blacklist = new GpuBlacklist(chrome_version_string); | 459 GpuBlacklist* gpu_blacklist = new GpuBlacklist(chrome_version_string); |
| 461 bool succeed = gpu_blacklist->LoadGpuBlacklist( | 460 bool succeed = gpu_blacklist->LoadGpuBlacklist( |
| 462 gpu_blacklist_json.as_string(), GpuBlacklist::kCurrentOsOnly); | 461 gpu_blacklist_json.as_string(), GpuBlacklist::kCurrentOsOnly); |
| 463 DCHECK(succeed); | 462 DCHECK(succeed); |
| 464 GpuDataManager::GetInstance()->SetGpuBlacklist(gpu_blacklist); | 463 GpuDataManager::GetInstance()->SetGpuBlacklist(gpu_blacklist); |
| 465 } | 464 } |
| 466 | 465 |
| 467 #if defined(OS_MACOSX) | 466 #if defined(OS_MACOSX) |
| 468 OSStatus KeychainCallback(SecKeychainEvent keychain_event, | 467 OSStatus KeychainCallback(SecKeychainEvent keychain_event, |
| 469 SecKeychainCallbackInfo *info, void *context) { | 468 SecKeychainCallbackInfo* info, void* context) { |
| 470 return noErr; | 469 return noErr; |
| 471 } | 470 } |
| 472 #endif | 471 #endif |
| 473 | 472 |
| 474 #if defined(OS_CHROMEOS) && defined(TOOLKIT_USES_GTK) | 473 #if defined(OS_CHROMEOS) && defined(TOOLKIT_USES_GTK) |
| 475 void RegisterTranslateableItems(void) { | 474 void RegisterTranslateableItems(void) { |
| 476 struct { | 475 struct { |
| 477 const char* stock_id; | 476 const char* stock_id; |
| 478 int resource_id; | 477 int resource_id; |
| 479 } translations[] = { | 478 } translations[] = { |
| (...skipping 761 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1241 // Create Sentinel if no-first-run argument is passed in. | 1240 // Create Sentinel if no-first-run argument is passed in. |
| 1242 if (parsed_command_line().HasSwitch(switches::kNoFirstRun)) | 1241 if (parsed_command_line().HasSwitch(switches::kNoFirstRun)) |
| 1243 first_run::CreateSentinel(); | 1242 first_run::CreateSentinel(); |
| 1244 } | 1243 } |
| 1245 | 1244 |
| 1246 // TODO(viettrungluu): why don't we run this earlier? | 1245 // TODO(viettrungluu): why don't we run this earlier? |
| 1247 if (!parsed_command_line().HasSwitch(switches::kNoErrorDialogs)) | 1246 if (!parsed_command_line().HasSwitch(switches::kNoErrorDialogs)) |
| 1248 WarnAboutMinimumSystemRequirements(); | 1247 WarnAboutMinimumSystemRequirements(); |
| 1249 | 1248 |
| 1250 // Convert active labs into switches. Modifies the current command line. | 1249 // Convert active labs into switches. Modifies the current command line. |
| 1251 about_flags::ConvertFlagsToSwitches(local_state_, | 1250 about_flags::ConvertFlagsToSwitches(local_state_, |
|
Lei Zhang
2012/01/19 00:23:26
We have a circular dependency here, since ConvertF
| |
| 1252 CommandLine::ForCurrentProcess()); | 1251 CommandLine::ForCurrentProcess()); |
| 1252 local_state_->UpdateCommandLinePrefStore(CommandLine::ForCurrentProcess()); | |
| 1253 | 1253 |
| 1254 // Reset the command line in the crash report details, since we may have | 1254 // Reset the command line in the crash report details, since we may have |
| 1255 // just changed it to include experiments. | 1255 // just changed it to include experiments. |
| 1256 child_process_logging::SetCommandLine(CommandLine::ForCurrentProcess()); | 1256 child_process_logging::SetCommandLine(CommandLine::ForCurrentProcess()); |
| 1257 | 1257 |
| 1258 InitializeNetworkOptions(parsed_command_line()); | 1258 InitializeNetworkOptions(parsed_command_line()); |
| 1259 InitializeURLRequestThrottlerManager(browser_process_->net_log()); | 1259 InitializeURLRequestThrottlerManager(browser_process_->net_log()); |
| 1260 | 1260 |
| 1261 // Initialize histogram synchronizer system. This is a singleton and is used | 1261 // Initialize histogram synchronizer system. This is a singleton and is used |
| 1262 // for posting tasks via base::Bind. Its deleted when it goes out of scope. | 1262 // for posting tasks via base::Bind. Its deleted when it goes out of scope. |
| (...skipping 685 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1948 if (base::win::GetVersion() <= base::win::VERSION_XP) | 1948 if (base::win::GetVersion() <= base::win::VERSION_XP) |
| 1949 uma_name += "_XP"; | 1949 uma_name += "_XP"; |
| 1950 | 1950 |
| 1951 uma_name += "_PreRead"; | 1951 uma_name += "_PreRead"; |
| 1952 uma_name += pre_read == "1" ? "Enabled" : "Disabled"; | 1952 uma_name += pre_read == "1" ? "Enabled" : "Disabled"; |
| 1953 AddPreReadHistogramTime(uma_name.c_str(), time); | 1953 AddPreReadHistogramTime(uma_name.c_str(), time); |
| 1954 } | 1954 } |
| 1955 #endif | 1955 #endif |
| 1956 #endif | 1956 #endif |
| 1957 } | 1957 } |
| OLD | NEW |