| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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/ash_switches.h" | 10 #include "ash/ash_switches.h" |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 42 #include "chrome/browser/chromeos/language_preferences.h" | 42 #include "chrome/browser/chromeos/language_preferences.h" |
| 43 #include "chrome/browser/chromeos/login/authenticator.h" | 43 #include "chrome/browser/chromeos/login/authenticator.h" |
| 44 #include "chrome/browser/chromeos/login/login_utils.h" | 44 #include "chrome/browser/chromeos/login/login_utils.h" |
| 45 #include "chrome/browser/chromeos/login/login_wizard.h" | 45 #include "chrome/browser/chromeos/login/login_wizard.h" |
| 46 #include "chrome/browser/chromeos/login/screen_locker.h" | 46 #include "chrome/browser/chromeos/login/screen_locker.h" |
| 47 #include "chrome/browser/chromeos/login/startup_utils.h" | 47 #include "chrome/browser/chromeos/login/startup_utils.h" |
| 48 #include "chrome/browser/chromeos/login/user_manager.h" | 48 #include "chrome/browser/chromeos/login/user_manager.h" |
| 49 #include "chrome/browser/chromeos/login/wallpaper_manager.h" | 49 #include "chrome/browser/chromeos/login/wallpaper_manager.h" |
| 50 #include "chrome/browser/chromeos/login/wizard_controller.h" | 50 #include "chrome/browser/chromeos/login/wizard_controller.h" |
| 51 #include "chrome/browser/chromeos/memory/oom_priority_manager.h" | 51 #include "chrome/browser/chromeos/memory/oom_priority_manager.h" |
| 52 #include "chrome/browser/chromeos/net/chrome_network_watcher.h" |
| 52 #include "chrome/browser/chromeos/net/network_portal_detector.h" | 53 #include "chrome/browser/chromeos/net/network_portal_detector.h" |
| 53 #include "chrome/browser/chromeos/options/cert_library.h" | 54 #include "chrome/browser/chromeos/options/cert_library.h" |
| 54 #include "chrome/browser/chromeos/policy/browser_policy_connector_chromeos.h" | 55 #include "chrome/browser/chromeos/policy/browser_policy_connector_chromeos.h" |
| 55 #include "chrome/browser/chromeos/power/idle_action_warning_observer.h" | 56 #include "chrome/browser/chromeos/power/idle_action_warning_observer.h" |
| 56 #include "chrome/browser/chromeos/power/peripheral_battery_observer.h" | 57 #include "chrome/browser/chromeos/power/peripheral_battery_observer.h" |
| 57 #include "chrome/browser/chromeos/power/power_button_observer.h" | 58 #include "chrome/browser/chromeos/power/power_button_observer.h" |
| 58 #include "chrome/browser/chromeos/power/power_data_collector.h" | 59 #include "chrome/browser/chromeos/power/power_data_collector.h" |
| 59 #include "chrome/browser/chromeos/power/power_prefs.h" | 60 #include "chrome/browser/chromeos/power/power_prefs.h" |
| 60 #include "chrome/browser/chromeos/profiles/profile_helper.h" | 61 #include "chrome/browser/chromeos/profiles/profile_helper.h" |
| 61 #include "chrome/browser/chromeos/settings/device_oauth2_token_service_factory.h
" | 62 #include "chrome/browser/chromeos/settings/device_oauth2_token_service_factory.h
" |
| (...skipping 398 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 460 g_browser_process->profile_manager(); | 461 g_browser_process->profile_manager(); |
| 461 | 462 |
| 462 // ProfileHelper has to be initialized after UserManager instance is created. | 463 // ProfileHelper has to be initialized after UserManager instance is created. |
| 463 g_browser_process->platform_part()->profile_helper()->Initialize(); | 464 g_browser_process->platform_part()->profile_helper()->Initialize(); |
| 464 | 465 |
| 465 // TODO(abarth): Should this move to InitializeNetworkOptions()? | 466 // TODO(abarth): Should this move to InitializeNetworkOptions()? |
| 466 // Allow access to file:// on ChromeOS for tests. | 467 // Allow access to file:// on ChromeOS for tests. |
| 467 if (parsed_command_line().HasSwitch(::switches::kAllowFileAccess)) | 468 if (parsed_command_line().HasSwitch(::switches::kAllowFileAccess)) |
| 468 ChromeNetworkDelegate::AllowAccessToAllFiles(); | 469 ChromeNetworkDelegate::AllowAccessToAllFiles(); |
| 469 | 470 |
| 471 chrome_network_watcher_.reset(new ChromeNetworkWatcher); |
| 472 |
| 470 // There are two use cases for kLoginUser: | 473 // There are two use cases for kLoginUser: |
| 471 // 1) if passed in tandem with kLoginPassword, to drive a "StubLogin" | 474 // 1) if passed in tandem with kLoginPassword, to drive a "StubLogin" |
| 472 // 2) if passed alone, to signal that the indicated user has already | 475 // 2) if passed alone, to signal that the indicated user has already |
| 473 // logged in and we should behave accordingly. | 476 // logged in and we should behave accordingly. |
| 474 // This handles case 2. | 477 // This handles case 2. |
| 475 bool immediate_login = | 478 bool immediate_login = |
| 476 parsed_command_line().HasSwitch(switches::kLoginUser) && | 479 parsed_command_line().HasSwitch(switches::kLoginUser) && |
| 477 !parsed_command_line().HasSwitch(switches::kLoginPassword); | 480 !parsed_command_line().HasSwitch(switches::kLoginPassword); |
| 478 if (immediate_login){ | 481 if (immediate_login){ |
| 479 // Redirects Chrome logging to the user data dir. | 482 // Redirects Chrome logging to the user data dir. |
| (...skipping 276 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 756 // depend on. | 759 // depend on. |
| 757 data_promo_notification_.reset(); | 760 data_promo_notification_.reset(); |
| 758 | 761 |
| 759 // Tell DeviceSettingsService to stop talking to session_manager. Do not | 762 // Tell DeviceSettingsService to stop talking to session_manager. Do not |
| 760 // shutdown DeviceSettingsService yet, it might still be accessed by | 763 // shutdown DeviceSettingsService yet, it might still be accessed by |
| 761 // BrowserPolicyConnector (owned by g_browser_process). | 764 // BrowserPolicyConnector (owned by g_browser_process). |
| 762 DeviceSettingsService::Get()->UnsetSessionManager(); | 765 DeviceSettingsService::Get()->UnsetSessionManager(); |
| 763 | 766 |
| 764 // We should remove observers attached to D-Bus clients before | 767 // We should remove observers attached to D-Bus clients before |
| 765 // DBusThreadManager is shut down. | 768 // DBusThreadManager is shut down. |
| 769 chrome_network_watcher_.reset(); |
| 766 extension_system_event_observer_.reset(); | 770 extension_system_event_observer_.reset(); |
| 767 retail_mode_power_save_blocker_.reset(); | 771 retail_mode_power_save_blocker_.reset(); |
| 768 peripheral_battery_observer_.reset(); | 772 peripheral_battery_observer_.reset(); |
| 769 power_prefs_.reset(); | 773 power_prefs_.reset(); |
| 770 | 774 |
| 771 // Let the ScreenLocker unregister itself from SessionManagerClient before | 775 // Let the ScreenLocker unregister itself from SessionManagerClient before |
| 772 // DBusThreadManager is shut down. | 776 // DBusThreadManager is shut down. |
| 773 if (!KioskModeSettings::Get()->IsKioskModeEnabled()) | 777 if (!KioskModeSettings::Get()->IsKioskModeEnabled()) |
| 774 ScreenLocker::ShutDownClass(); | 778 ScreenLocker::ShutDownClass(); |
| 775 | 779 |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 835 // Destroy DBus services immediately after threads are stopped. | 839 // Destroy DBus services immediately after threads are stopped. |
| 836 dbus_services_.reset(); | 840 dbus_services_.reset(); |
| 837 | 841 |
| 838 ChromeBrowserMainPartsLinux::PostDestroyThreads(); | 842 ChromeBrowserMainPartsLinux::PostDestroyThreads(); |
| 839 | 843 |
| 840 // Destroy DeviceSettingsService after g_browser_process. | 844 // Destroy DeviceSettingsService after g_browser_process. |
| 841 DeviceSettingsService::Shutdown(); | 845 DeviceSettingsService::Shutdown(); |
| 842 } | 846 } |
| 843 | 847 |
| 844 } // namespace chromeos | 848 } // namespace chromeos |
| OLD | NEW |