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

Unified Diff: ash/mus/window_manager_application.cc

Issue 2297193007: mash: Provide a fake chromeos StatisticsProvider in ash (Closed)
Patch Set: build file Created 4 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ash/mus/window_manager_application.h ('k') | chromeos/BUILD.gn » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/mus/window_manager_application.cc
diff --git a/ash/mus/window_manager_application.cc b/ash/mus/window_manager_application.cc
index b10fcac1496441d66f4c8d0beadf83d1374a39ba..6f3faa11ddd3b38a249430e7b210084902c0ed01 100644
--- a/ash/mus/window_manager_application.cc
+++ b/ash/mus/window_manager_application.cc
@@ -31,6 +31,7 @@
#include "ash/common/system/chromeos/power/power_status.h"
#include "chromeos/audio/cras_audio_handler.h"
#include "chromeos/dbus/dbus_thread_manager.h"
+#include "chromeos/system/fake_statistics_provider.h"
#include "device/bluetooth/dbus/bluez_dbus_manager.h" // nogncheck
#endif
@@ -44,6 +45,8 @@ void InitializeComponents() {
// Must occur after mojo::ApplicationRunner has initialized AtExitManager, but
// before WindowManager::Init().
chromeos::DBusThreadManager::Initialize();
+
+ // See ChromeBrowserMainPartsChromeos for ordering details.
bluez::BluezDBusManager::Initialize(
chromeos::DBusThreadManager::Get()->GetSystemBus(),
chromeos::DBusThreadManager::Get()->IsUsingStub(
@@ -81,6 +84,9 @@ WindowManagerApplication::~WindowManagerApplication() {
// OnWillDestroyRootWindowController() is called (if it hasn't been already).
window_manager_.reset();
gpu_service_.reset();
+#if defined(OS_CHROMEOS)
+ statistics_provider_.reset();
+#endif
ShutdownComponents();
}
@@ -92,7 +98,15 @@ void WindowManagerApplication::OnAcceleratorRegistrarDestroyed(
void WindowManagerApplication::InitWindowManager(
ui::WindowTreeClient* window_tree_client) {
InitializeComponents();
-
+#if defined(OS_CHROMEOS)
+ // TODO(jamescook): Refactor StatisticsProvider so we can get just the data
+ // we need in ash. Right now StatisticsProviderImpl launches the crossystem
+ // binary to get system data, which we don't want to do twice on startup.
+ statistics_provider_.reset(
+ new chromeos::system::ScopedFakeStatisticsProvider());
+ statistics_provider_->SetMachineStatistic("initial_locale", "en-US");
+ statistics_provider_->SetMachineStatistic("keyboard_layout", "");
+#endif
window_manager_->Init(window_tree_client);
}
« no previous file with comments | « ash/mus/window_manager_application.h ('k') | chromeos/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698