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

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

Issue 167863002: Update media galleries scan results, even when zero. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix up test Created 6 years, 10 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | chrome/browser/media_galleries/media_galleries_scan_result_dialog_controller_unittest.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 (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/base_paths_posix.h" 7 #include "base/base_paths_posix.h"
8 #include "base/callback.h" 8 #include "base/callback.h"
9 #include "base/i18n/time_formatting.h" 9 #include "base/i18n/time_formatting.h"
10 #include "base/path_service.h" 10 #include "base/path_service.h"
(...skipping 807 matching lines...) Expand 10 before | Expand all | Expand 10 after
818 bool update_gallery_metadata = volume_metadata_valid && 818 bool update_gallery_metadata = volume_metadata_valid &&
819 ((existing.volume_label != volume_label) || 819 ((existing.volume_label != volume_label) ||
820 (existing.vendor_name != vendor_name) || 820 (existing.vendor_name != vendor_name) ||
821 (existing.model_name != model_name) || 821 (existing.model_name != model_name) ||
822 (existing.total_size_in_bytes != total_size_in_bytes) || 822 (existing.total_size_in_bytes != total_size_in_bytes) ||
823 (existing.last_attach_time != last_attach_time)); 823 (existing.last_attach_time != last_attach_time));
824 824
825 bool update_scan_counts = 825 bool update_scan_counts =
826 new_type != MediaGalleryPrefInfo::kRemovedScan && 826 new_type != MediaGalleryPrefInfo::kRemovedScan &&
827 new_type != MediaGalleryPrefInfo::kBlackListed && 827 new_type != MediaGalleryPrefInfo::kBlackListed &&
828 (audio_count > 0 || image_count > 0 || video_count > 0); 828 (audio_count > 0 || image_count > 0 || video_count > 0 ||
829 existing.audio_count || existing.image_count || existing.video_count);
829 830
830 if (!update_gallery_name && !update_gallery_type && 831 if (!update_gallery_name && !update_gallery_type &&
831 !update_gallery_metadata && !update_scan_counts) 832 !update_gallery_metadata && !update_scan_counts)
832 return *pref_id_it; 833 return *pref_id_it;
833 834
834 PrefService* prefs = profile_->GetPrefs(); 835 PrefService* prefs = profile_->GetPrefs();
835 scoped_ptr<ListPrefUpdate> update( 836 scoped_ptr<ListPrefUpdate> update(
836 new ListPrefUpdate(prefs, prefs::kMediaGalleriesRememberedGalleries)); 837 new ListPrefUpdate(prefs, prefs::kMediaGalleriesRememberedGalleries));
837 base::ListValue* list = update->Get(); 838 base::ListValue* list = update->Get();
838 839
(...skipping 406 matching lines...) Expand 10 before | Expand all | Expand 10 after
1245 if (extension_prefs_for_testing_) 1246 if (extension_prefs_for_testing_)
1246 return extension_prefs_for_testing_; 1247 return extension_prefs_for_testing_;
1247 return extensions::ExtensionPrefs::Get(profile_); 1248 return extensions::ExtensionPrefs::Get(profile_);
1248 } 1249 }
1249 1250
1250 void MediaGalleriesPreferences::SetExtensionPrefsForTesting( 1251 void MediaGalleriesPreferences::SetExtensionPrefsForTesting(
1251 extensions::ExtensionPrefs* extension_prefs) { 1252 extensions::ExtensionPrefs* extension_prefs) {
1252 DCHECK(IsInitialized()); 1253 DCHECK(IsInitialized());
1253 extension_prefs_for_testing_ = extension_prefs; 1254 extension_prefs_for_testing_ = extension_prefs;
1254 } 1255 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/media_galleries/media_galleries_scan_result_dialog_controller_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698