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

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

Issue 10802065: Android resource PAKs and native lib file path changes. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase and update comment per joth@ suggestion Created 8 years, 4 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"
11 #include "base/string_util.h" 11 #include "base/string_util.h"
12 #include "base/sys_info.h" 12 #include "base/sys_info.h"
13 #include "base/version.h" 13 #include "base/version.h"
14 #include "chrome/common/chrome_constants.h" 14 #include "chrome/common/chrome_constants.h"
15 #include "chrome/common/chrome_paths_internal.h" 15 #include "chrome/common/chrome_paths_internal.h"
16 16
17 #if defined(OS_ANDROID)
brettw 2012/08/02 19:38:53 I'd not bother with this ifdef and put the include
benm (inactive) 2012/08/03 11:11:11 Done.
18 #include "ui/base/ui_base_paths.h"
19 #endif
20
17 #if defined(OS_MACOSX) 21 #if defined(OS_MACOSX)
18 #include "base/mac/mac_util.h" 22 #include "base/mac/mac_util.h"
19 #endif 23 #endif
20 24
21 namespace { 25 namespace {
22 26
23 // File name of the internal Flash plugin on different platforms. 27 // File name of the internal Flash plugin on different platforms.
24 const FilePath::CharType kInternalFlashPluginFileName[] = 28 const FilePath::CharType kInternalFlashPluginFileName[] =
25 #if defined(OS_MACOSX) 29 #if defined(OS_MACOSX)
26 FILE_PATH_LITERAL("Flash Player Plugin for Chrome.plugin"); 30 FILE_PATH_LITERAL("Flash Player Plugin for Chrome.plugin");
(...skipping 278 matching lines...) Expand 10 before | Expand all | Expand 10 after
305 break; 309 break;
306 #endif 310 #endif
307 case chrome::FILE_RESOURCES_PACK: 311 case chrome::FILE_RESOURCES_PACK:
308 #if defined(OS_MACOSX) 312 #if defined(OS_MACOSX)
309 if (base::mac::AmIBundled()) { 313 if (base::mac::AmIBundled()) {
310 cur = base::mac::FrameworkBundlePath(); 314 cur = base::mac::FrameworkBundlePath();
311 cur = cur.Append(FILE_PATH_LITERAL("Resources")) 315 cur = cur.Append(FILE_PATH_LITERAL("Resources"))
312 .Append(FILE_PATH_LITERAL("resources.pak")); 316 .Append(FILE_PATH_LITERAL("resources.pak"));
313 break; 317 break;
314 } 318 }
315 // If we're not bundled on mac, resources.pak should be next to the 319 #elif defined(OS_ANDROID)
316 // binary (e.g., for unit tests). 320 if (!PathService::Get(ui::DIR_RESOURCE_PAKS_ANDROID, &cur))
317 #endif 321 return false;
322 #else
323 // If we're not bundled on mac or Android, resources.pak should be next
324 // to the binary (e.g., for unit tests).
318 if (!PathService::Get(base::DIR_MODULE, &cur)) 325 if (!PathService::Get(base::DIR_MODULE, &cur))
319 return false; 326 return false;
327 #endif
320 cur = cur.Append(FILE_PATH_LITERAL("resources.pak")); 328 cur = cur.Append(FILE_PATH_LITERAL("resources.pak"));
321 break; 329 break;
322 case chrome::DIR_RESOURCES_EXTENSION: 330 case chrome::DIR_RESOURCES_EXTENSION:
323 if (!PathService::Get(base::DIR_MODULE, &cur)) 331 if (!PathService::Get(base::DIR_MODULE, &cur))
324 return false; 332 return false;
325 cur = cur.Append(FILE_PATH_LITERAL("resources")) 333 cur = cur.Append(FILE_PATH_LITERAL("resources"))
326 .Append(FILE_PATH_LITERAL("extension")); 334 .Append(FILE_PATH_LITERAL("extension"));
327 break; 335 break;
328 #if defined(OS_CHROMEOS) 336 #if defined(OS_CHROMEOS)
329 case chrome::DIR_CHROMEOS_WALLPAPERS: 337 case chrome::DIR_CHROMEOS_WALLPAPERS:
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
439 return true; 447 return true;
440 } 448 }
441 449
442 // This cannot be done as a static initializer sadly since Visual Studio will 450 // This cannot be done as a static initializer sadly since Visual Studio will
443 // eliminate this object file if there is no direct entry point into it. 451 // eliminate this object file if there is no direct entry point into it.
444 void RegisterPathProvider() { 452 void RegisterPathProvider() {
445 PathService::RegisterProvider(PathProvider, PATH_START, PATH_END); 453 PathService::RegisterProvider(PathProvider, PATH_START, PATH_END);
446 } 454 }
447 455
448 } // namespace chrome 456 } // namespace chrome
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698