| 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 <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include "base/base_paths_posix.h" | 9 #include "base/base_paths_posix.h" |
| 10 #include "base/callback.h" | 10 #include "base/callback.h" |
| (...skipping 361 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 372 type(kInvalidType), | 372 type(kInvalidType), |
| 373 total_size_in_bytes(0), | 373 total_size_in_bytes(0), |
| 374 volume_metadata_valid(false), | 374 volume_metadata_valid(false), |
| 375 audio_count(0), | 375 audio_count(0), |
| 376 image_count(0), | 376 image_count(0), |
| 377 video_count(0), | 377 video_count(0), |
| 378 default_gallery_type(kNotDefault), | 378 default_gallery_type(kNotDefault), |
| 379 prefs_version(0) { | 379 prefs_version(0) { |
| 380 } | 380 } |
| 381 | 381 |
| 382 MediaGalleryPrefInfo::MediaGalleryPrefInfo(const MediaGalleryPrefInfo& other) = |
| 383 default; |
| 384 |
| 382 MediaGalleryPrefInfo::~MediaGalleryPrefInfo() {} | 385 MediaGalleryPrefInfo::~MediaGalleryPrefInfo() {} |
| 383 | 386 |
| 384 base::FilePath MediaGalleryPrefInfo::AbsolutePath() const { | 387 base::FilePath MediaGalleryPrefInfo::AbsolutePath() const { |
| 385 base::FilePath base_path = MediaStorageUtil::FindDevicePathById(device_id); | 388 base::FilePath base_path = MediaStorageUtil::FindDevicePathById(device_id); |
| 386 DCHECK(!path.IsAbsolute()); | 389 DCHECK(!path.IsAbsolute()); |
| 387 return base_path.empty() ? base_path : base_path.Append(path); | 390 return base_path.empty() ? base_path : base_path.Append(path); |
| 388 } | 391 } |
| 389 | 392 |
| 390 bool MediaGalleryPrefInfo::IsBlackListedType() const { | 393 bool MediaGalleryPrefInfo::IsBlackListedType() const { |
| 391 return type == kBlackListed || type == kRemovedScan; | 394 return type == kBlackListed || type == kRemovedScan; |
| (...skipping 1061 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1453 if (extension_prefs_for_testing_) | 1456 if (extension_prefs_for_testing_) |
| 1454 return extension_prefs_for_testing_; | 1457 return extension_prefs_for_testing_; |
| 1455 return extensions::ExtensionPrefs::Get(profile_); | 1458 return extensions::ExtensionPrefs::Get(profile_); |
| 1456 } | 1459 } |
| 1457 | 1460 |
| 1458 void MediaGalleriesPreferences::SetExtensionPrefsForTesting( | 1461 void MediaGalleriesPreferences::SetExtensionPrefsForTesting( |
| 1459 extensions::ExtensionPrefs* extension_prefs) { | 1462 extensions::ExtensionPrefs* extension_prefs) { |
| 1460 DCHECK(IsInitialized()); | 1463 DCHECK(IsInitialized()); |
| 1461 extension_prefs_for_testing_ = extension_prefs; | 1464 extension_prefs_for_testing_ = extension_prefs; |
| 1462 } | 1465 } |
| OLD | NEW |