#include "content/public/common/content_switches.h"
#include "content/public/common/user_agent.h"
#include "common/version_info.h"
+#include "ipc/ipc_message.h"
+#include "ui/base/resource/resource_bundle.h"
+#include "ui/base/l10n/l10n_util.h"
std::string ContentClientEfl::GetProduct() const {
return EflWebView::VersionInfo::GetInstance()->ProductNameAndVersionForUserAgent();
EflWebView::VersionInfo::GetInstance()->OSType(), product);
#endif
}
+
+base::string16 ContentClientEfl::GetLocalizedString(int message_id) const {
+ // TODO(boliu): Used only by WebKit, so only bundle those resources for
+ // Android WebView.
+ return l10n_util::GetStringUTF16(message_id);
+}
+
+base::StringPiece ContentClientEfl::GetDataResource(
+ int resource_id,
+ ui::ScaleFactor scale_factor) const {
+ // TODO(boliu): Used only by WebKit, so only bundle those resources for
+ // Android WebView.
+ return ResourceBundle::GetSharedInstance().GetRawDataResourceForScale(
+ resource_id, scale_factor);
+}
+
+bool ContentClientEfl::CanSendWhileSwappedOut(const IPC::Message* message) {
+ // For legacy API support we perform a few browser -> renderer synchronous IPC
+ // messages that block the browser. However, the synchronous IPC replies might
+ // be dropped by the renderer during a swap out, deadlocking the browser.
+ // Because of this we should never drop any synchronous IPC replies.
+ return message->type() == IPC_REPLY_ID;
+}
#include "base/compiler_specific.h"
+namespace IPC {
+ class Message;
+}
+
class ContentClientEfl : public content::ContentClient {
public:
// ContentClient implementation.
virtual std::string GetProduct() const OVERRIDE;
virtual std::string GetUserAgent() const OVERRIDE;
+ virtual base::string16 GetLocalizedString(int message_id) const OVERRIDE;
+ virtual base::StringPiece GetDataResource(
+ int resource_id,
+ ui::ScaleFactor scale_factor) const OVERRIDE;
+ virtual bool CanSendWhileSwappedOut(const IPC::Message* message) OVERRIDE;
};
#endif // CONTENT_CLIENT_EFL_H_
#include "ui/base/resource/resource_bundle.h"
#include "paths_efl.h"
#include "renderer/content_renderer_client_efl.h"
+#include "common/content_client_efl.h"
namespace content {
bool WebProcessContentMainDelegateEfl::BasicStartupComplete(int* exit_code) {
PathsEfl::Register();
+ ContentClientEfl* content_client = new ContentClientEfl();
+ content::SetContentClient(content_client);
return false;
}