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

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

Issue 10830003: Extract and dispatch device uuid in media device attached notification message. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address review comments. Created 8 years, 5 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
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/cros_disks_client.h" 5 #include "chromeos/dbus/cros_disks_client.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/stl_util.h" 8 #include "base/stl_util.h"
9 #include "base/stringprintf.h" 9 #include "base/stringprintf.h"
10 #include "dbus/bus.h" 10 #include "dbus/bus.h"
(...skipping 528 matching lines...) Expand 10 before | Expand all | Expand 10 after
539 MaybePopBool(properties[cros_disks::kDeviceIsDrive], &is_drive_); 539 MaybePopBool(properties[cros_disks::kDeviceIsDrive], &is_drive_);
540 MaybePopBool(properties[cros_disks::kDeviceIsReadOnly], &is_read_only_); 540 MaybePopBool(properties[cros_disks::kDeviceIsReadOnly], &is_read_only_);
541 MaybePopBool(properties[cros_disks::kDevicePresentationHide], &is_hidden_); 541 MaybePopBool(properties[cros_disks::kDevicePresentationHide], &is_hidden_);
542 MaybePopBool(properties[cros_disks::kDeviceIsMediaAvailable], &has_media_); 542 MaybePopBool(properties[cros_disks::kDeviceIsMediaAvailable], &has_media_);
543 MaybePopBool(properties[cros_disks::kDeviceIsOnBootDevice], 543 MaybePopBool(properties[cros_disks::kDeviceIsOnBootDevice],
544 &on_boot_device_); 544 &on_boot_device_);
545 MaybePopString(properties[cros_disks::kNativePath], &system_path_); 545 MaybePopString(properties[cros_disks::kNativePath], &system_path_);
546 MaybePopString(properties[cros_disks::kDeviceFile], &file_path_); 546 MaybePopString(properties[cros_disks::kDeviceFile], &file_path_);
547 MaybePopString(properties[cros_disks::kDriveModel], &drive_model_); 547 MaybePopString(properties[cros_disks::kDriveModel], &drive_model_);
548 MaybePopString(properties[cros_disks::kIdLabel], &label_); 548 MaybePopString(properties[cros_disks::kIdLabel], &label_);
549 MaybePopString(properties[cros_disks::kIdUuid], &uuid_);
549 MaybePopUint64(properties[cros_disks::kDeviceSize], &total_size_in_bytes_); 550 MaybePopUint64(properties[cros_disks::kDeviceSize], &total_size_in_bytes_);
550 551
551 uint32 media_type_uint32 = 0; 552 uint32 media_type_uint32 = 0;
552 if (MaybePopUint32(properties[cros_disks::kDeviceMediaType], 553 if (MaybePopUint32(properties[cros_disks::kDeviceMediaType],
553 &media_type_uint32)) { 554 &media_type_uint32)) {
554 device_type_ = DeviceMediaTypeToDeviceType(media_type_uint32); 555 device_type_ = DeviceMediaTypeToDeviceType(media_type_uint32);
555 } 556 }
556 557
557 std::vector<std::string> mount_paths; 558 std::vector<std::string> mount_paths;
558 if (MaybePopArrayOfStrings(properties[cros_disks::kDeviceMountPaths], 559 if (MaybePopArrayOfStrings(properties[cros_disks::kDeviceMountPaths],
(...skipping 11 matching lines...) Expand all
570 // static 571 // static
571 CrosDisksClient* CrosDisksClient::Create(DBusClientImplementationType type, 572 CrosDisksClient* CrosDisksClient::Create(DBusClientImplementationType type,
572 dbus::Bus* bus) { 573 dbus::Bus* bus) {
573 if (type == REAL_DBUS_CLIENT_IMPLEMENTATION) 574 if (type == REAL_DBUS_CLIENT_IMPLEMENTATION)
574 return new CrosDisksClientImpl(bus); 575 return new CrosDisksClientImpl(bus);
575 DCHECK_EQ(STUB_DBUS_CLIENT_IMPLEMENTATION, type); 576 DCHECK_EQ(STUB_DBUS_CLIENT_IMPLEMENTATION, type);
576 return new CrosDisksClientStubImpl(); 577 return new CrosDisksClientStubImpl();
577 } 578 }
578 579
579 } // namespace chromeos 580 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698