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

Unified Diff: extensions/shell/browser/shell_browser_main_parts.cc

Issue 2819593003: Initialize BlueZ in app_shell on Linux (Closed)
Patch Set: rebase Created 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « extensions/shell/BUILD.gn ('k') | extensions/test/data/api_test/bluetooth/manifest.json » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: extensions/shell/browser/shell_browser_main_parts.cc
diff --git a/extensions/shell/browser/shell_browser_main_parts.cc b/extensions/shell/browser/shell_browser_main_parts.cc
index dd953675168502a4501e000adde18d8d7af7600c..c3ee90637c15f6207e3a4d8453c2c2c0a20fbcbd 100644
--- a/extensions/shell/browser/shell_browser_main_parts.cc
+++ b/extensions/shell/browser/shell_browser_main_parts.cc
@@ -47,15 +47,23 @@
#if defined(OS_CHROMEOS)
#include "chromeos/audio/audio_devices_pref_handler_impl.h"
#include "chromeos/audio/cras_audio_handler.h"
-#include "chromeos/dbus/dbus_thread_manager.h"
#include "chromeos/disks/disk_mount_manager.h"
#include "chromeos/network/network_handler.h"
-#include "device/bluetooth/bluetooth_adapter_factory.h"
-#include "device/bluetooth/dbus/bluez_dbus_manager.h"
#include "extensions/shell/browser/shell_audio_controller_chromeos.h"
#include "extensions/shell/browser/shell_network_controller_chromeos.h"
#endif
+#if defined(OS_CHROMEOS) || defined(OS_LINUX)
+#include "device/bluetooth/bluetooth_adapter_factory.h"
+#include "device/bluetooth/dbus/bluez_dbus_manager.h"
+#endif
+
+#if defined(OS_CHROMEOS)
+#include "chromeos/dbus/dbus_thread_manager.h"
+#elif defined(OS_LINUX)
+#include "device/bluetooth/dbus/dbus_thread_manager_linux.h"
+#endif
+
#if defined(OS_MACOSX)
#include "extensions/shell/browser/shell_browser_main_parts_mac.h"
#endif
@@ -122,8 +130,17 @@ void ShellBrowserMainParts::PostMainMessageLoopStart() {
switches::kAppShellAllowRoaming)) {
network_controller_->SetCellularAllowRoaming(true);
}
+#elif defined(OS_LINUX)
+ // app_shell doesn't need GTK, so the fake input method context can work.
+ // See crbug.com/381852 and revision fb69f142.
+ // TODO(michaelpg): Verify this works for target environments.
+ ui::InitializeInputMethodForTesting();
+
+ bluez::DBusThreadManagerLinux::Initialize();
+ bluez::BluezDBusManager::Initialize(
+ bluez::DBusThreadManagerLinux::Get()->GetSystemBus(),
+ /*use_dbus_fakes=*/false);
#else
- // Non-Chrome OS platforms are for developer convenience, so use a test IME.
ui::InitializeInputMethodForTesting();
#endif
}
@@ -278,6 +295,10 @@ void ShellBrowserMainParts::PostDestroyThreads() {
device::BluetoothAdapterFactory::Shutdown();
bluez::BluezDBusManager::Shutdown();
chromeos::DBusThreadManager::Shutdown();
+#elif defined(OS_LINUX)
+ device::BluetoothAdapterFactory::Shutdown();
+ bluez::BluezDBusManager::Shutdown();
+ bluez::DBusThreadManagerLinux::Shutdown();
#endif
}
« no previous file with comments | « extensions/shell/BUILD.gn ('k') | extensions/test/data/api_test/bluetooth/manifest.json » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698