Loosen up heuristics for detecting account creation forms.
[chromium-blink-merge.git] / content / public / common / content_client.cc
blob94cac28aa5a8d6e7d1f6a2e97b03434c0901a682
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
3 // found in the LICENSE file.
5 #include "content/public/common/content_client.h"
7 #include "base/logging.h"
8 #include "base/string_piece.h"
9 #include "ui/gfx/image/image.h"
10 #include "webkit/plugins/ppapi/host_globals.h"
11 #include "webkit/user_agent/user_agent.h"
13 namespace content {
15 static ContentClient* g_client;
17 void SetContentClient(ContentClient* client) {
18 g_client = client;
20 // Set the default user agent as provided by the client. We need to make
21 // sure this is done before webkit_glue::GetUserAgent() is called (so that
22 // the UA doesn't change).
23 if (client) {
24 webkit_glue::SetUserAgent(client->GetUserAgent(), false);
28 ContentClient* GetContentClient() {
29 return g_client;
32 const std::string& GetUserAgent(const GURL& url) {
33 DCHECK(g_client);
34 return webkit_glue::GetUserAgent(url);
37 webkit::ppapi::HostGlobals* GetHostGlobals() {
38 return webkit::ppapi::HostGlobals::Get();
41 ContentClient::ContentClient()
42 : browser_(NULL), plugin_(NULL), renderer_(NULL), utility_(NULL) {
45 ContentClient::~ContentClient() {
48 bool ContentClient::HasWebUIScheme(const GURL& url) const {
49 return false;
52 bool ContentClient::CanHandleWhileSwappedOut(const IPC::Message& message) {
53 return false;
56 std::string ContentClient::GetProduct() const {
57 return std::string();
60 std::string ContentClient::GetUserAgent() const {
61 return std::string();
64 string16 ContentClient::GetLocalizedString(int message_id) const {
65 return string16();
68 base::StringPiece ContentClient::GetDataResource(
69 int resource_id,
70 ui::ScaleFactor scale_factor) const {
71 return base::StringPiece();
74 gfx::Image& ContentClient::GetNativeImageNamed(int resource_id) const {
75 CR_DEFINE_STATIC_LOCAL(gfx::Image, kEmptyImage, ());
76 return kEmptyImage;
79 #if defined(OS_WIN)
80 bool ContentClient::SandboxPlugin(CommandLine* command_line,
81 sandbox::TargetPolicy* policy) {
82 return false;
84 #endif
86 #if defined(OS_MACOSX) && !defined(OS_IOS)
87 bool ContentClient::GetSandboxProfileForSandboxType(
88 int sandbox_type,
89 int* sandbox_profile_resource_id) const {
90 return false;
93 std::string ContentClient::GetCarbonInterposePath() const {
94 return std::string();
96 #endif
98 } // namespace content