| 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 <string> | 7 #include <string> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "ash/shell.h" | 10 #include "ash/shell.h" |
| 11 #include "base/bind.h" | 11 #include "base/bind.h" |
| 12 #include "base/callback.h" | 12 #include "base/callback.h" |
| 13 #include "base/chromeos/chromeos_version.h" | 13 #include "base/chromeos/chromeos_version.h" |
| 14 #include "base/command_line.h" | 14 #include "base/command_line.h" |
| 15 #include "base/lazy_instance.h" | 15 #include "base/lazy_instance.h" |
| 16 #include "base/message_loop.h" | 16 #include "base/message_loop.h" |
| 17 #include "base/string_number_conversions.h" | 17 #include "base/string_number_conversions.h" |
| 18 #include "base/string_split.h" | 18 #include "base/string_split.h" |
| 19 #include "chrome/browser/browser_process.h" | 19 #include "chrome/browser/browser_process.h" |
| 20 #include "chrome/browser/chromeos/audio/audio_handler.h" | 20 #include "chrome/browser/chromeos/audio/audio_handler.h" |
| 21 #include "chrome/browser/chromeos/boot_times_loader.h" | 21 #include "chrome/browser/chromeos/boot_times_loader.h" |
| 22 #include "chrome/browser/chromeos/contacts/contact_manager.h" | 22 #include "chrome/browser/chromeos/contacts/contact_manager.h" |
| 23 #include "chrome/browser/chromeos/cros/cros_library.h" | 23 #include "chrome/browser/chromeos/cros/cros_library.h" |
| 24 #include "chrome/browser/chromeos/dbus/cros_dbus_service.h" | 24 #include "chrome/browser/chromeos/dbus/cros_dbus_service.h" |
| 25 #include "chrome/browser/chromeos/display/display_preferences.h" | 25 #include "chrome/browser/chromeos/display/display_preferences.h" |
| 26 #include "chrome/browser/chromeos/display/primary_display_switch_observer.h" | 26 #include "chrome/browser/chromeos/display/primary_display_switch_observer.h" |
| 27 #include "chrome/browser/chromeos/external_metrics.h" | 27 #include "chrome/browser/chromeos/external_metrics.h" |
| 28 #include "chrome/browser/chromeos/extensions/default_app_order.h" |
| 28 #include "chrome/browser/chromeos/imageburner/burn_manager.h" | 29 #include "chrome/browser/chromeos/imageburner/burn_manager.h" |
| 29 #include "chrome/browser/chromeos/input_method/input_method_manager.h" | 30 #include "chrome/browser/chromeos/input_method/input_method_manager.h" |
| 30 #include "chrome/browser/chromeos/input_method/xkeyboard.h" | 31 #include "chrome/browser/chromeos/input_method/xkeyboard.h" |
| 31 #include "chrome/browser/chromeos/kiosk_mode/kiosk_mode_idle_logout.h" | 32 #include "chrome/browser/chromeos/kiosk_mode/kiosk_mode_idle_logout.h" |
| 32 #include "chrome/browser/chromeos/kiosk_mode/kiosk_mode_screensaver.h" | 33 #include "chrome/browser/chromeos/kiosk_mode/kiosk_mode_screensaver.h" |
| 33 #include "chrome/browser/chromeos/kiosk_mode/kiosk_mode_settings.h" | 34 #include "chrome/browser/chromeos/kiosk_mode/kiosk_mode_settings.h" |
| 34 #include "chrome/browser/chromeos/login/authenticator.h" | 35 #include "chrome/browser/chromeos/login/authenticator.h" |
| 35 #include "chrome/browser/chromeos/login/login_utils.h" | 36 #include "chrome/browser/chromeos/login/login_utils.h" |
| 36 #include "chrome/browser/chromeos/login/login_wizard.h" | 37 #include "chrome/browser/chromeos/login/login_wizard.h" |
| 37 #include "chrome/browser/chromeos/login/screen_locker.h" | 38 #include "chrome/browser/chromeos/login/screen_locker.h" |
| (...skipping 354 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 392 // Redirects Chrome logging to the user data dir. | 393 // Redirects Chrome logging to the user data dir. |
| 393 logging::RedirectChromeLogging(parsed_command_line()); | 394 logging::RedirectChromeLogging(parsed_command_line()); |
| 394 | 395 |
| 395 // Initialize user policy before creating the profile so the profile | 396 // Initialize user policy before creating the profile so the profile |
| 396 // initialization code sees policy settings. | 397 // initialization code sees policy settings. |
| 397 // Guest accounts are not subject to user policy. | 398 // Guest accounts are not subject to user policy. |
| 398 if (!chromeos::UserManager::Get()->IsLoggedInAsGuest()) { | 399 if (!chromeos::UserManager::Get()->IsLoggedInAsGuest()) { |
| 399 g_browser_process->browser_policy_connector()->InitializeUserPolicy( | 400 g_browser_process->browser_policy_connector()->InitializeUserPolicy( |
| 400 username, false /* wait_for_policy_fetch */); | 401 username, false /* wait_for_policy_fetch */); |
| 401 } | 402 } |
| 403 |
| 404 // Load the default app order synchronously for restarting case. |
| 405 app_order_loader_.reset( |
| 406 new chromeos::default_app_order::ExternalLoader(false /* async */)); |
| 407 |
| 402 chromeos::UserManager::Get()->SessionStarted(); | 408 chromeos::UserManager::Get()->SessionStarted(); |
| 403 } | 409 } |
| 404 | 410 |
| 411 if (!app_order_loader_) { |
| 412 app_order_loader_.reset( |
| 413 new chromeos::default_app_order::ExternalLoader(true /* async */)); |
| 414 } |
| 415 |
| 405 // In Aura builds this will initialize ash::Shell. | 416 // In Aura builds this will initialize ash::Shell. |
| 406 ChromeBrowserMainPartsLinux::PreProfileInit(); | 417 ChromeBrowserMainPartsLinux::PreProfileInit(); |
| 407 } | 418 } |
| 408 | 419 |
| 409 void ChromeBrowserMainPartsChromeos::PostProfileInit() { | 420 void ChromeBrowserMainPartsChromeos::PostProfileInit() { |
| 410 // -- This used to be in ChromeBrowserMainParts::PreMainMessageLoopRun() | 421 // -- This used to be in ChromeBrowserMainParts::PreMainMessageLoopRun() |
| 411 // -- just after CreateProfile(). | 422 // -- just after CreateProfile(). |
| 412 | 423 |
| 413 policy::BrowserPolicyConnector* connector = | 424 policy::BrowserPolicyConnector* connector = |
| 414 g_browser_process->browser_policy_connector(); | 425 g_browser_process->browser_policy_connector(); |
| (...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 612 LOG(WARNING) << "low_mem: Part of '100MB' experiment"; | 623 LOG(WARNING) << "low_mem: Part of '100MB' experiment"; |
| 613 chromeos::LowMemoryObserver::SetLowMemoryMargin(100); | 624 chromeos::LowMemoryObserver::SetLowMemoryMargin(100); |
| 614 } else if (trial->group() == margin_200mb) { | 625 } else if (trial->group() == margin_200mb) { |
| 615 LOG(WARNING) << "low_mem: Part of '200MB' experiment"; | 626 LOG(WARNING) << "low_mem: Part of '200MB' experiment"; |
| 616 chromeos::LowMemoryObserver::SetLowMemoryMargin(200); | 627 chromeos::LowMemoryObserver::SetLowMemoryMargin(200); |
| 617 } else { | 628 } else { |
| 618 LOG(WARNING) << "low_mem: Part of 'default' experiment"; | 629 LOG(WARNING) << "low_mem: Part of 'default' experiment"; |
| 619 } | 630 } |
| 620 } | 631 } |
| 621 } | 632 } |
| OLD | NEW |