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" |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
66 #include "chrome/browser/chromeos/web_socket_proxy_controller.h" | 66 #include "chrome/browser/chromeos/web_socket_proxy_controller.h" |
67 #include "chrome/browser/chromeos/xinput_hierarchy_changed_event_listener.h" | 67 #include "chrome/browser/chromeos/xinput_hierarchy_changed_event_listener.h" |
68 #include "chrome/browser/defaults.h" | 68 #include "chrome/browser/defaults.h" |
69 #include "chrome/browser/metrics/metrics_service.h" | 69 #include "chrome/browser/metrics/metrics_service.h" |
70 #include "chrome/browser/net/chrome_network_delegate.h" | 70 #include "chrome/browser/net/chrome_network_delegate.h" |
71 #include "chrome/browser/policy/browser_policy_connector.h" | 71 #include "chrome/browser/policy/browser_policy_connector.h" |
72 #include "chrome/browser/prefs/pref_service.h" | 72 #include "chrome/browser/prefs/pref_service.h" |
73 #include "chrome/browser/profiles/profile.h" | 73 #include "chrome/browser/profiles/profile.h" |
74 #include "chrome/browser/profiles/profile_manager.h" | 74 #include "chrome/browser/profiles/profile_manager.h" |
75 #include "chrome/browser/rlz/rlz.h" | 75 #include "chrome/browser/rlz/rlz.h" |
76 #include "chrome/browser/signin/token_service_factory.h" | |
77 #include "chrome/browser/system_monitor/removable_device_notifications_chromeos.
h" | 76 #include "chrome/browser/system_monitor/removable_device_notifications_chromeos.
h" |
78 #include "chrome/common/chrome_notification_types.h" | 77 #include "chrome/common/chrome_notification_types.h" |
79 #include "chrome/common/chrome_switches.h" | 78 #include "chrome/common/chrome_switches.h" |
80 #include "chrome/common/chrome_version_info.h" | 79 #include "chrome/common/chrome_version_info.h" |
81 #include "chrome/common/logging_chrome.h" | 80 #include "chrome/common/logging_chrome.h" |
82 #include "chrome/common/pref_names.h" | 81 #include "chrome/common/pref_names.h" |
83 #include "chromeos/chromeos_switches.h" | 82 #include "chromeos/chromeos_switches.h" |
84 #include "chromeos/cryptohome/async_method_caller.h" | 83 #include "chromeos/cryptohome/async_method_caller.h" |
85 #include "chromeos/dbus/dbus_thread_manager.h" | 84 #include "chromeos/dbus/dbus_thread_manager.h" |
86 #include "chromeos/dbus/power_manager_client.h" | 85 #include "chromeos/dbus/power_manager_client.h" |
(...skipping 459 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
546 #endif | 545 #endif |
547 | 546 |
548 // In Aura builds this will initialize ash::Shell. | 547 // In Aura builds this will initialize ash::Shell. |
549 ChromeBrowserMainPartsLinux::PreProfileInit(); | 548 ChromeBrowserMainPartsLinux::PreProfileInit(); |
550 } | 549 } |
551 | 550 |
552 void ChromeBrowserMainPartsChromeos::PostProfileInit() { | 551 void ChromeBrowserMainPartsChromeos::PostProfileInit() { |
553 // -- This used to be in ChromeBrowserMainParts::PreMainMessageLoopRun() | 552 // -- This used to be in ChromeBrowserMainParts::PreMainMessageLoopRun() |
554 // -- just after CreateProfile(). | 553 // -- just after CreateProfile(). |
555 | 554 |
556 policy::BrowserPolicyConnector* connector = | |
557 g_browser_process->browser_policy_connector(); | |
558 | |
559 if (parsed_command_line().HasSwitch(::switches::kLoginUser) && | 555 if (parsed_command_line().HasSwitch(::switches::kLoginUser) && |
560 !parsed_command_line().HasSwitch(::switches::kLoginPassword)) { | 556 !parsed_command_line().HasSwitch(::switches::kLoginPassword)) { |
561 // Pass the TokenService pointer to the policy connector so user policy can | |
562 // grab a token and register with the policy server. | |
563 // TODO(mnissler): Remove once OAuth is the only authentication mechanism. | |
564 connector->SetUserPolicyTokenService( | |
565 TokenServiceFactory::GetForProfile(profile())); | |
566 | |
567 // Make sure we flip every profile to not share proxies if the user hasn't | 557 // Make sure we flip every profile to not share proxies if the user hasn't |
568 // specified so explicitly. | 558 // specified so explicitly. |
569 const PrefService::Preference* use_shared_proxies_pref = | 559 const PrefService::Preference* use_shared_proxies_pref = |
570 profile()->GetPrefs()->FindPreference(prefs::kUseSharedProxies); | 560 profile()->GetPrefs()->FindPreference(prefs::kUseSharedProxies); |
571 if (use_shared_proxies_pref->IsDefaultValue()) | 561 if (use_shared_proxies_pref->IsDefaultValue()) |
572 profile()->GetPrefs()->SetBoolean(prefs::kUseSharedProxies, false); | 562 profile()->GetPrefs()->SetBoolean(prefs::kUseSharedProxies, false); |
573 | 563 |
574 // This is done in LoginUtils::OnProfileCreated during normal login. | 564 // This is done in LoginUtils::OnProfileCreated during normal login. |
575 LoginUtils::Get()->InitRlzDelayed(profile()); | 565 LoginUtils::Get()->InitRlzDelayed(profile()); |
576 } | 566 } |
577 | 567 |
578 // Make sure the NetworkConfigurationUpdater is ready so that it pushes ONC | 568 // Make sure the NetworkConfigurationUpdater is ready so that it pushes ONC |
579 // configuration before login. | 569 // configuration before login. |
| 570 policy::BrowserPolicyConnector* connector = |
| 571 g_browser_process->browser_policy_connector(); |
580 connector->GetNetworkConfigurationUpdater(); | 572 connector->GetNetworkConfigurationUpdater(); |
581 | 573 |
582 // Make sure that wallpaper boot transition and other delays in OOBE | 574 // Make sure that wallpaper boot transition and other delays in OOBE |
583 // are disabled for tests by default. | 575 // are disabled for tests by default. |
584 // Individual tests may enable them if they want. | 576 // Individual tests may enable them if they want. |
585 if (parsed_command_line().HasSwitch(::switches::kTestType)) | 577 if (parsed_command_line().HasSwitch(::switches::kTestType)) |
586 WizardController::SetZeroDelays(); | 578 WizardController::SetZeroDelays(); |
587 | 579 |
588 // Start loading the machine statistics. Note: if we start loading machine | 580 // Start loading the machine statistics. Note: if we start loading machine |
589 // statistics early in PreEarlyInitialization() then the crossystem tool | 581 // statistics early in PreEarlyInitialization() then the crossystem tool |
(...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
828 trial->AppendGroup("2GB_RAM_3GB_swap", zram_group == '2' ? 1 : 0); | 820 trial->AppendGroup("2GB_RAM_3GB_swap", zram_group == '2' ? 1 : 0); |
829 trial->AppendGroup("4GB_RAM_no_swap", zram_group == '3' ? 1 : 0); | 821 trial->AppendGroup("4GB_RAM_no_swap", zram_group == '3' ? 1 : 0); |
830 trial->AppendGroup("4GB_RAM_4GB_swap", zram_group == '4' ? 1 : 0); | 822 trial->AppendGroup("4GB_RAM_4GB_swap", zram_group == '4' ? 1 : 0); |
831 trial->AppendGroup("4GB_RAM_6GB_swap", zram_group == '5' ? 1 : 0); | 823 trial->AppendGroup("4GB_RAM_6GB_swap", zram_group == '5' ? 1 : 0); |
832 trial->AppendGroup("snow_no_swap", zram_group == '6' ? 1 : 0); | 824 trial->AppendGroup("snow_no_swap", zram_group == '6' ? 1 : 0); |
833 trial->AppendGroup("snow_1GB_swap", zram_group == '7' ? 1 : 0); | 825 trial->AppendGroup("snow_1GB_swap", zram_group == '7' ? 1 : 0); |
834 trial->AppendGroup("snow_2GB_swap", zram_group == '8' ? 1 : 0); | 826 trial->AppendGroup("snow_2GB_swap", zram_group == '8' ? 1 : 0); |
835 } | 827 } |
836 | 828 |
837 } // namespace chromeos | 829 } // namespace chromeos |
OLD | NEW |