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