summaryrefslogtreecommitdiffstats
path: root/content/test/test_content_client.cc
blob: 4f7bce994ca3014ff4f33c85f4017a8172de6d3c (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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
// 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::ResourceHandle::kScaleFactor100x) {
  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_.Load(content_resources_pack_path);
}

TestContentClient::~TestContentClient() {
}

void TestContentClient::SetActiveURL(const GURL& url) {
}

void TestContentClient::SetGpuInfo(const content::GPUInfo& gpu_info) {
}

void TestContentClient::AddPepperPlugins(
    std::vector<content::PepperPluginInfo>* plugins) {
}

void TestContentClient::AddNPAPIPlugins(
    webkit::npapi::PluginList* plugin_list) {
}

void TestContentClient::AddAdditionalSchemes(
    std::vector<std::string>* standard_schemes,
    std::vector<std::string>* savable_schemes) {
}

bool TestContentClient::HasWebUIScheme(const GURL& url) const {
  return false;
}

bool TestContentClient::CanHandleWhileSwappedOut(const IPC::Message& msg) {
  // TestContentClient does not need to handle any additional messages.
  return false;
}

std::string TestContentClient::GetUserAgent() const {
  return std::string("TestContentClient");
}

string16 TestContentClient::GetLocalizedString(int message_id) const {
  return string16();
}

base::StringPiece TestContentClient::GetDataResource(int resource_id) const {
  base::StringPiece resource;
  data_pack_.GetStringPiece(resource_id, &resource);
  return resource;
}

#if defined(OS_WIN)
bool TestContentClient::SandboxPlugin(CommandLine* command_line,
                                      sandbox::TargetPolicy* policy) {
  return false;
}
#endif

#if defined(OS_MACOSX)
bool TestContentClient::GetSandboxProfileForSandboxType(
    int sandbox_type,
    int* sandbox_profile_resource_id) const {
  return false;
}
#endif