OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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_finder_win.h" | 5 #include "chrome/browser/media_galleries/fileapi/itunes_finder_win.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/base_paths_win.h" | 9 #include "base/base_paths_win.h" |
10 #include "base/file_util.h" | 10 #include "base/file_util.h" |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
63 DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::FILE)); | 63 DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::FILE)); |
64 | 64 |
65 base::FilePath music_dir; | 65 base::FilePath music_dir; |
66 if (!PathService::Get(chrome::DIR_USER_MUSIC, &music_dir)) { | 66 if (!PathService::Get(chrome::DIR_USER_MUSIC, &music_dir)) { |
67 PostResultToUIThread(std::string()); | 67 PostResultToUIThread(std::string()); |
68 return; | 68 return; |
69 } | 69 } |
70 base::FilePath library_file = | 70 base::FilePath library_file = |
71 music_dir.AppendASCII("iTunes").AppendASCII("iTunes Music Library.xml"); | 71 music_dir.AppendASCII("iTunes").AppendASCII("iTunes Music Library.xml"); |
72 | 72 |
73 if (!file_util::PathExists(library_file)) { | 73 if (!base::PathExists(library_file)) { |
74 PostResultToUIThread(std::string()); | 74 PostResultToUIThread(std::string()); |
75 return; | 75 return; |
76 } | 76 } |
77 PostResultToUIThread(library_file.AsUTF8Unsafe()); | 77 PostResultToUIThread(library_file.AsUTF8Unsafe()); |
78 } | 78 } |
79 | 79 |
80 void ITunesFinderWin::FinishedParsingPrefXML( | 80 void ITunesFinderWin::FinishedParsingPrefXML( |
81 const base::FilePath& library_file) { | 81 const base::FilePath& library_file) { |
82 DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::FILE)); | 82 DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::FILE)); |
83 | 83 |
84 if (library_file.empty() || !file_util::PathExists(library_file)) { | 84 if (library_file.empty() || !base::PathExists(library_file)) { |
85 TryDefaultLocation(); | 85 TryDefaultLocation(); |
86 return; | 86 return; |
87 } | 87 } |
88 PostResultToUIThread(library_file.AsUTF8Unsafe()); | 88 PostResultToUIThread(library_file.AsUTF8Unsafe()); |
89 } | 89 } |
90 | 90 |
91 } // namespace itunes | 91 } // namespace itunes |
OLD | NEW |