Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(214)

Side by Side Diff: chrome/common/chrome_content_client.cc

Issue 15028015: Conditionally build support for Pepper-based CDMs. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Use AppendAscii() where possible. Created 7 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/common/chrome_content_client.h" 5 #include "chrome/common/chrome_content_client.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/cpu.h" 8 #include "base/cpu.h"
9 #include "base/file_util.h" 9 #include "base/file_util.h"
10 #include "base/path_service.h" 10 #include "base/path_service.h"
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 #include "widevine_cdm_version.h" // In SHARED_INTERMEDIATE_DIR. 42 #include "widevine_cdm_version.h" // In SHARED_INTERMEDIATE_DIR.
43 43
44 #if defined(OS_WIN) 44 #if defined(OS_WIN)
45 #include "base/win/registry.h" 45 #include "base/win/registry.h"
46 #include "base/win/windows_version.h" 46 #include "base/win/windows_version.h"
47 #include "sandbox/win/src/sandbox.h" 47 #include "sandbox/win/src/sandbox.h"
48 #elif defined(OS_MACOSX) 48 #elif defined(OS_MACOSX)
49 #include "chrome/common/chrome_sandbox_type_mac.h" 49 #include "chrome/common/chrome_sandbox_type_mac.h"
50 #endif 50 #endif
51 51
52 #if defined(WIDEVINE_CDM_AVAILABLE) && !defined(WIDEVINE_CDM_IS_COMPONENT) 52 #if defined(WIDEVINE_CDM_AVAILABLE) && defined(ENABLE_PEPPER_CDMS) && \
53 !defined(WIDEVINE_CDM_IS_COMPONENT)
53 #include "chrome/common/widevine_cdm_constants.h" 54 #include "chrome/common/widevine_cdm_constants.h"
54 #endif 55 #endif
55 56
56 namespace { 57 namespace {
57 58
58 const char kPDFPluginName[] = "Chrome PDF Viewer"; 59 const char kPDFPluginName[] = "Chrome PDF Viewer";
59 const char kPDFPluginMimeType[] = "application/pdf"; 60 const char kPDFPluginMimeType[] = "application/pdf";
60 const char kPDFPluginExtension[] = "pdf"; 61 const char kPDFPluginExtension[] = "pdf";
61 const char kPDFPluginDescription[] = "Portable Document Format"; 62 const char kPDFPluginDescription[] = "Portable Document Format";
62 const char kPDFPluginPrintPreviewMimeType 63 const char kPDFPluginPrintPreviewMimeType
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after
227 webkit::WebPluginMimeType gtalk_mime_type(kGTalkPluginMimeType, 228 webkit::WebPluginMimeType gtalk_mime_type(kGTalkPluginMimeType,
228 kGTalkPluginExtension, 229 kGTalkPluginExtension,
229 kGTalkPluginDescription); 230 kGTalkPluginDescription);
230 gtalk.mime_types.push_back(gtalk_mime_type); 231 gtalk.mime_types.push_back(gtalk_mime_type);
231 plugins->push_back(gtalk); 232 plugins->push_back(gtalk);
232 233
233 skip_gtalk_file_check = true; 234 skip_gtalk_file_check = true;
234 } 235 }
235 } 236 }
236 237
237 #if defined(WIDEVINE_CDM_AVAILABLE) && !defined(WIDEVINE_CDM_IS_COMPONENT) 238 #if defined(WIDEVINE_CDM_AVAILABLE) && defined(ENABLE_PEPPER_CDMS) && \
239 !defined(WIDEVINE_CDM_IS_COMPONENT)
238 static bool skip_widevine_cdm_file_check = false; 240 static bool skip_widevine_cdm_file_check = false;
239 if (PathService::Get(chrome::FILE_WIDEVINE_CDM_ADAPTER, &path)) { 241 if (PathService::Get(chrome::FILE_WIDEVINE_CDM_ADAPTER, &path)) {
240 if (skip_widevine_cdm_file_check || file_util::PathExists(path)) { 242 if (skip_widevine_cdm_file_check || file_util::PathExists(path)) {
241 content::PepperPluginInfo widevine_cdm; 243 content::PepperPluginInfo widevine_cdm;
242 widevine_cdm.is_out_of_process = true; 244 widevine_cdm.is_out_of_process = true;
243 widevine_cdm.path = path; 245 widevine_cdm.path = path;
244 widevine_cdm.name = kWidevineCdmDisplayName; 246 widevine_cdm.name = kWidevineCdmDisplayName;
245 widevine_cdm.description = kWidevineCdmDescription; 247 widevine_cdm.description = kWidevineCdmDescription;
246 widevine_cdm.version = WIDEVINE_CDM_VERSION_STRING; 248 widevine_cdm.version = WIDEVINE_CDM_VERSION_STRING;
247 webkit::WebPluginMimeType widevine_cdm_mime_type( 249 webkit::WebPluginMimeType widevine_cdm_mime_type(
248 kWidevineCdmPluginMimeType, 250 kWidevineCdmPluginMimeType,
249 kWidevineCdmPluginExtension, 251 kWidevineCdmPluginExtension,
250 kWidevineCdmPluginMimeTypeDescription); 252 kWidevineCdmPluginMimeTypeDescription);
251 widevine_cdm.mime_types.push_back(widevine_cdm_mime_type); 253 widevine_cdm.mime_types.push_back(widevine_cdm_mime_type);
252 widevine_cdm.permissions = kWidevineCdmPluginPermissions; 254 widevine_cdm.permissions = kWidevineCdmPluginPermissions;
253 plugins->push_back(widevine_cdm); 255 plugins->push_back(widevine_cdm);
254 256
255 skip_widevine_cdm_file_check = true; 257 skip_widevine_cdm_file_check = true;
256 } 258 }
257 } 259 }
258 #endif // defined(WIDEVINE_CDM_AVAILABLE) && 260 #endif // defined(WIDEVINE_CDM_AVAILABLE) && defined(ENABLE_PEPPER_CDMS) &&
259 // !defined(WIDEVINE_CDM_IS_COMPONENT) 261 // !defined(WIDEVINE_CDM_IS_COMPONENT)
260 262
261 // The Remoting Viewer plugin is built-in. 263 // The Remoting Viewer plugin is built-in.
262 #if defined(ENABLE_REMOTING) 264 #if defined(ENABLE_REMOTING)
263 content::PepperPluginInfo info; 265 content::PepperPluginInfo info;
264 info.is_internal = true; 266 info.is_internal = true;
265 info.is_out_of_process = true; 267 info.is_out_of_process = true;
266 info.name = kRemotingViewerPluginName; 268 info.name = kRemotingViewerPluginName;
267 info.description = kRemotingViewerPluginDescription; 269 info.description = kRemotingViewerPluginDescription;
268 info.path = base::FilePath(kRemotingViewerPluginPath); 270 info.path = base::FilePath(kRemotingViewerPluginPath);
(...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after
490 } 492 }
491 return false; 493 return false;
492 } 494 }
493 495
494 std::string ChromeContentClient::GetCarbonInterposePath() const { 496 std::string ChromeContentClient::GetCarbonInterposePath() const {
495 return std::string(kInterposeLibraryPath); 497 return std::string(kInterposeLibraryPath);
496 } 498 }
497 #endif 499 #endif
498 500
499 } // namespace chrome 501 } // namespace chrome
OLDNEW
« no previous file with comments | « chrome/browser/content_settings/content_settings_browsertest.cc ('k') | chrome/common/chrome_paths.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698