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

Side by Side Diff: chrome/browser/media_galleries/media_galleries_dialog_controller.cc

Issue 16186002: Refine StorageMonitor storage device getter (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 7 years, 6 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/media_galleries_dialog_controller.h" 5 #include "chrome/browser/media_galleries/media_galleries_dialog_controller.h"
6 6
7 #include "base/i18n/time_formatting.h" 7 #include "base/i18n/time_formatting.h"
8 #include "base/path_service.h" 8 #include "base/path_service.h"
9 #include "base/stl_util.h" 9 #include "base/stl_util.h"
10 #include "base/utf_string_conversions.h" 10 #include "base/utf_string_conversions.h"
(...skipping 16 matching lines...) Expand all
27 27
28 namespace chrome { 28 namespace chrome {
29 29
30 namespace { 30 namespace {
31 31
32 bool IsAttachedDevice(const std::string& device_id) { 32 bool IsAttachedDevice(const std::string& device_id) {
33 if (!StorageInfo::IsRemovableDevice(device_id)) 33 if (!StorageInfo::IsRemovableDevice(device_id))
34 return false; 34 return false;
35 35
36 std::vector<StorageInfo> removable_storages = 36 std::vector<StorageInfo> removable_storages =
37 StorageMonitor::GetInstance()->GetAttachedStorage(); 37 StorageMonitor::GetInstance()->GetAttachedRemovableStorages();
38 for (size_t i = 0; i < removable_storages.size(); ++i) { 38 for (size_t i = 0; i < removable_storages.size(); ++i) {
39 if (removable_storages[i].device_id() == device_id) 39 if (removable_storages[i].device_id() == device_id)
40 return true; 40 return true;
41 } 41 }
42 return false; 42 return false;
43 } 43 }
44 44
45 // Comparator for sorting GalleryPermissionsVector -- sorts 45 // Comparator for sorting GalleryPermissionsVector -- sorts
46 // allowed galleries low, and then sorts by absolute path. 46 // allowed galleries low, and then sorts by absolute path.
47 bool GalleriesVectorComparator( 47 bool GalleriesVectorComparator(
(...skipping 459 matching lines...) Expand 10 before | Expand all | Expand 10 after
507 if (iter->pref_info.device_id == device_id) 507 if (iter->pref_info.device_id == device_id)
508 dialog_->UpdateGallery(iter->pref_info, iter->allowed); 508 dialog_->UpdateGallery(iter->pref_info, iter->allowed);
509 } 509 }
510 } 510 }
511 511
512 // MediaGalleries dialog ------------------------------------------------------- 512 // MediaGalleries dialog -------------------------------------------------------
513 513
514 MediaGalleriesDialog::~MediaGalleriesDialog() {} 514 MediaGalleriesDialog::~MediaGalleriesDialog() {}
515 515
516 } // namespace chrome 516 } // namespace chrome
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698