| 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/chromeos/chrome_browser_main_chromeos.h" | 5 #include "chrome/browser/chromeos/chrome_browser_main_chromeos.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/callback.h" | 8 #include "base/callback.h" |
| 9 #include "base/chromeos/chromeos_version.h" | 9 #include "base/chromeos/chromeos_version.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 44 #include "chrome/browser/chromeos/power/screen_lock_observer.h" | 44 #include "chrome/browser/chromeos/power/screen_lock_observer.h" |
| 45 #include "chrome/browser/chromeos/power/video_property_writer.h" | 45 #include "chrome/browser/chromeos/power/video_property_writer.h" |
| 46 #include "chrome/browser/chromeos/system/statistics_provider.h" | 46 #include "chrome/browser/chromeos/system/statistics_provider.h" |
| 47 #include "chrome/browser/chromeos/system_key_event_listener.h" | 47 #include "chrome/browser/chromeos/system_key_event_listener.h" |
| 48 #include "chrome/browser/chromeos/upgrade_detector_chromeos.h" | 48 #include "chrome/browser/chromeos/upgrade_detector_chromeos.h" |
| 49 #include "chrome/browser/chromeos/web_socket_proxy_controller.h" | 49 #include "chrome/browser/chromeos/web_socket_proxy_controller.h" |
| 50 #include "chrome/browser/chromeos/xinput_hierarchy_changed_event_listener.h" | 50 #include "chrome/browser/chromeos/xinput_hierarchy_changed_event_listener.h" |
| 51 #include "chrome/browser/defaults.h" | 51 #include "chrome/browser/defaults.h" |
| 52 #include "chrome/browser/low_memory_observer.h" | 52 #include "chrome/browser/low_memory_observer.h" |
| 53 #include "chrome/browser/metrics/metrics_service.h" | 53 #include "chrome/browser/metrics/metrics_service.h" |
| 54 #include "chrome/browser/net/chrome_network_delegate.h" |
| 54 #include "chrome/browser/oom_priority_manager.h" | 55 #include "chrome/browser/oom_priority_manager.h" |
| 55 #include "chrome/browser/policy/browser_policy_connector.h" | 56 #include "chrome/browser/policy/browser_policy_connector.h" |
| 56 #include "chrome/browser/prefs/pref_service.h" | 57 #include "chrome/browser/prefs/pref_service.h" |
| 57 #include "chrome/browser/profiles/profile.h" | 58 #include "chrome/browser/profiles/profile.h" |
| 58 #include "chrome/browser/profiles/profile_manager.h" | 59 #include "chrome/browser/profiles/profile_manager.h" |
| 59 #include "chrome/browser/signin/token_service_factory.h" | 60 #include "chrome/browser/signin/token_service_factory.h" |
| 60 #include "chrome/browser/ui/views/browser_dialogs.h" | 61 #include "chrome/browser/ui/views/browser_dialogs.h" |
| 61 #include "chrome/common/chrome_notification_types.h" | 62 #include "chrome/common/chrome_notification_types.h" |
| 62 #include "chrome/common/chrome_switches.h" | 63 #include "chrome/common/chrome_switches.h" |
| 63 #include "chrome/common/chrome_version_info.h" | 64 #include "chrome/common/chrome_version_info.h" |
| (...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 333 chromeos::ScreenLocker::InitClass(); | 334 chromeos::ScreenLocker::InitClass(); |
| 334 } | 335 } |
| 335 | 336 |
| 336 // This forces the ProfileManager to be created and register for the | 337 // This forces the ProfileManager to be created and register for the |
| 337 // notification it needs to track the logged in user. | 338 // notification it needs to track the logged in user. |
| 338 g_browser_process->profile_manager(); | 339 g_browser_process->profile_manager(); |
| 339 | 340 |
| 340 // TODO(abarth): Should this move to InitializeNetworkOptions()? | 341 // TODO(abarth): Should this move to InitializeNetworkOptions()? |
| 341 // Allow access to file:// on ChromeOS for tests. | 342 // Allow access to file:// on ChromeOS for tests. |
| 342 if (parsed_command_line().HasSwitch(switches::kAllowFileAccess)) | 343 if (parsed_command_line().HasSwitch(switches::kAllowFileAccess)) |
| 343 net::URLRequest::AllowFileAccess(); | 344 ChromeNetworkDelegate::AllowAccessToAllFiles(); |
| 344 | 345 |
| 345 // There are two use cases for kLoginUser: | 346 // There are two use cases for kLoginUser: |
| 346 // 1) if passed in tandem with kLoginPassword, to drive a "StubLogin" | 347 // 1) if passed in tandem with kLoginPassword, to drive a "StubLogin" |
| 347 // 2) if passed alone, to signal that the indicated user has already | 348 // 2) if passed alone, to signal that the indicated user has already |
| 348 // logged in and we should behave accordingly. | 349 // logged in and we should behave accordingly. |
| 349 // This handles case 2. | 350 // This handles case 2. |
| 350 if (parsed_command_line().HasSwitch(switches::kLoginUser) && | 351 if (parsed_command_line().HasSwitch(switches::kLoginUser) && |
| 351 !parsed_command_line().HasSwitch(switches::kLoginPassword)) { | 352 !parsed_command_line().HasSwitch(switches::kLoginPassword)) { |
| 352 std::string username = | 353 std::string username = |
| 353 parsed_command_line().GetSwitchValueASCII(switches::kLoginUser); | 354 parsed_command_line().GetSwitchValueASCII(switches::kLoginUser); |
| (...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 544 browser::LowMemoryObserver::SetLowMemoryMargin(100); | 545 browser::LowMemoryObserver::SetLowMemoryMargin(100); |
| 545 } else if (trial->group() == margin_200mb) { | 546 } else if (trial->group() == margin_200mb) { |
| 546 LOG(WARNING) << "low_mem: Part of '200MB' experiment"; | 547 LOG(WARNING) << "low_mem: Part of '200MB' experiment"; |
| 547 browser::LowMemoryObserver::SetLowMemoryMargin(200); | 548 browser::LowMemoryObserver::SetLowMemoryMargin(200); |
| 548 } else { | 549 } else { |
| 549 LOG(WARNING) << "low_mem: Part of 'default' experiment"; | 550 LOG(WARNING) << "low_mem: Part of 'default' experiment"; |
| 550 } | 551 } |
| 551 } | 552 } |
| 552 } | 553 } |
| 553 | 554 |
| OLD | NEW |