blob: b8aeea558cc99089dfd121294ca8ed31ca55badb (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
|
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "content/test/test_content_client.h"
#include "base/base_paths.h"
#include "base/file_path.h"
#include "base/logging.h"
#include "base/path_service.h"
#include "base/string_piece.h"
TestContentClient::TestContentClient()
: data_pack_(ui::SCALE_FACTOR_100P) {
// content_resources.pak is not built on iOS as it is not required.
#if !defined(OS_IOS)
FilePath content_resources_pack_path;
PathService::Get(base::DIR_MODULE, &content_resources_pack_path);
content_resources_pack_path = content_resources_pack_path.Append(
FILE_PATH_LITERAL("content_resources.pak"));
data_pack_.LoadFromPath(content_resources_pack_path);
#endif
}
TestContentClient::~TestContentClient() {
}
std::string TestContentClient::GetUserAgent() const {
return std::string("TestContentClient");
}
base::StringPiece TestContentClient::GetDataResource(
int resource_id,
ui::ScaleFactor scale_factor) const {
base::StringPiece resource;
data_pack_.GetStringPiece(resource_id, &resource);
return resource;
}
|