| 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 "chromeos/dbus/dbus_thread_manager.h" | 5 #include "chromeos/dbus/dbus_thread_manager.h" |
| 6 | 6 |
| 7 #include <map> | 7 #include <map> |
| 8 | 8 |
| 9 #include "base/chromeos/chromeos_version.h" | 9 #include "base/chromeos/chromeos_version.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 174 // DBusThreadManager override. | 174 // DBusThreadManager override. |
| 175 virtual void RemoveObserver(DBusThreadManagerObserver* observer) OVERRIDE { | 175 virtual void RemoveObserver(DBusThreadManagerObserver* observer) OVERRIDE { |
| 176 DCHECK(observer); | 176 DCHECK(observer); |
| 177 observers_.RemoveObserver(observer); | 177 observers_.RemoveObserver(observer); |
| 178 } | 178 } |
| 179 | 179 |
| 180 // DBusThreadManager override. | 180 // DBusThreadManager override. |
| 181 virtual void InitIBusBus( | 181 virtual void InitIBusBus( |
| 182 const std::string &ibus_address, | 182 const std::string &ibus_address, |
| 183 const base::Closure& on_disconnected_callback) OVERRIDE { | 183 const base::Closure& on_disconnected_callback) OVERRIDE { |
| 184 DCHECK(!ibus_bus_); | 184 DCHECK(!ibus_bus_.get()); |
| 185 dbus::Bus::Options ibus_bus_options; | 185 dbus::Bus::Options ibus_bus_options; |
| 186 ibus_bus_options.bus_type = dbus::Bus::CUSTOM_ADDRESS; | 186 ibus_bus_options.bus_type = dbus::Bus::CUSTOM_ADDRESS; |
| 187 ibus_bus_options.address = ibus_address; | 187 ibus_bus_options.address = ibus_address; |
| 188 ibus_bus_options.connection_type = dbus::Bus::PRIVATE; | 188 ibus_bus_options.connection_type = dbus::Bus::PRIVATE; |
| 189 ibus_bus_options.dbus_task_runner = dbus_thread_->message_loop_proxy(); | 189 ibus_bus_options.dbus_task_runner = dbus_thread_->message_loop_proxy(); |
| 190 ibus_bus_options.disconnected_callback = on_disconnected_callback; | 190 ibus_bus_options.disconnected_callback = on_disconnected_callback; |
| 191 ibus_bus_ = new dbus::Bus(ibus_bus_options); | 191 ibus_bus_ = new dbus::Bus(ibus_bus_options); |
| 192 ibus_address_ = ibus_address; | 192 ibus_address_ = ibus_address; |
| 193 VLOG(1) << "Connected to ibus-daemon: " << ibus_address; | 193 VLOG(1) << "Connected to ibus-daemon: " << ibus_address; |
| 194 | 194 |
| (...skipping 301 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 496 } | 496 } |
| 497 | 497 |
| 498 // static | 498 // static |
| 499 DBusThreadManager* DBusThreadManager::Get() { | 499 DBusThreadManager* DBusThreadManager::Get() { |
| 500 CHECK(g_dbus_thread_manager) | 500 CHECK(g_dbus_thread_manager) |
| 501 << "DBusThreadManager::Get() called before Initialize()"; | 501 << "DBusThreadManager::Get() called before Initialize()"; |
| 502 return g_dbus_thread_manager; | 502 return g_dbus_thread_manager; |
| 503 } | 503 } |
| 504 | 504 |
| 505 } // namespace chromeos | 505 } // namespace chromeos |
| OLD | NEW |