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 "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/path_service.h" | 8 #include "base/path_service.h" |
9 #include "chrome/common/chrome_utility_messages.h" | 9 #include "chrome/common/chrome_utility_messages.h" |
10 #include "chrome/common/extensions/chrome_extensions_client.h" | 10 #include "chrome/common/extensions/chrome_extensions_client.h" |
11 #include "chrome/common/extensions/chrome_utility_extensions_messages.h" | 11 #include "chrome/common/extensions/chrome_utility_extensions_messages.h" |
12 #include "chrome/common/media_galleries/metadata_types.h" | 12 #include "chrome/common/media_galleries/metadata_types.h" |
13 #include "chrome/utility/chrome_content_utility_client.h" | 13 #include "chrome/utility/chrome_content_utility_client.h" |
14 #include "chrome/utility/media_galleries/image_metadata_extractor.h" | 14 #include "chrome/utility/media_galleries/image_metadata_extractor.h" |
15 #include "chrome/utility/media_galleries/ipc_data_source.h" | 15 #include "chrome/utility/media_galleries/ipc_data_source.h" |
16 #include "chrome/utility/media_galleries/media_metadata_parser.h" | 16 #include "chrome/utility/media_galleries/media_metadata_parser.h" |
17 #include "content/public/common/content_paths.h" | 17 #include "content/public/common/content_paths.h" |
18 #include "content/public/utility/utility_thread.h" | 18 #include "content/public/utility/utility_thread.h" |
19 #include "extensions/common/extension.h" | 19 #include "extensions/common/extension.h" |
20 #include "extensions/common/extension_l10n_util.h" | 20 #include "extensions/common/extension_l10n_util.h" |
21 #include "extensions/common/extension_utility_messages.h" | 21 #include "extensions/common/extension_utility_messages.h" |
22 #include "extensions/utility/unpacker.h" | 22 #include "extensions/utility/unpacker.h" |
23 #include "media/base/media.h" | 23 #include "media/base/media.h" |
24 #include "media/base/media_file_checker.h" | 24 #include "media/base/media_file_checker.h" |
xhwang
2015/11/02 18:11:51
Move this to ifdef MEDIA_DISABLE_FFMPEG as well.
Julien Isorce Samsung
2015/11/03 16:02:27
Acknowledged.
xhwang
2015/11/05 17:27:17
tip: Use "Done" when it's done :)
| |
25 #include "ui/base/ui_base_switches.h" | 25 #include "ui/base/ui_base_switches.h" |
26 | 26 |
27 #if defined(OS_WIN) | 27 #if defined(OS_WIN) |
28 #include "chrome/common/extensions/api/networking_private/networking_private_cry pto.h" | 28 #include "chrome/common/extensions/api/networking_private/networking_private_cry pto.h" |
29 #include "chrome/utility/media_galleries/itunes_pref_parser_win.h" | 29 #include "chrome/utility/media_galleries/itunes_pref_parser_win.h" |
30 #include "components/wifi/wifi_service.h" | 30 #include "components/wifi/wifi_service.h" |
31 #endif // defined(OS_WIN) | 31 #endif // defined(OS_WIN) |
32 | 32 |
33 #if defined(OS_MACOSX) | 33 #if defined(OS_MACOSX) |
34 #include "chrome/utility/media_galleries/iphoto_library_parser.h" | 34 #include "chrome/utility/media_galleries/iphoto_library_parser.h" |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
113 #endif // defined(OS_WIN) | 113 #endif // defined(OS_WIN) |
114 | 114 |
115 IPC_MESSAGE_UNHANDLED(handled = false) | 115 IPC_MESSAGE_UNHANDLED(handled = false) |
116 IPC_END_MESSAGE_MAP() | 116 IPC_END_MESSAGE_MAP() |
117 return handled || utility_handler_.OnMessageReceived(message); | 117 return handled || utility_handler_.OnMessageReceived(message); |
118 } | 118 } |
119 | 119 |
120 void ExtensionsHandler::OnCheckMediaFile( | 120 void ExtensionsHandler::OnCheckMediaFile( |
121 int64 milliseconds_of_decoding, | 121 int64 milliseconds_of_decoding, |
122 const IPC::PlatformFileForTransit& media_file) { | 122 const IPC::PlatformFileForTransit& media_file) { |
123 #if !defined(MEDIA_DISABLE_FFMPEG) | |
123 media::MediaFileChecker checker( | 124 media::MediaFileChecker checker( |
124 IPC::PlatformFileForTransitToFile(media_file)); | 125 IPC::PlatformFileForTransitToFile(media_file)); |
125 const bool check_success = checker.Start( | 126 const bool check_success = checker.Start( |
126 base::TimeDelta::FromMilliseconds(milliseconds_of_decoding)); | 127 base::TimeDelta::FromMilliseconds(milliseconds_of_decoding)); |
127 Send(new ChromeUtilityHostMsg_CheckMediaFile_Finished(check_success)); | 128 Send(new ChromeUtilityHostMsg_CheckMediaFile_Finished(check_success)); |
129 #else | |
130 Send(new ChromeUtilityHostMsg_CheckMediaFile_Finished(false)); | |
xhwang
2015/11/02 18:11:51
I suppose we'll never reach here (since nobody com
Julien Isorce Samsung
2015/11/03 16:02:27
You are right, I'll add NOTREACHED() so that it wo
| |
131 #endif | |
128 ReleaseProcessIfNeeded(); | 132 ReleaseProcessIfNeeded(); |
129 } | 133 } |
130 | 134 |
131 void ExtensionsHandler::OnParseMediaMetadata( | 135 void ExtensionsHandler::OnParseMediaMetadata( |
132 const std::string& mime_type, int64 total_size, bool get_attached_images) { | 136 const std::string& mime_type, int64 total_size, bool get_attached_images) { |
133 // Only one IPCDataSource may be created and added to the list of handlers. | 137 // Only one IPCDataSource may be created and added to the list of handlers. |
134 scoped_ptr<metadata::IPCDataSource> source( | 138 scoped_ptr<metadata::IPCDataSource> source( |
135 new metadata::IPCDataSource(total_size)); | 139 new metadata::IPCDataSource(total_size)); |
136 metadata::MediaMetadataParser* parser = new metadata::MediaMetadataParser( | 140 metadata::MediaMetadataParser* parser = new metadata::MediaMetadataParser( |
137 source.get(), mime_type, get_attached_images); | 141 source.get(), mime_type, get_attached_images); |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
214 | 218 |
215 std::string key_data; | 219 std::string key_data; |
216 std::string error; | 220 std::string error; |
217 wifi_service->GetKeyFromSystem(network_guid, &key_data, &error); | 221 wifi_service->GetKeyFromSystem(network_guid, &key_data, &error); |
218 | 222 |
219 Send(new ChromeUtilityHostMsg_GotWiFiCredentials(key_data, error.empty())); | 223 Send(new ChromeUtilityHostMsg_GotWiFiCredentials(key_data, error.empty())); |
220 } | 224 } |
221 #endif // defined(OS_WIN) | 225 #endif // defined(OS_WIN) |
222 | 226 |
223 } // namespace extensions | 227 } // namespace extensions |
OLD | NEW |