OLD | NEW |
---|---|
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_preferences.h" | 5 #include "chrome/browser/media_galleries/media_galleries_preferences.h" |
6 | 6 |
7 #include "base/path_service.h" | 7 #include "base/path_service.h" |
8 #include "base/prefs/pref_service.h" | 8 #include "base/prefs/pref_service.h" |
9 #include "base/stl_util.h" | 9 #include "base/stl_util.h" |
10 #include "base/strings/string_number_conversions.h" | 10 #include "base/strings/string_number_conversions.h" |
(...skipping 384 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
395 } | 395 } |
396 | 396 |
397 MediaGalleryPrefId MediaGalleriesPreferences::AddGalleryInternal( | 397 MediaGalleryPrefId MediaGalleriesPreferences::AddGalleryInternal( |
398 const std::string& device_id, const string16& display_name, | 398 const std::string& device_id, const string16& display_name, |
399 const base::FilePath& relative_path, bool user_added, | 399 const base::FilePath& relative_path, bool user_added, |
400 const string16& volume_label, const string16& vendor_name, | 400 const string16& volume_label, const string16& vendor_name, |
401 const string16& model_name, uint64 total_size_in_bytes, | 401 const string16& model_name, uint64 total_size_in_bytes, |
402 base::Time last_attach_time, | 402 base::Time last_attach_time, |
403 bool volume_metadata_valid, | 403 bool volume_metadata_valid, |
404 int prefs_version) { | 404 int prefs_version) { |
405 LOG(INFO) << "Add gallery intenral " << device_id; | |
Lei Zhang
2013/05/10 02:40:46
remove debug statement here and elsewhere.
Greg Billock
2013/05/10 16:20:27
Done.
| |
405 base::FilePath normalized_relative_path = | 406 base::FilePath normalized_relative_path = |
406 relative_path.NormalizePathSeparators(); | 407 relative_path.NormalizePathSeparators(); |
407 MediaGalleryPrefIdSet galleries_on_device = | 408 MediaGalleryPrefIdSet galleries_on_device = |
408 LookUpGalleriesByDeviceId(device_id); | 409 LookUpGalleriesByDeviceId(device_id); |
409 for (MediaGalleryPrefIdSet::const_iterator it = galleries_on_device.begin(); | 410 for (MediaGalleryPrefIdSet::const_iterator it = galleries_on_device.begin(); |
410 it != galleries_on_device.end(); | 411 it != galleries_on_device.end(); |
411 ++it) { | 412 ++it) { |
412 const MediaGalleryPrefInfo& existing = known_galleries_.find(*it)->second; | 413 const MediaGalleryPrefInfo& existing = known_galleries_.find(*it)->second; |
413 if (existing.path != normalized_relative_path) | 414 if (existing.path != normalized_relative_path) |
414 continue; | 415 continue; |
(...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
651 PrefRegistrySyncable::UNSYNCABLE_PREF); | 652 PrefRegistrySyncable::UNSYNCABLE_PREF); |
652 } | 653 } |
653 | 654 |
654 extensions::ExtensionPrefs* | 655 extensions::ExtensionPrefs* |
655 MediaGalleriesPreferences::GetExtensionPrefs() const { | 656 MediaGalleriesPreferences::GetExtensionPrefs() const { |
656 return extensions::ExtensionSystem::Get(profile_)->extension_service()-> | 657 return extensions::ExtensionSystem::Get(profile_)->extension_service()-> |
657 extension_prefs(); | 658 extension_prefs(); |
658 } | 659 } |
659 | 660 |
660 } // namespace chrome | 661 } // namespace chrome |
OLD | NEW |