| 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> |
| 8 |
| 7 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 8 #include "base/path_service.h" | 10 #include "base/path_service.h" |
| 9 #include "build/build_config.h" | 11 #include "build/build_config.h" |
| 10 #include "chrome/common/chrome_utility_messages.h" | 12 #include "chrome/common/chrome_utility_messages.h" |
| 11 #include "chrome/common/extensions/chrome_extensions_client.h" | 13 #include "chrome/common/extensions/chrome_extensions_client.h" |
| 12 #include "chrome/common/extensions/chrome_utility_extensions_messages.h" | 14 #include "chrome/common/extensions/chrome_utility_extensions_messages.h" |
| 13 #include "chrome/common/media_galleries/metadata_types.h" | 15 #include "chrome/common/media_galleries/metadata_types.h" |
| 14 #include "chrome/utility/chrome_content_utility_client.h" | 16 #include "chrome/utility/chrome_content_utility_client.h" |
| 15 #include "chrome/utility/media_galleries/image_metadata_extractor.h" | 17 #include "chrome/utility/media_galleries/image_metadata_extractor.h" |
| 16 #include "chrome/utility/media_galleries/ipc_data_source.h" | 18 #include "chrome/utility/media_galleries/ipc_data_source.h" |
| (...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 137 } | 139 } |
| 138 | 140 |
| 139 void ExtensionsHandler::OnParseMediaMetadata(const std::string& mime_type, | 141 void ExtensionsHandler::OnParseMediaMetadata(const std::string& mime_type, |
| 140 int64_t total_size, | 142 int64_t total_size, |
| 141 bool get_attached_images) { | 143 bool get_attached_images) { |
| 142 // Only one IPCDataSource may be created and added to the list of handlers. | 144 // Only one IPCDataSource may be created and added to the list of handlers. |
| 143 scoped_ptr<metadata::IPCDataSource> source( | 145 scoped_ptr<metadata::IPCDataSource> source( |
| 144 new metadata::IPCDataSource(total_size)); | 146 new metadata::IPCDataSource(total_size)); |
| 145 metadata::MediaMetadataParser* parser = new metadata::MediaMetadataParser( | 147 metadata::MediaMetadataParser* parser = new metadata::MediaMetadataParser( |
| 146 source.get(), mime_type, get_attached_images); | 148 source.get(), mime_type, get_attached_images); |
| 147 utility_client_->AddHandler(source.Pass()); | 149 utility_client_->AddHandler(std::move(source)); |
| 148 parser->Start(base::Bind(&FinishParseMediaMetadata, base::Owned(parser))); | 150 parser->Start(base::Bind(&FinishParseMediaMetadata, base::Owned(parser))); |
| 149 } | 151 } |
| 150 | 152 |
| 151 #if defined(OS_WIN) | 153 #if defined(OS_WIN) |
| 152 void ExtensionsHandler::OnParseITunesPrefXml( | 154 void ExtensionsHandler::OnParseITunesPrefXml( |
| 153 const std::string& itunes_xml_data) { | 155 const std::string& itunes_xml_data) { |
| 154 base::FilePath library_path( | 156 base::FilePath library_path( |
| 155 itunes::FindLibraryLocationInPrefXml(itunes_xml_data)); | 157 itunes::FindLibraryLocationInPrefXml(itunes_xml_data)); |
| 156 Send(new ChromeUtilityHostMsg_GotITunesDirectory(library_path)); | 158 Send(new ChromeUtilityHostMsg_GotITunesDirectory(library_path)); |
| 157 ReleaseProcessIfNeeded(); | 159 ReleaseProcessIfNeeded(); |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 223 | 225 |
| 224 std::string key_data; | 226 std::string key_data; |
| 225 std::string error; | 227 std::string error; |
| 226 wifi_service->GetKeyFromSystem(network_guid, &key_data, &error); | 228 wifi_service->GetKeyFromSystem(network_guid, &key_data, &error); |
| 227 | 229 |
| 228 Send(new ChromeUtilityHostMsg_GotWiFiCredentials(key_data, error.empty())); | 230 Send(new ChromeUtilityHostMsg_GotWiFiCredentials(key_data, error.empty())); |
| 229 } | 231 } |
| 230 #endif // defined(OS_WIN) | 232 #endif // defined(OS_WIN) |
| 231 | 233 |
| 232 } // namespace extensions | 234 } // namespace extensions |
| OLD | NEW |