OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/fileapi/itunes_data_provider.h" | 5 #include "chrome/browser/media_galleries/fileapi/itunes_data_provider.h" |
6 | 6 |
7 #include <map> | 7 #include <map> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/callback.h" | 10 #include "base/callback.h" |
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
194 ready_callback)); | 194 ready_callback)); |
195 } | 195 } |
196 | 196 |
197 const base::FilePath& ITunesDataProvider::auto_add_path() const { | 197 const base::FilePath& ITunesDataProvider::auto_add_path() const { |
198 return auto_add_path_; | 198 return auto_add_path_; |
199 } | 199 } |
200 | 200 |
201 bool ITunesDataProvider::KnownArtist(const ArtistName& artist) const { | 201 bool ITunesDataProvider::KnownArtist(const ArtistName& artist) const { |
202 DCHECK(MediaFileSystemBackend::CurrentlyOnMediaTaskRunnerThread()); | 202 DCHECK(MediaFileSystemBackend::CurrentlyOnMediaTaskRunnerThread()); |
203 DCHECK(valid()); | 203 DCHECK(valid()); |
204 return ContainsKey(library_, artist); | 204 return base::ContainsKey(library_, artist); |
205 } | 205 } |
206 | 206 |
207 bool ITunesDataProvider::KnownAlbum(const ArtistName& artist, | 207 bool ITunesDataProvider::KnownAlbum(const ArtistName& artist, |
208 const AlbumName& album) const { | 208 const AlbumName& album) const { |
209 DCHECK(MediaFileSystemBackend::CurrentlyOnMediaTaskRunnerThread()); | 209 DCHECK(MediaFileSystemBackend::CurrentlyOnMediaTaskRunnerThread()); |
210 DCHECK(valid()); | 210 DCHECK(valid()); |
211 Library::const_iterator library_it = library_.find(artist); | 211 Library::const_iterator library_it = library_.find(artist); |
212 if (library_it == library_.end()) | 212 if (library_it == library_.end()) |
213 return false; | 213 return false; |
214 return ContainsKey(library_it->second, album); | 214 return base::ContainsKey(library_it->second, album); |
215 } | 215 } |
216 | 216 |
217 base::FilePath ITunesDataProvider::GetTrackLocation( | 217 base::FilePath ITunesDataProvider::GetTrackLocation( |
218 const ArtistName& artist, const AlbumName& album, | 218 const ArtistName& artist, const AlbumName& album, |
219 const TrackName& track) const { | 219 const TrackName& track) const { |
220 DCHECK(MediaFileSystemBackend::CurrentlyOnMediaTaskRunnerThread()); | 220 DCHECK(MediaFileSystemBackend::CurrentlyOnMediaTaskRunnerThread()); |
221 DCHECK(valid()); | 221 DCHECK(valid()); |
222 Library::const_iterator library_it = library_.find(artist); | 222 Library::const_iterator library_it = library_.find(artist); |
223 if (library_it == library_.end()) | 223 if (library_it == library_.end()) |
224 return base::FilePath(); | 224 return base::FilePath(); |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
293 std::string album_name = SanitizeName(album_it->first); | 293 std::string album_name = SanitizeName(album_it->first); |
294 library_[artist_name][album_name] = | 294 library_[artist_name][album_name] = |
295 MakeUniqueTrackNames(album_it->second); | 295 MakeUniqueTrackNames(album_it->second); |
296 } | 296 } |
297 } | 297 } |
298 } | 298 } |
299 ready_callback.Run(valid()); | 299 ready_callback.Run(valid()); |
300 } | 300 } |
301 | 301 |
302 } // namespace itunes | 302 } // namespace itunes |
OLD | NEW |