OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/utility/extensions/extensions_handler.h" | 5 #include "chrome/utility/extensions/extensions_handler.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/path_service.h" | 10 #include "base/path_service.h" |
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
158 Send(new ChromeUtilityHostMsg_GotITunesDirectory(library_path)); | 158 Send(new ChromeUtilityHostMsg_GotITunesDirectory(library_path)); |
159 ReleaseProcessIfNeeded(); | 159 ReleaseProcessIfNeeded(); |
160 } | 160 } |
161 #endif // defined(OS_WIN) | 161 #endif // defined(OS_WIN) |
162 | 162 |
163 #if defined(OS_MACOSX) | 163 #if defined(OS_MACOSX) |
164 void ExtensionsHandler::OnParseIPhotoLibraryXmlFile( | 164 void ExtensionsHandler::OnParseIPhotoLibraryXmlFile( |
165 const IPC::PlatformFileForTransit& iphoto_library_file) { | 165 const IPC::PlatformFileForTransit& iphoto_library_file) { |
166 iphoto::IPhotoLibraryParser parser; | 166 iphoto::IPhotoLibraryParser parser; |
167 base::File file = IPC::PlatformFileForTransitToFile(iphoto_library_file); | 167 base::File file = IPC::PlatformFileForTransitToFile(iphoto_library_file); |
168 bool result = parser.Parse(iapps::ReadFileAsString(file.Pass())); | 168 bool result = parser.Parse(iapps::ReadFileAsString(std::move(file))); |
169 Send(new ChromeUtilityHostMsg_GotIPhotoLibrary(result, parser.library())); | 169 Send(new ChromeUtilityHostMsg_GotIPhotoLibrary(result, parser.library())); |
170 ReleaseProcessIfNeeded(); | 170 ReleaseProcessIfNeeded(); |
171 } | 171 } |
172 #endif // defined(OS_MACOSX) | 172 #endif // defined(OS_MACOSX) |
173 | 173 |
174 #if defined(OS_WIN) || defined(OS_MACOSX) | 174 #if defined(OS_WIN) || defined(OS_MACOSX) |
175 void ExtensionsHandler::OnParseITunesLibraryXmlFile( | 175 void ExtensionsHandler::OnParseITunesLibraryXmlFile( |
176 const IPC::PlatformFileForTransit& itunes_library_file) { | 176 const IPC::PlatformFileForTransit& itunes_library_file) { |
177 itunes::ITunesLibraryParser parser; | 177 itunes::ITunesLibraryParser parser; |
178 base::File file = IPC::PlatformFileForTransitToFile(itunes_library_file); | 178 base::File file = IPC::PlatformFileForTransitToFile(itunes_library_file); |
179 bool result = parser.Parse(iapps::ReadFileAsString(file.Pass())); | 179 bool result = parser.Parse(iapps::ReadFileAsString(std::move(file))); |
180 Send(new ChromeUtilityHostMsg_GotITunesLibrary(result, parser.library())); | 180 Send(new ChromeUtilityHostMsg_GotITunesLibrary(result, parser.library())); |
181 ReleaseProcessIfNeeded(); | 181 ReleaseProcessIfNeeded(); |
182 } | 182 } |
183 | 183 |
184 void ExtensionsHandler::OnParsePicasaPMPDatabase( | 184 void ExtensionsHandler::OnParsePicasaPMPDatabase( |
185 const picasa::AlbumTableFilesForTransit& album_table_files) { | 185 const picasa::AlbumTableFilesForTransit& album_table_files) { |
186 picasa::AlbumTableFiles files; | 186 picasa::AlbumTableFiles files; |
187 files.indicator_file = | 187 files.indicator_file = |
188 IPC::PlatformFileForTransitToFile(album_table_files.indicator_file); | 188 IPC::PlatformFileForTransitToFile(album_table_files.indicator_file); |
189 files.category_file = | 189 files.category_file = |
190 IPC::PlatformFileForTransitToFile(album_table_files.category_file); | 190 IPC::PlatformFileForTransitToFile(album_table_files.category_file); |
191 files.date_file = | 191 files.date_file = |
192 IPC::PlatformFileForTransitToFile(album_table_files.date_file); | 192 IPC::PlatformFileForTransitToFile(album_table_files.date_file); |
193 files.filename_file = | 193 files.filename_file = |
194 IPC::PlatformFileForTransitToFile(album_table_files.filename_file); | 194 IPC::PlatformFileForTransitToFile(album_table_files.filename_file); |
195 files.name_file = | 195 files.name_file = |
196 IPC::PlatformFileForTransitToFile(album_table_files.name_file); | 196 IPC::PlatformFileForTransitToFile(album_table_files.name_file); |
197 files.token_file = | 197 files.token_file = |
198 IPC::PlatformFileForTransitToFile(album_table_files.token_file); | 198 IPC::PlatformFileForTransitToFile(album_table_files.token_file); |
199 files.uid_file = | 199 files.uid_file = |
200 IPC::PlatformFileForTransitToFile(album_table_files.uid_file); | 200 IPC::PlatformFileForTransitToFile(album_table_files.uid_file); |
201 | 201 |
202 picasa::PicasaAlbumTableReader reader(files.Pass()); | 202 picasa::PicasaAlbumTableReader reader(std::move(files)); |
203 bool parse_success = reader.Init(); | 203 bool parse_success = reader.Init(); |
204 Send(new ChromeUtilityHostMsg_ParsePicasaPMPDatabase_Finished( | 204 Send(new ChromeUtilityHostMsg_ParsePicasaPMPDatabase_Finished( |
205 parse_success, reader.albums(), reader.folders())); | 205 parse_success, reader.albums(), reader.folders())); |
206 ReleaseProcessIfNeeded(); | 206 ReleaseProcessIfNeeded(); |
207 } | 207 } |
208 | 208 |
209 void ExtensionsHandler::OnIndexPicasaAlbumsContents( | 209 void ExtensionsHandler::OnIndexPicasaAlbumsContents( |
210 const picasa::AlbumUIDSet& album_uids, | 210 const picasa::AlbumUIDSet& album_uids, |
211 const std::vector<picasa::FolderINIContents>& folders_inis) { | 211 const std::vector<picasa::FolderINIContents>& folders_inis) { |
212 picasa::PicasaAlbumsIndexer indexer(album_uids); | 212 picasa::PicasaAlbumsIndexer indexer(album_uids); |
(...skipping 12 matching lines...) Expand all Loading... |
225 | 225 |
226 std::string key_data; | 226 std::string key_data; |
227 std::string error; | 227 std::string error; |
228 wifi_service->GetKeyFromSystem(network_guid, &key_data, &error); | 228 wifi_service->GetKeyFromSystem(network_guid, &key_data, &error); |
229 | 229 |
230 Send(new ChromeUtilityHostMsg_GotWiFiCredentials(key_data, error.empty())); | 230 Send(new ChromeUtilityHostMsg_GotWiFiCredentials(key_data, error.empty())); |
231 } | 231 } |
232 #endif // defined(OS_WIN) | 232 #endif // defined(OS_WIN) |
233 | 233 |
234 } // namespace extensions | 234 } // namespace extensions |
OLD | NEW |