Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(396)

Side by Side Diff: chrome/browser/chromeos/chrome_browser_main_chromeos.cc

Issue 15702004: Open Ash shell after creating Profile (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Unregister pref change notifier in ash::SystemTrayDelegate Created 7 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | chrome/browser/chromeos/system/ash_system_tray_delegate.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
79 #include "chrome/browser/chromeos/web_socket_proxy_controller.h" 79 #include "chrome/browser/chromeos/web_socket_proxy_controller.h"
80 #include "chrome/browser/chromeos/xinput_hierarchy_changed_event_listener.h" 80 #include "chrome/browser/chromeos/xinput_hierarchy_changed_event_listener.h"
81 #include "chrome/browser/defaults.h" 81 #include "chrome/browser/defaults.h"
82 #include "chrome/browser/metrics/metrics_service.h" 82 #include "chrome/browser/metrics/metrics_service.h"
83 #include "chrome/browser/net/chrome_network_delegate.h" 83 #include "chrome/browser/net/chrome_network_delegate.h"
84 #include "chrome/browser/policy/browser_policy_connector.h" 84 #include "chrome/browser/policy/browser_policy_connector.h"
85 #include "chrome/browser/profiles/profile.h" 85 #include "chrome/browser/profiles/profile.h"
86 #include "chrome/browser/profiles/profile_manager.h" 86 #include "chrome/browser/profiles/profile_manager.h"
87 #include "chrome/browser/rlz/rlz.h" 87 #include "chrome/browser/rlz/rlz.h"
88 #include "chrome/browser/storage_monitor/storage_monitor_chromeos.h" 88 #include "chrome/browser/storage_monitor/storage_monitor_chromeos.h"
89 #include "chrome/browser/ui/ash/ash_init.h"
89 #include "chrome/common/chrome_notification_types.h" 90 #include "chrome/common/chrome_notification_types.h"
90 #include "chrome/common/chrome_paths.h" 91 #include "chrome/common/chrome_paths.h"
91 #include "chrome/common/chrome_switches.h" 92 #include "chrome/common/chrome_switches.h"
92 #include "chrome/common/chrome_version_info.h" 93 #include "chrome/common/chrome_version_info.h"
93 #include "chrome/common/logging_chrome.h" 94 #include "chrome/common/logging_chrome.h"
94 #include "chrome/common/pref_names.h" 95 #include "chrome/common/pref_names.h"
95 #include "chromeos/audio/audio_devices_pref_handler.h" 96 #include "chromeos/audio/audio_devices_pref_handler.h"
96 #include "chromeos/audio/audio_pref_handler.h" 97 #include "chromeos/audio/audio_pref_handler.h"
97 #include "chromeos/audio/cras_audio_handler.h" 98 #include "chromeos/audio/cras_audio_handler.h"
98 #include "chromeos/chromeos_paths.h" 99 #include "chromeos/chromeos_paths.h"
(...skipping 534 matching lines...) Expand 10 before | Expand all | Expand 10 after
633 } 634 }
634 635
635 // In Aura builds this will initialize ash::Shell. 636 // In Aura builds this will initialize ash::Shell.
636 ChromeBrowserMainPartsLinux::PreProfileInit(); 637 ChromeBrowserMainPartsLinux::PreProfileInit();
637 } 638 }
638 639
639 void ChromeBrowserMainPartsChromeos::PostProfileInit() { 640 void ChromeBrowserMainPartsChromeos::PostProfileInit() {
640 // -- This used to be in ChromeBrowserMainParts::PreMainMessageLoopRun() 641 // -- This used to be in ChromeBrowserMainParts::PreMainMessageLoopRun()
641 // -- just after CreateProfile(). 642 // -- just after CreateProfile().
642 643
644 // Initialize the Ash Shell after the Default Profile has been created and
645 // before ash dependent systems are initialized.
646 chrome::OpenAsh();
647
643 // Restarting Chrome inside existing user session. Possible cases: 648 // Restarting Chrome inside existing user session. Possible cases:
644 // 1. Chrome is restarted after crash. 649 // 1. Chrome is restarted after crash.
645 // 2. Chrome is started in browser_tests skipping the login flow 650 // 2. Chrome is started in browser_tests skipping the login flow
646 // 3. Chrome is started on dev machine 651 // 3. Chrome is started on dev machine
647 // i.e. not on Chrome OS device w/o login flow. 652 // i.e. not on Chrome OS device w/o login flow.
648 if (parsed_command_line().HasSwitch(switches::kLoginUser) && 653 if (parsed_command_line().HasSwitch(switches::kLoginUser) &&
649 !parsed_command_line().HasSwitch(switches::kLoginPassword)) { 654 !parsed_command_line().HasSwitch(switches::kLoginPassword)) {
650 // Make sure we flip every profile to not share proxies if the user hasn't 655 // Make sure we flip every profile to not share proxies if the user hasn't
651 // specified so explicitly. 656 // specified so explicitly.
652 const PrefService::Preference* use_shared_proxies_pref = 657 const PrefService::Preference* use_shared_proxies_pref =
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after
858 UserManager::Get()->Shutdown(); 863 UserManager::Get()->Shutdown();
859 WallpaperManager::Get()->Shutdown(); 864 WallpaperManager::Get()->Shutdown();
860 865
861 // Let the AutomaticRebootManager unregister itself as an observer of several 866 // Let the AutomaticRebootManager unregister itself as an observer of several
862 // subsystems. 867 // subsystems.
863 automatic_reboot_manager_.reset(); 868 automatic_reboot_manager_.reset();
864 869
865 // Clean up dependency on CrosSettings and stop pending data fetches. 870 // Clean up dependency on CrosSettings and stop pending data fetches.
866 KioskAppManager::Shutdown(); 871 KioskAppManager::Shutdown();
867 872
868 ChromeBrowserMainPartsLinux::PostMainMessageLoopRun(); 873 chrome::CloseAsh();
869 874
870 // Destroy the UserManager after ash has been destroyed. 875 // Destroy the UserManager after ash has been destroyed.
871 UserManager::Destroy(); 876 UserManager::Destroy();
877
878 ChromeBrowserMainPartsLinux::PostMainMessageLoopRun();
872 } 879 }
873 880
874 void ChromeBrowserMainPartsChromeos::PostDestroyThreads() { 881 void ChromeBrowserMainPartsChromeos::PostDestroyThreads() {
875 ChromeBrowserMainPartsLinux::PostDestroyThreads(); 882 ChromeBrowserMainPartsLinux::PostDestroyThreads();
876 // Destroy DeviceSettingsService after g_browser_process. 883 // Destroy DeviceSettingsService after g_browser_process.
877 DeviceSettingsService::Shutdown(); 884 DeviceSettingsService::Shutdown();
878 } 885 }
879 886
880 void ChromeBrowserMainPartsChromeos::SetupPlatformFieldTrials() { 887 void ChromeBrowserMainPartsChromeos::SetupPlatformFieldTrials() {
881 SetupZramFieldTrial(); 888 SetupZramFieldTrial();
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
920 trial->AppendGroup("4GB_RAM_4GB_swap", zram_group == '4' ? 1 : 0); 927 trial->AppendGroup("4GB_RAM_4GB_swap", zram_group == '4' ? 1 : 0);
921 trial->AppendGroup("4GB_RAM_6GB_swap", zram_group == '5' ? 1 : 0); 928 trial->AppendGroup("4GB_RAM_6GB_swap", zram_group == '5' ? 1 : 0);
922 trial->AppendGroup("snow_no_swap", zram_group == '6' ? 1 : 0); 929 trial->AppendGroup("snow_no_swap", zram_group == '6' ? 1 : 0);
923 trial->AppendGroup("snow_1GB_swap", zram_group == '7' ? 1 : 0); 930 trial->AppendGroup("snow_1GB_swap", zram_group == '7' ? 1 : 0);
924 trial->AppendGroup("snow_2GB_swap", zram_group == '8' ? 1 : 0); 931 trial->AppendGroup("snow_2GB_swap", zram_group == '8' ? 1 : 0);
925 // This is necessary to start the experiment as a side effect. 932 // This is necessary to start the experiment as a side effect.
926 trial->group(); 933 trial->group();
927 } 934 }
928 935
929 } // namespace chromeos 936 } // namespace chromeos
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/chromeos/system/ash_system_tray_delegate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698