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

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

Issue 628883002: replace OVERRIDE and FINAL with override and final in chromeos/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 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/introspectable_client.cc ('k') | chromeos/dbus/modem_messaging_client.cc » ('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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/lorgnette_manager_client.h" 5 #include "chromeos/dbus/lorgnette_manager_client.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/bind_helpers.h" 10 #include "base/bind_helpers.h"
(...skipping 11 matching lines...) Expand all
22 namespace chromeos { 22 namespace chromeos {
23 23
24 // The LorgnetteManagerClient implementation used in production. 24 // The LorgnetteManagerClient implementation used in production.
25 class LorgnetteManagerClientImpl : public LorgnetteManagerClient { 25 class LorgnetteManagerClientImpl : public LorgnetteManagerClient {
26 public: 26 public:
27 LorgnetteManagerClientImpl() : 27 LorgnetteManagerClientImpl() :
28 lorgnette_daemon_proxy_(NULL), weak_ptr_factory_(this) {} 28 lorgnette_daemon_proxy_(NULL), weak_ptr_factory_(this) {}
29 29
30 virtual ~LorgnetteManagerClientImpl() {} 30 virtual ~LorgnetteManagerClientImpl() {}
31 31
32 virtual void ListScanners(const ListScannersCallback& callback) OVERRIDE { 32 virtual void ListScanners(const ListScannersCallback& callback) override {
33 dbus::MethodCall method_call(lorgnette::kManagerServiceInterface, 33 dbus::MethodCall method_call(lorgnette::kManagerServiceInterface,
34 lorgnette::kListScannersMethod); 34 lorgnette::kListScannersMethod);
35 lorgnette_daemon_proxy_->CallMethod( 35 lorgnette_daemon_proxy_->CallMethod(
36 &method_call, 36 &method_call,
37 dbus::ObjectProxy::TIMEOUT_USE_DEFAULT, 37 dbus::ObjectProxy::TIMEOUT_USE_DEFAULT,
38 base::Bind(&LorgnetteManagerClientImpl::OnListScanners, 38 base::Bind(&LorgnetteManagerClientImpl::OnListScanners,
39 weak_ptr_factory_.GetWeakPtr(), 39 weak_ptr_factory_.GetWeakPtr(),
40 callback)); 40 callback));
41 } 41 }
42 42
43 // LorgnetteManagerClient override. 43 // LorgnetteManagerClient override.
44 virtual void ScanImage(std::string device_name, 44 virtual void ScanImage(std::string device_name,
45 base::PlatformFile file, 45 base::PlatformFile file,
46 const ScanProperties& properties, 46 const ScanProperties& properties,
47 const ScanImageCallback& callback) OVERRIDE { 47 const ScanImageCallback& callback) override {
48 dbus::FileDescriptor* file_descriptor = new dbus::FileDescriptor(); 48 dbus::FileDescriptor* file_descriptor = new dbus::FileDescriptor();
49 file_descriptor->PutValue(file); 49 file_descriptor->PutValue(file);
50 // Punt descriptor validity check to a worker thread; on return we'll 50 // Punt descriptor validity check to a worker thread; on return we'll
51 // issue the D-Bus request to stop tracing and collect results. 51 // issue the D-Bus request to stop tracing and collect results.
52 base::WorkerPool::PostTaskAndReply( 52 base::WorkerPool::PostTaskAndReply(
53 FROM_HERE, 53 FROM_HERE,
54 base::Bind(&LorgnetteManagerClientImpl::CheckValidity, 54 base::Bind(&LorgnetteManagerClientImpl::CheckValidity,
55 file_descriptor), 55 file_descriptor),
56 base::Bind(&LorgnetteManagerClientImpl::OnCheckValidityScanImage, 56 base::Bind(&LorgnetteManagerClientImpl::OnCheckValidityScanImage,
57 weak_ptr_factory_.GetWeakPtr(), 57 weak_ptr_factory_.GetWeakPtr(),
58 base::Owned(file_descriptor), 58 base::Owned(file_descriptor),
59 device_name, 59 device_name,
60 properties, 60 properties,
61 callback), 61 callback),
62 false); 62 false);
63 } 63 }
64 64
65 protected: 65 protected:
66 virtual void Init(dbus::Bus* bus) OVERRIDE { 66 virtual void Init(dbus::Bus* bus) override {
67 lorgnette_daemon_proxy_ = 67 lorgnette_daemon_proxy_ =
68 bus->GetObjectProxy(lorgnette::kManagerServiceName, 68 bus->GetObjectProxy(lorgnette::kManagerServiceName,
69 dbus::ObjectPath(lorgnette::kManagerServicePath)); 69 dbus::ObjectPath(lorgnette::kManagerServicePath));
70 } 70 }
71 71
72 private: 72 private:
73 // Called when ListScanners completes. 73 // Called when ListScanners completes.
74 void OnListScanners(const ListScannersCallback& callback, 74 void OnListScanners(const ListScannersCallback& callback,
75 dbus::Response* response) { 75 dbus::Response* response) {
76 ScannerTable scanners; 76 ScannerTable scanners;
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
191 191
192 LorgnetteManagerClient::~LorgnetteManagerClient() { 192 LorgnetteManagerClient::~LorgnetteManagerClient() {
193 } 193 }
194 194
195 // static 195 // static
196 LorgnetteManagerClient* LorgnetteManagerClient::Create() { 196 LorgnetteManagerClient* LorgnetteManagerClient::Create() {
197 return new LorgnetteManagerClientImpl(); 197 return new LorgnetteManagerClientImpl();
198 } 198 }
199 199
200 } // namespace chromeos 200 } // namespace chromeos
OLDNEW
« no previous file with comments | « chromeos/dbus/introspectable_client.cc ('k') | chromeos/dbus/modem_messaging_client.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698