| 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 352 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 363 if (!parsed_command_line().HasSwitch(::switches::kLoginProfile)) { | 363 if (!parsed_command_line().HasSwitch(::switches::kLoginProfile)) { |
| 364 // This must be kept in sync with TestingProfile::kTestUserProfileDir. | 364 // This must be kept in sync with TestingProfile::kTestUserProfileDir. |
| 365 singleton_command_line->AppendSwitchASCII( | 365 singleton_command_line->AppendSwitchASCII( |
| 366 ::switches::kLoginProfile, "test-user"); | 366 ::switches::kLoginProfile, "test-user"); |
| 367 } | 367 } |
| 368 LOG(INFO) << "Running as stub user with profile dir: " | 368 LOG(INFO) << "Running as stub user with profile dir: " |
| 369 << singleton_command_line->GetSwitchValuePath( | 369 << singleton_command_line->GetSwitchValuePath( |
| 370 ::switches::kLoginProfile).value(); | 370 ::switches::kLoginProfile).value(); |
| 371 } | 371 } |
| 372 | 372 |
| 373 // Initialize the statistics provider, which will ensure that the Chrome |
| 374 // channel info is read and made available early. |
| 375 system::StatisticsProvider::GetInstance()->Init(); |
| 376 |
| 373 ChromeBrowserMainPartsLinux::PreEarlyInitialization(); | 377 ChromeBrowserMainPartsLinux::PreEarlyInitialization(); |
| 374 } | 378 } |
| 375 | 379 |
| 376 void ChromeBrowserMainPartsChromeos::PreMainMessageLoopStart() { | 380 void ChromeBrowserMainPartsChromeos::PreMainMessageLoopStart() { |
| 377 // Replace the default NetworkChangeNotifierFactory with ChromeOS specific | 381 // Replace the default NetworkChangeNotifierFactory with ChromeOS specific |
| 378 // implementation. This must be done before BrowserMainLoop calls | 382 // implementation. This must be done before BrowserMainLoop calls |
| 379 // net::NetworkChangeNotifier::Create() in MainMessageLoopStart(). | 383 // net::NetworkChangeNotifier::Create() in MainMessageLoopStart(). |
| 380 net::NetworkChangeNotifier::SetFactory( | 384 net::NetworkChangeNotifier::SetFactory( |
| 381 new CrosNetworkChangeNotifierFactory()); | 385 new CrosNetworkChangeNotifierFactory()); |
| 382 | 386 |
| (...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 589 | 593 |
| 590 // Start the out-of-memory priority manager here so that we give the most | 594 // Start the out-of-memory priority manager here so that we give the most |
| 591 // amount of time for the other services to start up before we start | 595 // amount of time for the other services to start up before we start |
| 592 // adjusting the oom priority. | 596 // adjusting the oom priority. |
| 593 g_browser_process->oom_priority_manager()->Start(); | 597 g_browser_process->oom_priority_manager()->Start(); |
| 594 | 598 |
| 595 ChromeBrowserMainPartsLinux::PreBrowserStart(); | 599 ChromeBrowserMainPartsLinux::PreBrowserStart(); |
| 596 } | 600 } |
| 597 | 601 |
| 598 void ChromeBrowserMainPartsChromeos::PostBrowserStart() { | 602 void ChromeBrowserMainPartsChromeos::PostBrowserStart() { |
| 599 // FILE thread is created in ChromeBrowserMainParts::PreMainMessageLoopRun(). | |
| 600 | |
| 601 // Get the statistics provider instance here to start loading statistcs | |
| 602 // on the background FILE thread. | |
| 603 system::StatisticsProvider::GetInstance(); | |
| 604 | |
| 605 // These are dependent on the ash::Shell singleton already having been | 603 // These are dependent on the ash::Shell singleton already having been |
| 606 // initialized. | 604 // initialized. |
| 607 power_button_observer_.reset(new PowerButtonObserver); | 605 power_button_observer_.reset(new PowerButtonObserver); |
| 608 user_activity_notifier_.reset(new UserActivityNotifier); | 606 user_activity_notifier_.reset(new UserActivityNotifier); |
| 609 video_activity_notifier_.reset(new VideoActivityNotifier); | 607 video_activity_notifier_.reset(new VideoActivityNotifier); |
| 610 screen_dimming_observer_.reset(new ScreenDimmingObserver); | 608 screen_dimming_observer_.reset(new ScreenDimmingObserver); |
| 611 | 609 |
| 612 ChromeBrowserMainPartsLinux::PostBrowserStart(); | 610 ChromeBrowserMainPartsLinux::PostBrowserStart(); |
| 613 } | 611 } |
| 614 | 612 |
| (...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 729 } else if (trial->group() == margin_200mb) { | 727 } else if (trial->group() == margin_200mb) { |
| 730 LOG(WARNING) << "low_mem: Part of '200MB' experiment"; | 728 LOG(WARNING) << "low_mem: Part of '200MB' experiment"; |
| 731 LowMemoryObserver::SetLowMemoryMargin(200); | 729 LowMemoryObserver::SetLowMemoryMargin(200); |
| 732 } else { | 730 } else { |
| 733 LOG(WARNING) << "low_mem: Part of 'default' experiment"; | 731 LOG(WARNING) << "low_mem: Part of 'default' experiment"; |
| 734 } | 732 } |
| 735 } | 733 } |
| 736 } | 734 } |
| 737 | 735 |
| 738 } // namespace chromeos | 736 } // namespace chromeos |
| OLD | NEW |