This source file includes following definitions.
- PathProvider
- RegisterPathProvider
#include "extensions/common/extension_paths.h"
#include "base/file_util.h"
#include "base/path_service.h"
namespace extensions {
bool PathProvider(int key, base::FilePath* result) {
if (key != DIR_TEST_DATA)
return false;
base::FilePath cur;
if (!PathService::Get(base::DIR_SOURCE_ROOT, &cur))
return false;
cur = cur.Append(FILE_PATH_LITERAL("extensions"));
cur = cur.Append(FILE_PATH_LITERAL("test"));
cur = cur.Append(FILE_PATH_LITERAL("data"));
if (!base::PathExists(cur))
return false;
*result = cur;
return true;
}
void RegisterPathProvider() {
PathService::RegisterProvider(PathProvider, PATH_START, PATH_END);
}
}