This source file includes following definitions.
- GetProduct
- GetUserAgent
- GetProduct
- GetUserAgent
- GetLocalizedString
- GetDataResource
- CanSendWhileSwappedOut
#include "android_webview/common/aw_content_client.h"
#include "base/basictypes.h"
#include "base/command_line.h"
#include "content/public/common/content_switches.h"
#include "content/public/common/user_agent.h"
#include "ipc/ipc_message.h"
#include "ui/base/l10n/l10n_util.h"
#include "ui/base/resource/resource_bundle.h"
namespace {
std::string GetProduct() {
return "Chrome/33.0.0.0";
}
}
namespace android_webview {
std::string GetUserAgent() {
std::string product = "Version/4.0 " + GetProduct();
if (CommandLine::ForCurrentProcess()->HasSwitch(
switches::kUseMobileUserAgent)) {
product += " Mobile";
}
return content::BuildUserAgentFromProduct(product);
}
std::string AwContentClient::GetProduct() const {
return ::GetProduct();
}
std::string AwContentClient::GetUserAgent() const {
return android_webview::GetUserAgent();
}
base::string16 AwContentClient::GetLocalizedString(int message_id) const {
return l10n_util::GetStringUTF16(message_id);
}
base::StringPiece AwContentClient::GetDataResource(
int resource_id,
ui::ScaleFactor scale_factor) const {
return ResourceBundle::GetSharedInstance().GetRawDataResourceForScale(
resource_id, scale_factor);
}
bool AwContentClient::CanSendWhileSwappedOut(const IPC::Message* message) {
return message->type() == IPC_REPLY_ID;
}
}