| 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 23 matching lines...) Expand all Loading... |
| 34 #include "chrome/browser/browser_process_impl.h" | 34 #include "chrome/browser/browser_process_impl.h" |
| 35 #include "chrome/browser/browser_shutdown.h" | 35 #include "chrome/browser/browser_shutdown.h" |
| 36 #include "chrome/browser/chrome_browser_main_extra_parts.h" | 36 #include "chrome/browser/chrome_browser_main_extra_parts.h" |
| 37 #include "chrome/browser/defaults.h" | 37 #include "chrome/browser/defaults.h" |
| 38 #include "chrome/browser/extensions/extension_protocols.h" | 38 #include "chrome/browser/extensions/extension_protocols.h" |
| 39 #include "chrome/browser/extensions/extension_service.h" | 39 #include "chrome/browser/extensions/extension_service.h" |
| 40 #include "chrome/browser/extensions/startup_helper.h" | 40 #include "chrome/browser/extensions/startup_helper.h" |
| 41 #include "chrome/browser/first_run/upgrade_util.h" | 41 #include "chrome/browser/first_run/upgrade_util.h" |
| 42 #include "chrome/browser/google/google_search_counter.h" | 42 #include "chrome/browser/google/google_search_counter.h" |
| 43 #include "chrome/browser/google/google_util.h" | 43 #include "chrome/browser/google/google_util.h" |
| 44 #include "chrome/browser/gpu_blacklist.h" | |
| 45 #include "chrome/browser/jankometer.h" | 44 #include "chrome/browser/jankometer.h" |
| 46 #include "chrome/browser/language_usage_metrics.h" | 45 #include "chrome/browser/language_usage_metrics.h" |
| 47 #include "chrome/browser/managed_mode.h" | 46 #include "chrome/browser/managed_mode.h" |
| 48 #include "chrome/browser/metrics/field_trial_synchronizer.h" | 47 #include "chrome/browser/metrics/field_trial_synchronizer.h" |
| 49 #include "chrome/browser/metrics/metrics_log.h" | 48 #include "chrome/browser/metrics/metrics_log.h" |
| 50 #include "chrome/browser/metrics/metrics_service.h" | 49 #include "chrome/browser/metrics/metrics_service.h" |
| 51 #include "chrome/browser/metrics/thread_watcher.h" | 50 #include "chrome/browser/metrics/thread_watcher.h" |
| 52 #include "chrome/browser/metrics/tracking_synchronizer.h" | 51 #include "chrome/browser/metrics/tracking_synchronizer.h" |
| 53 #include "chrome/browser/metrics/variations/variations_service.h" | 52 #include "chrome/browser/metrics/variations/variations_service.h" |
| 54 #include "chrome/browser/nacl_host/nacl_process_host.h" | 53 #include "chrome/browser/nacl_host/nacl_process_host.h" |
| (...skipping 26 matching lines...) Expand all Loading... |
| 81 #include "chrome/browser/ui/startup/default_browser_prompt.h" | 80 #include "chrome/browser/ui/startup/default_browser_prompt.h" |
| 82 #include "chrome/browser/ui/startup/startup_browser_creator.h" | 81 #include "chrome/browser/ui/startup/startup_browser_creator.h" |
| 83 #include "chrome/browser/ui/uma_browsing_activity_observer.h" | 82 #include "chrome/browser/ui/uma_browsing_activity_observer.h" |
| 84 #include "chrome/browser/ui/user_data_dir_dialog.h" | 83 #include "chrome/browser/ui/user_data_dir_dialog.h" |
| 85 #include "chrome/browser/ui/webui/chrome_url_data_manager_backend.h" | 84 #include "chrome/browser/ui/webui/chrome_url_data_manager_backend.h" |
| 86 #include "chrome/common/child_process_logging.h" | 85 #include "chrome/common/child_process_logging.h" |
| 87 #include "chrome/common/chrome_constants.h" | 86 #include "chrome/common/chrome_constants.h" |
| 88 #include "chrome/common/chrome_paths.h" | 87 #include "chrome/common/chrome_paths.h" |
| 89 #include "chrome/common/chrome_result_codes.h" | 88 #include "chrome/common/chrome_result_codes.h" |
| 90 #include "chrome/common/chrome_switches.h" | 89 #include "chrome/common/chrome_switches.h" |
| 90 #include "chrome/common/chrome_version_info.h" |
| 91 #include "chrome/common/env_vars.h" | 91 #include "chrome/common/env_vars.h" |
| 92 #include "chrome/common/json_pref_store.h" | 92 #include "chrome/common/json_pref_store.h" |
| 93 #include "chrome/common/jstemplate_builder.h" | 93 #include "chrome/common/jstemplate_builder.h" |
| 94 #include "chrome/common/logging_chrome.h" | 94 #include "chrome/common/logging_chrome.h" |
| 95 #include "chrome/common/metrics/variations/variations_util.h" | 95 #include "chrome/common/metrics/variations/variations_util.h" |
| 96 #include "chrome/common/net/net_resource_provider.h" | 96 #include "chrome/common/net/net_resource_provider.h" |
| 97 #include "chrome/common/pref_names.h" | 97 #include "chrome/common/pref_names.h" |
| 98 #include "chrome/common/profiling.h" | 98 #include "chrome/common/profiling.h" |
| 99 #include "chrome/installer/util/google_update_settings.h" | 99 #include "chrome/installer/util/google_update_settings.h" |
| 100 #include "content/public/browser/browser_thread.h" | 100 #include "content/public/browser/browser_thread.h" |
| (...skipping 319 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 420 // silently exit because of missing code in the above test. | 420 // silently exit because of missing code in the above test. |
| 421 CHECK(profile) << "Cannot get default profile."; | 421 CHECK(profile) << "Cannot get default profile."; |
| 422 #endif | 422 #endif |
| 423 | 423 |
| 424 return NULL; | 424 return NULL; |
| 425 } | 425 } |
| 426 | 426 |
| 427 // Load GPU Blacklist, collect preliminary gpu info, and compute preliminary | 427 // Load GPU Blacklist, collect preliminary gpu info, and compute preliminary |
| 428 // gpu feature flags. | 428 // gpu feature flags. |
| 429 void InitializeGpuDataManager(const CommandLine& parsed_command_line) { | 429 void InitializeGpuDataManager(const CommandLine& parsed_command_line) { |
| 430 content::GpuDataManager::GetInstance()->InitializeGpuInfo(); | 430 if (parsed_command_line.HasSwitch(switches::kSkipGpuDataLoading)) |
| 431 if (parsed_command_line.HasSwitch(switches::kSkipGpuDataLoading) || | |
| 432 parsed_command_line.HasSwitch(switches::kIgnoreGpuBlacklist)) { | |
| 433 return; | 431 return; |
| 432 |
| 433 std::string chrome_version_string = "0"; |
| 434 std::string gpu_blacklist_json_string; |
| 435 if (!parsed_command_line.HasSwitch(switches::kIgnoreGpuBlacklist)) { |
| 436 chrome::VersionInfo chrome_version_info; |
| 437 if (chrome_version_info.is_valid()) |
| 438 chrome_version_string = chrome_version_info.Version(); |
| 439 |
| 440 const base::StringPiece gpu_blacklist_json( |
| 441 ResourceBundle::GetSharedInstance().GetRawDataResource( |
| 442 IDR_GPU_BLACKLIST, ui::SCALE_FACTOR_NONE)); |
| 443 gpu_blacklist_json_string = gpu_blacklist_json.as_string(); |
| 434 } | 444 } |
| 435 | 445 content::GpuDataManager::GetInstance()->Initialize( |
| 436 const base::StringPiece gpu_blacklist_json( | 446 chrome_version_string, gpu_blacklist_json_string); |
| 437 ResourceBundle::GetSharedInstance().GetRawDataResource( | |
| 438 IDR_GPU_BLACKLIST, ui::SCALE_FACTOR_NONE)); | |
| 439 GpuBlacklist* gpu_blacklist = GpuBlacklist::GetInstance(); | |
| 440 bool succeed = gpu_blacklist->LoadGpuBlacklist( | |
| 441 gpu_blacklist_json.as_string(), GpuBlacklist::kCurrentOsOnly); | |
| 442 DCHECK(succeed); | |
| 443 gpu_blacklist->UpdateGpuDataManager(); | |
| 444 } | 447 } |
| 445 | 448 |
| 446 #if defined(OS_MACOSX) | 449 #if defined(OS_MACOSX) |
| 447 OSStatus KeychainCallback(SecKeychainEvent keychain_event, | 450 OSStatus KeychainCallback(SecKeychainEvent keychain_event, |
| 448 SecKeychainCallbackInfo* info, void* context) { | 451 SecKeychainCallbackInfo* info, void* context) { |
| 449 return noErr; | 452 return noErr; |
| 450 } | 453 } |
| 451 #endif | 454 #endif |
| 452 | 455 |
| 453 // This code is specific to the Windows-only PreReadExperiment field-trial. | 456 // This code is specific to the Windows-only PreReadExperiment field-trial. |
| (...skipping 1173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1627 if (base::win::GetVersion() <= base::win::VERSION_XP) | 1630 if (base::win::GetVersion() <= base::win::VERSION_XP) |
| 1628 uma_name += "_XP"; | 1631 uma_name += "_XP"; |
| 1629 | 1632 |
| 1630 uma_name += "_PreRead_"; | 1633 uma_name += "_PreRead_"; |
| 1631 uma_name += pre_read_percentage; | 1634 uma_name += pre_read_percentage; |
| 1632 AddPreReadHistogramTime(uma_name.c_str(), time); | 1635 AddPreReadHistogramTime(uma_name.c_str(), time); |
| 1633 } | 1636 } |
| 1634 #endif | 1637 #endif |
| 1635 #endif | 1638 #endif |
| 1636 } | 1639 } |
| OLD | NEW |