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

Side by Side Diff: chrome/browser/media_galleries/mac/mtp_device_delegate_impl_mac.mm

Issue 660343006: Standardize usage of virtual/override/final in chrome/browser/media_galleries (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
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 "chrome/browser/media_galleries/mac/mtp_device_delegate_impl_mac.h" 5 #include "chrome/browser/media_galleries/mac/mtp_device_delegate_impl_mac.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/mac/scoped_nsobject.h" 9 #include "base/mac/scoped_nsobject.h"
10 #include "base/threading/sequenced_worker_pool.h" 10 #include "base/threading/sequenced_worker_pool.h"
(...skipping 20 matching lines...) Expand all
31 // with the ImageCapture library. It will forward callbacks to 31 // with the ImageCapture library. It will forward callbacks to
32 // its delegate on the task runner with which it is created. All 32 // its delegate on the task runner with which it is created. All
33 // interactions with it are done on the UI thread, but it may be 33 // interactions with it are done on the UI thread, but it may be
34 // created/destroyed on another thread. 34 // created/destroyed on another thread.
35 class MTPDeviceDelegateImplMac::DeviceListener 35 class MTPDeviceDelegateImplMac::DeviceListener
36 : public storage_monitor::ImageCaptureDeviceListener, 36 : public storage_monitor::ImageCaptureDeviceListener,
37 public base::SupportsWeakPtr<DeviceListener> { 37 public base::SupportsWeakPtr<DeviceListener> {
38 public: 38 public:
39 DeviceListener(MTPDeviceDelegateImplMac* delegate) 39 DeviceListener(MTPDeviceDelegateImplMac* delegate)
40 : delegate_(delegate) {} 40 : delegate_(delegate) {}
41 virtual ~DeviceListener() {} 41 ~DeviceListener() override {}
42 42
43 void OpenCameraSession(const std::string& device_id); 43 void OpenCameraSession(const std::string& device_id);
44 void CloseCameraSessionAndDelete(); 44 void CloseCameraSessionAndDelete();
45 45
46 void DownloadFile(const std::string& name, const base::FilePath& local_path); 46 void DownloadFile(const std::string& name, const base::FilePath& local_path);
47 47
48 // ImageCaptureDeviceListener 48 // ImageCaptureDeviceListener
49 virtual void ItemAdded(const std::string& name, 49 void ItemAdded(const std::string& name,
50 const base::File::Info& info) override; 50 const base::File::Info& info) override;
51 virtual void NoMoreItems() override; 51 void NoMoreItems() override;
52 virtual void DownloadedFile(const std::string& name, 52 void DownloadedFile(const std::string& name,
53 base::File::Error error) override; 53 base::File::Error error) override;
54 virtual void DeviceRemoved() override; 54 void DeviceRemoved() override;
55 55
56 // Used during delegate destruction to ensure there are no more calls 56 // Used during delegate destruction to ensure there are no more calls
57 // to the delegate by the listener. 57 // to the delegate by the listener.
58 virtual void ResetDelegate(); 58 virtual void ResetDelegate();
59 59
60 private: 60 private:
61 base::scoped_nsobject<ImageCaptureDevice> camera_device_; 61 base::scoped_nsobject<ImageCaptureDevice> camera_device_;
62 62
63 // Weak pointer 63 // Weak pointer
64 MTPDeviceDelegateImplMac* delegate_; 64 MTPDeviceDelegateImplMac* delegate_;
(...skipping 419 matching lines...) Expand 10 before | Expand all | Expand 10 after
484 std::string device_name = base::FilePath(device_location).BaseName().value(); 484 std::string device_name = base::FilePath(device_location).BaseName().value();
485 std::string device_id; 485 std::string device_id;
486 storage_monitor::StorageInfo::Type type; 486 storage_monitor::StorageInfo::Type type;
487 bool cracked = storage_monitor::StorageInfo::CrackDeviceId( 487 bool cracked = storage_monitor::StorageInfo::CrackDeviceId(
488 device_name, &type, &device_id); 488 device_name, &type, &device_id);
489 DCHECK(cracked); 489 DCHECK(cracked);
490 DCHECK_EQ(storage_monitor::StorageInfo::MAC_IMAGE_CAPTURE, type); 490 DCHECK_EQ(storage_monitor::StorageInfo::MAC_IMAGE_CAPTURE, type);
491 491
492 cb.Run(new MTPDeviceDelegateImplMac(device_id, device_location)); 492 cb.Run(new MTPDeviceDelegateImplMac(device_id, device_location));
493 } 493 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698