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

Side by Side Diff: chromeos/dbus/ibus/ibus_panel_service.cc

Issue 20555003: Allow Chromium's DBus service ownership to be stealable (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Addressed nits Created 7 years, 4 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/browser/chromeos/dbus/cros_dbus_service.cc ('k') | dbus/bus.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/ibus/ibus_panel_service.h" 5 #include "chromeos/dbus/ibus/ibus_panel_service.h"
6 6
7 #include <string> 7 #include <string>
8 #include "base/bind.h" 8 #include "base/bind.h"
9 #include "base/callback.h" 9 #include "base/callback.h"
10 #include "chromeos/dbus/ibus/ibus_constants.h" 10 #include "chromeos/dbus/ibus/ibus_constants.h"
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
117 ibus::panel::kServiceInterface, 117 ibus::panel::kServiceInterface,
118 ibus::panel::kStateChangedMethod, 118 ibus::panel::kStateChangedMethod,
119 base::Bind(&IBusPanelServiceImpl::NoOperation, 119 base::Bind(&IBusPanelServiceImpl::NoOperation,
120 weak_ptr_factory_.GetWeakPtr()), 120 weak_ptr_factory_.GetWeakPtr()),
121 base::Bind(&IBusPanelServiceImpl::OnMethodExported, 121 base::Bind(&IBusPanelServiceImpl::OnMethodExported,
122 weak_ptr_factory_.GetWeakPtr())); 122 weak_ptr_factory_.GetWeakPtr()));
123 123
124 // Request well known name to ibus-daemon. 124 // Request well known name to ibus-daemon.
125 bus->RequestOwnership( 125 bus->RequestOwnership(
126 ibus::panel::kServiceName, 126 ibus::panel::kServiceName,
127 dbus::Bus::REQUIRE_PRIMARY,
127 base::Bind(&IBusPanelServiceImpl::OnRequestOwnership, 128 base::Bind(&IBusPanelServiceImpl::OnRequestOwnership,
128 weak_ptr_factory_.GetWeakPtr())); 129 weak_ptr_factory_.GetWeakPtr()));
129 130
130 input_context->SetSetCursorLocationHandler( 131 input_context->SetSetCursorLocationHandler(
131 base::Bind(&IBusPanelServiceImpl::SetCursorLocation, 132 base::Bind(&IBusPanelServiceImpl::SetCursorLocation,
132 weak_ptr_factory_.GetWeakPtr())); 133 weak_ptr_factory_.GetWeakPtr()));
133 } 134 }
134 135
135 virtual ~IBusPanelServiceImpl() { 136 virtual ~IBusPanelServiceImpl() {
136 bus_->UnregisterExportedObject( 137 bus_->UnregisterExportedObject(
(...skipping 310 matching lines...) Expand 10 before | Expand all | Expand 10 after
447 dbus::Bus* bus, 448 dbus::Bus* bus,
448 IBusInputContextClient* input_context) { 449 IBusInputContextClient* input_context) {
449 if (type == REAL_DBUS_CLIENT_IMPLEMENTATION) { 450 if (type == REAL_DBUS_CLIENT_IMPLEMENTATION) {
450 return new IBusPanelServiceImpl(bus, input_context); 451 return new IBusPanelServiceImpl(bus, input_context);
451 } else { 452 } else {
452 return new IBusPanelServiceDaemonlessImpl(); 453 return new IBusPanelServiceDaemonlessImpl();
453 } 454 }
454 } 455 }
455 456
456 } // namespace chromeos 457 } // namespace chromeos
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/dbus/cros_dbus_service.cc ('k') | dbus/bus.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698