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

Unified Diff: chromeos/dbus/permission_broker_client.cc

Issue 1034333002: Check USB device path access when prompting users to select a device. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Move MockPermissionBrokerClient into its own header. Created 5 years, 8 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 | « chromeos/dbus/permission_broker_client.h ('k') | chromeos/network/firewall_hole_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chromeos/dbus/permission_broker_client.cc
diff --git a/chromeos/dbus/permission_broker_client.cc b/chromeos/dbus/permission_broker_client.cc
index c26d53c9acdbfff91d529b293f95bc779f4419c4..51d83372a4313032ca7d2e4f9f0d4cf3306445ac 100644
--- a/chromeos/dbus/permission_broker_client.cc
+++ b/chromeos/dbus/permission_broker_client.cc
@@ -11,6 +11,7 @@
#include "dbus/object_proxy.h"
#include "third_party/cros_system_api/dbus/service_constants.h"
+using permission_broker::kCheckPathAccess;
using permission_broker::kPermissionBrokerInterface;
using permission_broker::kPermissionBrokerServiceName;
using permission_broker::kPermissionBrokerServicePath;
@@ -26,6 +27,16 @@ class PermissionBrokerClientImpl : public PermissionBrokerClient {
public:
PermissionBrokerClientImpl() : proxy_(NULL), weak_ptr_factory_(this) {}
+ void CheckPathAccess(const std::string& path,
+ const ResultCallback& callback) override {
+ dbus::MethodCall method_call(kPermissionBrokerInterface, kCheckPathAccess);
+ dbus::MessageWriter writer(&method_call);
+ writer.AppendString(path);
+ proxy_->CallMethod(&method_call, dbus::ObjectProxy::TIMEOUT_USE_DEFAULT,
+ base::Bind(&PermissionBrokerClientImpl::OnResponse,
+ weak_ptr_factory_.GetWeakPtr(), callback));
+ }
+
void RequestPathAccess(const std::string& path,
const int interface_id,
const ResultCallback& callback) override {
« no previous file with comments | « chromeos/dbus/permission_broker_client.h ('k') | chromeos/network/firewall_hole_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698