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

Side by Side Diff: chromeos/dbus/session_manager_client.cc

Issue 2165643004: arc: add enterprise_reporting.mojom interface. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed SessionManagerClient stub RemoveArcData method. Created 4 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
« no previous file with comments | « chromeos/dbus/session_manager_client.h ('k') | components/arc.gypi » ('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/session_manager_client.h" 5 #include "chromeos/dbus/session_manager_client.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 #include <sys/socket.h> 9 #include <sys/socket.h>
10 10
(...skipping 362 matching lines...) Expand 10 before | Expand all | Expand 10 after
373 dbus::MethodCall method_call( 373 dbus::MethodCall method_call(
374 login_manager::kSessionManagerInterface, 374 login_manager::kSessionManagerInterface,
375 login_manager::kSessionManagerGetArcStartTimeTicks); 375 login_manager::kSessionManagerGetArcStartTimeTicks);
376 376
377 session_manager_proxy_->CallMethod( 377 session_manager_proxy_->CallMethod(
378 &method_call, dbus::ObjectProxy::TIMEOUT_USE_DEFAULT, 378 &method_call, dbus::ObjectProxy::TIMEOUT_USE_DEFAULT,
379 base::Bind(&SessionManagerClientImpl::OnGetArcStartTime, 379 base::Bind(&SessionManagerClientImpl::OnGetArcStartTime,
380 weak_ptr_factory_.GetWeakPtr(), callback)); 380 weak_ptr_factory_.GetWeakPtr(), callback));
381 } 381 }
382 382
383 void RemoveArcData(const cryptohome::Identification& cryptohome_id) override { 383 void RemoveArcData(const cryptohome::Identification& cryptohome_id,
384 const ArcCallback& callback) override {
384 dbus::MethodCall method_call(login_manager::kSessionManagerInterface, 385 dbus::MethodCall method_call(login_manager::kSessionManagerInterface,
385 login_manager::kSessionManagerRemoveArcData); 386 login_manager::kSessionManagerRemoveArcData);
386 dbus::MessageWriter writer(&method_call); 387 dbus::MessageWriter writer(&method_call);
387 writer.AppendString(cryptohome_id.id()); 388 writer.AppendString(cryptohome_id.id());
388 session_manager_proxy_->CallMethod( 389 session_manager_proxy_->CallMethod(
389 &method_call, dbus::ObjectProxy::TIMEOUT_USE_DEFAULT, 390 &method_call, dbus::ObjectProxy::TIMEOUT_USE_DEFAULT,
390 base::Bind(&SessionManagerClientImpl::OnArcMethod, 391 base::Bind(&SessionManagerClientImpl::OnArcMethod,
391 weak_ptr_factory_.GetWeakPtr(), 392 weak_ptr_factory_.GetWeakPtr(),
392 login_manager::kSessionManagerRemoveArcData, ArcCallback())); 393 login_manager::kSessionManagerRemoveArcData, callback));
393 } 394 }
394 395
395 protected: 396 protected:
396 void Init(dbus::Bus* bus) override { 397 void Init(dbus::Bus* bus) override {
397 session_manager_proxy_ = bus->GetObjectProxy( 398 session_manager_proxy_ = bus->GetObjectProxy(
398 login_manager::kSessionManagerServiceName, 399 login_manager::kSessionManagerServiceName,
399 dbus::ObjectPath(login_manager::kSessionManagerServicePath)); 400 dbus::ObjectPath(login_manager::kSessionManagerServicePath));
400 blocking_method_caller_.reset( 401 blocking_method_caller_.reset(
401 new BlockingMethodCaller(bus, session_manager_proxy_)); 402 new BlockingMethodCaller(bus, session_manager_proxy_));
402 403
(...skipping 537 matching lines...) Expand 10 before | Expand all | Expand 10 after
940 } 941 }
941 942
942 void StopArcInstance(const ArcCallback& callback) override { 943 void StopArcInstance(const ArcCallback& callback) override {
943 callback.Run(false); 944 callback.Run(false);
944 } 945 }
945 946
946 void GetArcStartTime(const GetArcStartTimeCallback& callback) override { 947 void GetArcStartTime(const GetArcStartTimeCallback& callback) override {
947 callback.Run(false, base::TimeTicks::Now()); 948 callback.Run(false, base::TimeTicks::Now());
948 } 949 }
949 950
950 void RemoveArcData(const cryptohome::Identification& cryptohome_id) override { 951 void RemoveArcData(const cryptohome::Identification& cryptohome_id,
952 const ArcCallback& callback) override {
953 if (!callback.is_null())
954 callback.Run(false);
951 } 955 }
952 956
953 private: 957 private:
954 StubDelegate* delegate_; // Weak pointer; may be NULL. 958 StubDelegate* delegate_; // Weak pointer; may be NULL.
955 base::ObserverList<Observer> observers_; 959 base::ObserverList<Observer> observers_;
956 std::string device_policy_; 960 std::string device_policy_;
957 bool screen_is_locked_; 961 bool screen_is_locked_;
958 962
959 DISALLOW_COPY_AND_ASSIGN(SessionManagerClientStubImpl); 963 DISALLOW_COPY_AND_ASSIGN(SessionManagerClientStubImpl);
960 }; 964 };
961 965
962 SessionManagerClient::SessionManagerClient() { 966 SessionManagerClient::SessionManagerClient() {
963 } 967 }
964 968
965 SessionManagerClient::~SessionManagerClient() { 969 SessionManagerClient::~SessionManagerClient() {
966 } 970 }
967 971
968 SessionManagerClient* SessionManagerClient::Create( 972 SessionManagerClient* SessionManagerClient::Create(
969 DBusClientImplementationType type) { 973 DBusClientImplementationType type) {
970 if (type == REAL_DBUS_CLIENT_IMPLEMENTATION) 974 if (type == REAL_DBUS_CLIENT_IMPLEMENTATION)
971 return new SessionManagerClientImpl(); 975 return new SessionManagerClientImpl();
972 DCHECK_EQ(STUB_DBUS_CLIENT_IMPLEMENTATION, type); 976 DCHECK_EQ(STUB_DBUS_CLIENT_IMPLEMENTATION, type);
973 return new SessionManagerClientStubImpl(); 977 return new SessionManagerClientStubImpl();
974 } 978 }
975 979
976 } // namespace chromeos 980 } // namespace chromeos
OLDNEW
« no previous file with comments | « chromeos/dbus/session_manager_client.h ('k') | components/arc.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698