| OLD | NEW |
| 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 "content/test/test_content_client.h" | 5 #include "content/test/test_content_client.h" |
| 6 | 6 |
| 7 #include "base/base_paths.h" | 7 #include "base/base_paths.h" |
| 8 #include "base/file_path.h" | 8 #include "base/file_path.h" |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/path_service.h" | 10 #include "base/path_service.h" |
| 11 #include "base/string_piece.h" | 11 #include "base/string_piece.h" |
| 12 | 12 |
| 13 TestContentClient::TestContentClient() | 13 TestContentClient::TestContentClient() |
| 14 : data_pack_(ui::ResourceHandle::kScaleFactor100x) { | 14 : data_pack_(ui::SCALE_FACTOR_100P) { |
| 15 FilePath content_resources_pack_path; | 15 FilePath content_resources_pack_path; |
| 16 PathService::Get(base::DIR_MODULE, &content_resources_pack_path); | 16 PathService::Get(base::DIR_MODULE, &content_resources_pack_path); |
| 17 content_resources_pack_path = content_resources_pack_path.Append( | 17 content_resources_pack_path = content_resources_pack_path.Append( |
| 18 FILE_PATH_LITERAL("content_resources.pak")); | 18 FILE_PATH_LITERAL("content_resources.pak")); |
| 19 data_pack_.Load(content_resources_pack_path); | 19 data_pack_.Load(content_resources_pack_path); |
| 20 } | 20 } |
| 21 | 21 |
| 22 TestContentClient::~TestContentClient() { | 22 TestContentClient::~TestContentClient() { |
| 23 } | 23 } |
| 24 | 24 |
| (...skipping 26 matching lines...) Expand all Loading... |
| 51 } | 51 } |
| 52 | 52 |
| 53 std::string TestContentClient::GetUserAgent() const { | 53 std::string TestContentClient::GetUserAgent() const { |
| 54 return std::string("TestContentClient"); | 54 return std::string("TestContentClient"); |
| 55 } | 55 } |
| 56 | 56 |
| 57 string16 TestContentClient::GetLocalizedString(int message_id) const { | 57 string16 TestContentClient::GetLocalizedString(int message_id) const { |
| 58 return string16(); | 58 return string16(); |
| 59 } | 59 } |
| 60 | 60 |
| 61 base::StringPiece TestContentClient::GetDataResource(int resource_id) const { | 61 base::StringPiece TestContentClient::GetDataResource( |
| 62 int resource_id, |
| 63 ui::ScaleFactor scale_factor) const { |
| 62 base::StringPiece resource; | 64 base::StringPiece resource; |
| 63 data_pack_.GetStringPiece(resource_id, &resource); | 65 data_pack_.GetStringPiece(resource_id, &resource); |
| 64 return resource; | 66 return resource; |
| 65 } | |
| 66 | |
| 67 base::StringPiece TestContentClient::GetImageResource( | |
| 68 int resource_id, | |
| 69 float scale_factor) const { | |
| 70 base::StringPiece resource; | |
| 71 data_pack_.GetStringPiece(resource_id, &resource); | |
| 72 return resource; | |
| 73 } | 67 } |
| 74 | 68 |
| 75 #if defined(OS_WIN) | 69 #if defined(OS_WIN) |
| 76 bool TestContentClient::SandboxPlugin(CommandLine* command_line, | 70 bool TestContentClient::SandboxPlugin(CommandLine* command_line, |
| 77 sandbox::TargetPolicy* policy) { | 71 sandbox::TargetPolicy* policy) { |
| 78 return false; | 72 return false; |
| 79 } | 73 } |
| 80 #endif | 74 #endif |
| 81 | 75 |
| 82 #if defined(OS_MACOSX) | 76 #if defined(OS_MACOSX) |
| 83 bool TestContentClient::GetSandboxProfileForSandboxType( | 77 bool TestContentClient::GetSandboxProfileForSandboxType( |
| 84 int sandbox_type, | 78 int sandbox_type, |
| 85 int* sandbox_profile_resource_id) const { | 79 int* sandbox_profile_resource_id) const { |
| 86 return false; | 80 return false; |
| 87 } | 81 } |
| 88 #endif | 82 #endif |
| OLD | NEW |