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

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

Issue 14743002: Do not use bundles for the CDM on Mac. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Bundle the adapter for the component installer. 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_paths.h" 5 #include "chrome/common/chrome_paths.h"
6 6
7 #include "base/file_util.h" 7 #include "base/file_util.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/mac/bundle_locations.h" 9 #include "base/mac/bundle_locations.h"
10 #include "base/path_service.h" 10 #include "base/path_service.h"
(...skipping 337 matching lines...) Expand 10 before | Expand all | Expand 10 after
348 return false; 348 return false;
349 cur = cur.Append(kO1DPluginFileName); 349 cur = cur.Append(kO1DPluginFileName);
350 break; 350 break;
351 case chrome::FILE_GTALK_PLUGIN: 351 case chrome::FILE_GTALK_PLUGIN:
352 if (!PathService::Get(base::DIR_MODULE, &cur)) 352 if (!PathService::Get(base::DIR_MODULE, &cur))
353 return false; 353 return false;
354 cur = cur.Append(kGTalkPluginFileName); 354 cur = cur.Append(kGTalkPluginFileName);
355 break; 355 break;
356 #endif 356 #endif
357 #if defined(WIDEVINE_CDM_AVAILABLE) 357 #if defined(WIDEVINE_CDM_AVAILABLE)
358 // TODO(xhwang): DIR_WIDEVINE_CDM is used for Win/Mac/Linux and 358 // TODO(xhwang): DIR_WIDEVINE_CDM is used for Win/Mac/Linux and
xhwang 2013/05/02 19:39:17 Can you help me drop "/Linux" in this line? Thanks
ddorwin 2013/05/02 20:35:57 Done.
359 // FILE_WIDEVINE_CDM_PLUGIN is used for ChromeOS. Unify them! 359 // FILE_WIDEVINE_CDM_PLUGIN is used for ChromeOS. Unify them!
360 case chrome::DIR_WIDEVINE_CDM: 360 case chrome::DIR_WIDEVINE_CDM:
361 if (!GetInternalPluginsDirectory(&cur)) 361 if (!GetInternalPluginsDirectory(&cur))
362 return false; 362 return false;
363 cur = cur.Append(kWidevineCdmBaseDirectory); 363 cur = cur.Append(kWidevineCdmBaseDirectory);
364 break; 364 break;
365 case chrome::FILE_WIDEVINE_CDM_PLUGIN: 365 case chrome::FILE_WIDEVINE_CDM_PLUGIN:
366 #if defined(OS_MACOSX)
367 // This is only for testing. The production path uses DIR_WIDEVINE_CDM.
368 // Find the adapter (and CDM) in the directory where it gets built.
369 // Use DIR_MODULE because it is consistent in both browser and renderers.
370 if (!PathService::Get(base::DIR_MODULE, &cur))
371 return false;
372 if (base::mac::AmIBundled()) {
373 // If we're called from chrome, it's beside the app (outside the
374 // app bundle), if we're called from a unittest, we'll already be
375 // outside the bundle so use the exe dir.
376 // DIR_MODULE gave us .../
xhwang 2013/05/02 19:39:17 what's .../ ?
ddorwin 2013/05/02 20:35:57 Done.
377 // Chromium.app/Contents/Versions/<v>/Google Chrome Framework.framework.
378 cur = cur.DirName();
379 cur = cur.DirName();
380 cur = cur.DirName();
381 cur = cur.DirName();
382 cur = cur.DirName();
xhwang 2013/05/02 19:39:17 why call this 5 times?
ddorwin 2013/05/02 20:35:57 Each one returns the parent directory I guess. The
383 }
384 #else
366 if (!GetInternalPluginsDirectory(&cur)) 385 if (!GetInternalPluginsDirectory(&cur))
367 return false; 386 return false;
387 #endif
368 cur = cur.Append(kWidevineCdmPluginFileName); 388 cur = cur.Append(kWidevineCdmPluginFileName);
369 break; 389 break;
370 #endif 390 #endif
371 case chrome::FILE_RESOURCES_PACK: 391 case chrome::FILE_RESOURCES_PACK:
372 #if defined(OS_MACOSX) && !defined(OS_IOS) 392 #if defined(OS_MACOSX) && !defined(OS_IOS)
373 if (base::mac::AmIBundled()) { 393 if (base::mac::AmIBundled()) {
374 cur = base::mac::FrameworkBundlePath(); 394 cur = base::mac::FrameworkBundlePath();
375 cur = cur.Append(FILE_PATH_LITERAL("Resources")) 395 cur = cur.Append(FILE_PATH_LITERAL("Resources"))
376 .Append(FILE_PATH_LITERAL("resources.pak")); 396 .Append(FILE_PATH_LITERAL("resources.pak"));
377 break; 397 break;
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after
524 return true; 544 return true;
525 } 545 }
526 546
527 // This cannot be done as a static initializer sadly since Visual Studio will 547 // This cannot be done as a static initializer sadly since Visual Studio will
528 // eliminate this object file if there is no direct entry point into it. 548 // eliminate this object file if there is no direct entry point into it.
529 void RegisterPathProvider() { 549 void RegisterPathProvider() {
530 PathService::RegisterProvider(PathProvider, PATH_START, PATH_END); 550 PathService::RegisterProvider(PathProvider, PATH_START, PATH_END);
531 } 551 }
532 552
533 } // namespace chrome 553 } // namespace chrome
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698