| 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 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 122 #else | 122 #else |
| 123 Send(new ChromeUtilityHostMsg_CheckMediaFile_Finished(false)); | 123 Send(new ChromeUtilityHostMsg_CheckMediaFile_Finished(false)); |
| 124 #endif | 124 #endif |
| 125 ReleaseProcessIfNeeded(); | 125 ReleaseProcessIfNeeded(); |
| 126 } | 126 } |
| 127 | 127 |
| 128 void ExtensionsHandler::OnParseMediaMetadata(const std::string& mime_type, | 128 void ExtensionsHandler::OnParseMediaMetadata(const std::string& mime_type, |
| 129 int64_t total_size, | 129 int64_t total_size, |
| 130 bool get_attached_images) { | 130 bool get_attached_images) { |
| 131 // Only one IPCDataSource may be created and added to the list of handlers. | 131 // Only one IPCDataSource may be created and added to the list of handlers. |
| 132 scoped_ptr<metadata::IPCDataSource> source( | 132 std::unique_ptr<metadata::IPCDataSource> source( |
| 133 new metadata::IPCDataSource(total_size)); | 133 new metadata::IPCDataSource(total_size)); |
| 134 metadata::MediaMetadataParser* parser = new metadata::MediaMetadataParser( | 134 metadata::MediaMetadataParser* parser = new metadata::MediaMetadataParser( |
| 135 source.get(), mime_type, get_attached_images); | 135 source.get(), mime_type, get_attached_images); |
| 136 utility_client_->AddHandler(std::move(source)); | 136 utility_client_->AddHandler(std::move(source)); |
| 137 parser->Start(base::Bind(&FinishParseMediaMetadata, base::Owned(parser))); | 137 parser->Start(base::Bind(&FinishParseMediaMetadata, base::Owned(parser))); |
| 138 } | 138 } |
| 139 | 139 |
| 140 #if defined(OS_WIN) | 140 #if defined(OS_WIN) |
| 141 void ExtensionsHandler::OnParseITunesPrefXml( | 141 void ExtensionsHandler::OnParseITunesPrefXml( |
| 142 const std::string& itunes_xml_data) { | 142 const std::string& itunes_xml_data) { |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 189 indexer.ParseFolderINI(folders_inis); | 189 indexer.ParseFolderINI(folders_inis); |
| 190 | 190 |
| 191 Send(new ChromeUtilityHostMsg_IndexPicasaAlbumsContents_Finished( | 191 Send(new ChromeUtilityHostMsg_IndexPicasaAlbumsContents_Finished( |
| 192 indexer.albums_images())); | 192 indexer.albums_images())); |
| 193 ReleaseProcessIfNeeded(); | 193 ReleaseProcessIfNeeded(); |
| 194 } | 194 } |
| 195 #endif // defined(OS_WIN) || defined(OS_MACOSX) | 195 #endif // defined(OS_WIN) || defined(OS_MACOSX) |
| 196 | 196 |
| 197 #if defined(OS_WIN) | 197 #if defined(OS_WIN) |
| 198 void ExtensionsHandler::OnGetWiFiCredentials(const std::string& network_guid) { | 198 void ExtensionsHandler::OnGetWiFiCredentials(const std::string& network_guid) { |
| 199 scoped_ptr<wifi::WiFiService> wifi_service(wifi::WiFiService::Create()); | 199 std::unique_ptr<wifi::WiFiService> wifi_service(wifi::WiFiService::Create()); |
| 200 wifi_service->Initialize(NULL); | 200 wifi_service->Initialize(NULL); |
| 201 | 201 |
| 202 std::string key_data; | 202 std::string key_data; |
| 203 std::string error; | 203 std::string error; |
| 204 wifi_service->GetKeyFromSystem(network_guid, &key_data, &error); | 204 wifi_service->GetKeyFromSystem(network_guid, &key_data, &error); |
| 205 | 205 |
| 206 Send(new ChromeUtilityHostMsg_GotWiFiCredentials(key_data, error.empty())); | 206 Send(new ChromeUtilityHostMsg_GotWiFiCredentials(key_data, error.empty())); |
| 207 } | 207 } |
| 208 #endif // defined(OS_WIN) | 208 #endif // defined(OS_WIN) |
| 209 | 209 |
| 210 } // namespace extensions | 210 } // namespace extensions |
| OLD | NEW |