| 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 410 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 421 system::StatisticsProvider::GetInstance()->StartLoadingMachineStatistics( | 421 system::StatisticsProvider::GetInstance()->StartLoadingMachineStatistics( |
| 422 content::BrowserThread::GetMessageLoopProxyForThread( | 422 content::BrowserThread::GetMessageLoopProxyForThread( |
| 423 content::BrowserThread::FILE), | 423 content::BrowserThread::FILE), |
| 424 load_oem_statistics); | 424 load_oem_statistics); |
| 425 | 425 |
| 426 base::FilePath downloads_directory; | 426 base::FilePath downloads_directory; |
| 427 CHECK(PathService::Get(chrome::DIR_DEFAULT_DOWNLOADS, &downloads_directory)); | 427 CHECK(PathService::Get(chrome::DIR_DEFAULT_DOWNLOADS, &downloads_directory)); |
| 428 imageburner::BurnManager::Initialize( | 428 imageburner::BurnManager::Initialize( |
| 429 downloads_directory, g_browser_process->system_request_context()); | 429 downloads_directory, g_browser_process->system_request_context()); |
| 430 | 430 |
| 431 #if defined(USE_X11) | |
| 432 // Listen for system key events so that the user will be able to adjust the | |
| 433 // volume on the login screen, if Chrome is running on Chrome OS | |
| 434 // (i.e. not Linux desktop), and in non-test mode. | |
| 435 // Note: SystemKeyEventListener depends on the DBus thread. | |
| 436 if (base::SysInfo::IsRunningOnChromeOS() && | |
| 437 !parameters().ui_task) { // ui_task is non-NULL when running tests. | |
| 438 SystemKeyEventListener::Initialize(); | |
| 439 } | |
| 440 #endif | |
| 441 | |
| 442 DeviceOAuth2TokenServiceFactory::Initialize(); | 431 DeviceOAuth2TokenServiceFactory::Initialize(); |
| 443 | 432 |
| 444 ChromeBrowserMainPartsLinux::PreMainMessageLoopRun(); | 433 ChromeBrowserMainPartsLinux::PreMainMessageLoopRun(); |
| 445 } | 434 } |
| 446 | 435 |
| 447 void ChromeBrowserMainPartsChromeos::PreProfileInit() { | 436 void ChromeBrowserMainPartsChromeos::PreProfileInit() { |
| 448 // -- This used to be in ChromeBrowserMainParts::PreMainMessageLoopRun() | 437 // -- This used to be in ChromeBrowserMainParts::PreMainMessageLoopRun() |
| 449 // -- immediately before Profile creation(). | 438 // -- immediately before Profile creation(). |
| 450 | 439 |
| 451 // Now that the file thread exists we can record our stats. | 440 // Now that the file thread exists we can record our stats. |
| (...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 690 ChromeBrowserMainPartsLinux::PostProfileInit(); | 679 ChromeBrowserMainPartsLinux::PostProfileInit(); |
| 691 } | 680 } |
| 692 | 681 |
| 693 void ChromeBrowserMainPartsChromeos::PreBrowserStart() { | 682 void ChromeBrowserMainPartsChromeos::PreBrowserStart() { |
| 694 // -- This used to be in ChromeBrowserMainParts::PreMainMessageLoopRun() | 683 // -- This used to be in ChromeBrowserMainParts::PreMainMessageLoopRun() |
| 695 // -- just before MetricsService::LogNeedForCleanShutdown(). | 684 // -- just before MetricsService::LogNeedForCleanShutdown(). |
| 696 | 685 |
| 697 g_browser_process->metrics_service()->StartExternalMetrics(); | 686 g_browser_process->metrics_service()->StartExternalMetrics(); |
| 698 | 687 |
| 699 #if defined(USE_X11) | 688 #if defined(USE_X11) |
| 689 // Listen for system key events so that the user will be able to adjust the |
| 690 // volume on the login screen, if Chrome is running on Chrome OS |
| 691 // (i.e. not Linux desktop), and in non-test mode. |
| 692 // Note: SystemKeyEventListener depends on the DBus thread. |
| 693 if (base::SysInfo::IsRunningOnChromeOS() && |
| 694 !parameters().ui_task) { // ui_task is non-NULL when running tests. |
| 695 SystemKeyEventListener::Initialize(); |
| 696 } |
| 697 |
| 700 // Listen for XI_HierarchyChanged events. Note: if this is moved to | 698 // Listen for XI_HierarchyChanged events. Note: if this is moved to |
| 701 // PreMainMessageLoopRun() then desktopui_PageCyclerTests fail for unknown | 699 // PreMainMessageLoopRun() then desktopui_PageCyclerTests fail for unknown |
| 702 // reasons, see http://crosbug.com/24833. | 700 // reasons, see http://crosbug.com/24833. |
| 703 XInputHierarchyChangedEventListener::GetInstance(); | 701 XInputHierarchyChangedEventListener::GetInstance(); |
| 704 | 702 |
| 705 // Start the CrOS input device UMA watcher | 703 // Start the CrOS input device UMA watcher |
| 706 DeviceUMA::GetInstance(); | 704 DeviceUMA::GetInstance(); |
| 707 | 705 |
| 708 event_rewriter_.reset(new EventRewriter()); | 706 event_rewriter_.reset(new EventRewriter()); |
| 709 #endif | 707 #endif |
| (...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 837 // Destroy DBus services immediately after threads are stopped. | 835 // Destroy DBus services immediately after threads are stopped. |
| 838 dbus_services_.reset(); | 836 dbus_services_.reset(); |
| 839 | 837 |
| 840 ChromeBrowserMainPartsLinux::PostDestroyThreads(); | 838 ChromeBrowserMainPartsLinux::PostDestroyThreads(); |
| 841 | 839 |
| 842 // Destroy DeviceSettingsService after g_browser_process. | 840 // Destroy DeviceSettingsService after g_browser_process. |
| 843 DeviceSettingsService::Shutdown(); | 841 DeviceSettingsService::Shutdown(); |
| 844 } | 842 } |
| 845 | 843 |
| 846 } // namespace chromeos | 844 } // namespace chromeos |
| OLD | NEW |