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/mock_cros_disks_client.cc

Issue 11365142: Small refactoring in DiskMountManager (event reporting; format method). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: few lint nits Created 8 years, 1 month 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 | « chromeos/dbus/mock_cros_disks_client.h ('k') | chromeos/disks/disk_mount_manager.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/mock_cros_disks_client.h" 5 #include "chromeos/dbus/mock_cros_disks_client.h"
6 6
7 using testing::_;
8 using testing::Invoke;
9
7 namespace chromeos { 10 namespace chromeos {
8 11
9 MockCrosDisksClient::MockCrosDisksClient() {} 12 MockCrosDisksClient::MockCrosDisksClient() {
13 ON_CALL(*this, SetUpConnections(_, _))
14 .WillByDefault(Invoke(this,
15 &MockCrosDisksClient::SetUpConnectionsInternal));
16 }
10 17
11 MockCrosDisksClient::~MockCrosDisksClient() {} 18 MockCrosDisksClient::~MockCrosDisksClient() {}
12 19
20 bool MockCrosDisksClient::SendMountEvent(MountEventType event,
21 const std::string& path) {
22 if (mount_event_handler_.is_null())
23 return false;
24 mount_event_handler_.Run(event, path);
25 return true;
26 }
27
28 bool MockCrosDisksClient::SendMountCompletedEvent(
29 MountError error_code,
30 const std::string& source_path,
31 MountType mount_type,
32 const std::string& mount_path) {
33 if (mount_completed_handler_.is_null())
34 return false;
35 mount_completed_handler_.Run(error_code, source_path, mount_type, mount_path);
36 return true;
37 }
38
39 void MockCrosDisksClient::SetUpConnectionsInternal(
40 const MountEventHandler& mount_event_handler,
41 const MountCompletedHandler& mount_completed_handler) {
42 mount_event_handler_ = mount_event_handler;
43 mount_completed_handler_ = mount_completed_handler;
44 }
45
13 } // namespace chromeos 46 } // namespace chromeos
OLDNEW
« no previous file with comments | « chromeos/dbus/mock_cros_disks_client.h ('k') | chromeos/disks/disk_mount_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698