| 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" |
| 11 #include "base/lazy_instance.h" | 11 #include "base/lazy_instance.h" |
| 12 #include "base/message_loop.h" | 12 #include "base/message_loop.h" |
| 13 #include "base/string_number_conversions.h" | 13 #include "base/string_number_conversions.h" |
| 14 #include "base/string_split.h" | 14 #include "base/string_split.h" |
| 15 #include "chrome/browser/browser_process_impl.h" | 15 #include "chrome/browser/browser_process_impl.h" |
| 16 #include "chrome/browser/chromeos/audio/audio_handler.h" | 16 #include "chrome/browser/chromeos/audio/audio_handler.h" |
| 17 #include "chrome/browser/chromeos/background/desktop_background_observer.h" | |
| 18 #include "chrome/browser/chromeos/boot_times_loader.h" | 17 #include "chrome/browser/chromeos/boot_times_loader.h" |
| 19 #include "chrome/browser/chromeos/cros/cros_library.h" | 18 #include "chrome/browser/chromeos/cros/cros_library.h" |
| 20 #include "chrome/browser/chromeos/cryptohome/async_method_caller.h" | 19 #include "chrome/browser/chromeos/cryptohome/async_method_caller.h" |
| 21 #include "chrome/browser/chromeos/dbus/cros_dbus_service.h" | 20 #include "chrome/browser/chromeos/dbus/cros_dbus_service.h" |
| 22 #include "chrome/browser/chromeos/disks/disk_mount_manager.h" | 21 #include "chrome/browser/chromeos/disks/disk_mount_manager.h" |
| 23 #include "chrome/browser/chromeos/external_metrics.h" | 22 #include "chrome/browser/chromeos/external_metrics.h" |
| 24 #include "chrome/browser/chromeos/imageburner/burn_manager.h" | 23 #include "chrome/browser/chromeos/imageburner/burn_manager.h" |
| 25 #include "chrome/browser/chromeos/input_method/input_method_manager.h" | 24 #include "chrome/browser/chromeos/input_method/input_method_manager.h" |
| 26 #include "chrome/browser/chromeos/input_method/xkeyboard.h" | 25 #include "chrome/browser/chromeos/input_method/xkeyboard.h" |
| 27 #include "chrome/browser/chromeos/kiosk_mode/kiosk_mode_idle_logout.h" | 26 #include "chrome/browser/chromeos/kiosk_mode/kiosk_mode_idle_logout.h" |
| (...skipping 332 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 360 | 359 |
| 361 // Initialize user policy before creating the profile so the profile | 360 // Initialize user policy before creating the profile so the profile |
| 362 // initialization code sees policy settings. | 361 // initialization code sees policy settings. |
| 363 g_browser_process->browser_policy_connector()->InitializeUserPolicy( | 362 g_browser_process->browser_policy_connector()->InitializeUserPolicy( |
| 364 username, false /* wait_for_policy_fetch */); | 363 username, false /* wait_for_policy_fetch */); |
| 365 chromeos::UserManager::Get()->SessionStarted(); | 364 chromeos::UserManager::Get()->SessionStarted(); |
| 366 } | 365 } |
| 367 | 366 |
| 368 // In Aura builds this will initialize ash::Shell. | 367 // In Aura builds this will initialize ash::Shell. |
| 369 ChromeBrowserMainPartsLinux::PreProfileInit(); | 368 ChromeBrowserMainPartsLinux::PreProfileInit(); |
| 370 | |
| 371 // Initialize desktop background observer so that it can receive | |
| 372 // LOGIN_USER_CHANGED notification from UserManager. | |
| 373 desktop_background_observer_.reset(new chromeos::DesktopBackgroundObserver); | |
| 374 } | 369 } |
| 375 | 370 |
| 376 void ChromeBrowserMainPartsChromeos::PostProfileInit() { | 371 void ChromeBrowserMainPartsChromeos::PostProfileInit() { |
| 377 // -- This used to be in ChromeBrowserMainParts::PreMainMessageLoopRun() | 372 // -- This used to be in ChromeBrowserMainParts::PreMainMessageLoopRun() |
| 378 // -- just after CreateProfile(). | 373 // -- just after CreateProfile(). |
| 379 | 374 |
| 380 if (parsed_command_line().HasSwitch(switches::kLoginUser) && | 375 if (parsed_command_line().HasSwitch(switches::kLoginUser) && |
| 381 !parsed_command_line().HasSwitch(switches::kLoginPassword)) { | 376 !parsed_command_line().HasSwitch(switches::kLoginPassword)) { |
| 382 // Pass the TokenService pointer to the policy connector so user policy can | 377 // Pass the TokenService pointer to the policy connector so user policy can |
| 383 // grab a token and register with the policy server. | 378 // grab a token and register with the policy server. |
| (...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 542 browser::LowMemoryObserver::SetLowMemoryMargin(100); | 537 browser::LowMemoryObserver::SetLowMemoryMargin(100); |
| 543 } else if (trial->group() == margin_200mb) { | 538 } else if (trial->group() == margin_200mb) { |
| 544 LOG(WARNING) << "low_mem: Part of '200MB' experiment"; | 539 LOG(WARNING) << "low_mem: Part of '200MB' experiment"; |
| 545 browser::LowMemoryObserver::SetLowMemoryMargin(200); | 540 browser::LowMemoryObserver::SetLowMemoryMargin(200); |
| 546 } else { | 541 } else { |
| 547 LOG(WARNING) << "low_mem: Part of 'default' experiment"; | 542 LOG(WARNING) << "low_mem: Part of 'default' experiment"; |
| 548 } | 543 } |
| 549 } | 544 } |
| 550 } | 545 } |
| 551 | 546 |
| OLD | NEW |