} changed;
};
-enum _Ewk_CSP_Header_Type {
- EWK_REPORT_ONLY,
- EWK_ENFORCE_POLICY,
- EWK_DEFAULT_POLICY
-};
-typedef enum _Ewk_CSP_Header_Type Ewk_CSP_Header_Type;
-
/**
* Callback for ewk_view_script_execute
*
'selection_magnifier_efl.h',
# tizen_webview
#TODO: making separate gyp for tizen_webview
+ '<(chrome_src_dir)/tizen_webview/public/tw_content_security_policy.h',
'<(chrome_src_dir)/tizen_webview/public/tw_custom_handlers.h',
'<(chrome_src_dir)/tizen_webview/public/tw_custom_handlers.cc',
'<(chrome_src_dir)/tizen_webview/public/tw_hit_test.h',
#include "third_party/WebKit/public/web/WebNavigationType.h"
#include "url/gurl.h"
+#include "tizen_webview/public/tw_content_security_policy.h"
#include "tizen_webview/public/tw_hit_test.h"
#include "tizen_webview/public/tw_wrt.h"
IPC_STRUCT_TRAITS_MEMBER(cache_max_dead_capacity)
IPC_STRUCT_TRAITS_END()
-IPC_ENUM_TRAITS(Ewk_CSP_Header_Type)
+IPC_ENUM_TRAITS(tizen_webview::ContentSecurityPolicyType)
IPC_ENUM_TRAITS(blink::WebNavigationPolicy)
IPC_ENUM_TRAITS(blink::WebNavigationType)
IPC_MESSAGE_ROUTED2(EwkViewMsg_SetCSP,
std::string, /* policy */
- Ewk_CSP_Header_Type /* header type */)
+ tizen_webview::ContentSecurityPolicyType /* header type */)
IPC_MESSAGE_ROUTED2(EwkViewMsg_SetScroll,
int, /* horizontal position */
IPC_SYNC_MESSAGE_ROUTED0_2(EwkHostMsg_GetContentSecurityPolicy,
std::string, /* policy */
- Ewk_CSP_Header_Type /* header type */)
+ tizen_webview::ContentSecurityPolicyType /* header type */)
IPC_SYNC_MESSAGE_ROUTED1_1(EwkHostMsg_WrtSyncMessage,
tizen_webview::WrtIpcMessageData /* data */,
render_view_host->UpdateWebkitPreferences(settings_->getPreferences());
}
-void EWebView::SetContentSecurityPolicy(const char* policy, Ewk_CSP_Header_Type type) {
+void EWebView::SetContentSecurityPolicy(const char* policy, tizen_webview::ContentSecurityPolicyType type) {
web_contents_delegate_->SetContentSecurityPolicy((policy ? policy : std::string()), type);
}
#include "browser/selectpicker/popup_picker.h"
#endif
+#include "tizen_webview/public/tw_hit_test.h"
+#include "tizen_webview/public/tw_touch_event.h"
+#include "tizen_webview/public/tw_content_security_policy.h"
#include "tizen_webview/public/tw_input_type.h"
#include "tizen_webview/public/tw_find_options.h"
#include "tizen_webview/public/tw_touch_event.h"
void InvokeAuthCallbackOnUI(_Ewk_Auth_Challenge* auth_challenge);
void set_auth_challenge(_Ewk_Auth_Challenge* ac) { auth_challenge_.reset(ac); }
_Ewk_Auth_Challenge* get_auth_challenge() const { return auth_challenge_.get(); }
- void SetContentSecurityPolicy(const char* policy, Ewk_CSP_Header_Type type);
+ void SetContentSecurityPolicy(const char* policy, tizen_webview::ContentSecurityPolicyType type);
void ShowPopupMenu(const gfx::Rect& rect, WebCore::TextDirection textDirection, double pageScaleFactor, const std::vector<content::MenuItem>& items, int data, int selectedIndex);
Eina_Bool HidePopupMenu();
bool FormIsNavigating() const { return formIsNavigating_; }
void RenderViewObserverEfl::DidCreateDocumentElement(blink::WebFrame* frame)
{
std::string policy;
- Ewk_CSP_Header_Type type = EWK_DEFAULT_POLICY;
+ tizen_webview::ContentSecurityPolicyType type = TW_CSP_DEFAULT_POLICY;
Send(new EwkHostMsg_GetContentSecurityPolicy(render_view()->GetRoutingID(), &policy, &type));
// Since, Webkit supports some more types and we cast ewk type to Webkit type.
// We allow only ewk types.
- if (type == EWK_REPORT_ONLY || type == EWK_ENFORCE_POLICY)
+ if (type == TW_CSP_REPORT_ONLY || type == TW_CSP_ENFORCE_POLICY)
frame->document().setContentSecurityPolicyUsingHeader(blink::WebString::fromUTF8(policy), type);
}
-void RenderViewObserverEfl::OnSetContentSecurityPolicy(const std::string& policy, Ewk_CSP_Header_Type header_type)
+void RenderViewObserverEfl::OnSetContentSecurityPolicy(const std::string& policy, tizen_webview::ContentSecurityPolicyType header_type)
{
blink::WebView* view = render_view()->GetWebView();
DCHECK(view);
#include "content/public/renderer/render_view_observer.h"
#include "API/ewk_hit_test_private.h"
#include "third_party/WebKit/public/platform/WebSize.h"
+#include "tizen_webview/public/tw_content_security_policy.h"
#include "tizen_webview/public/tw_hit_test.h"
namespace base {
virtual void DidUpdateLayout() OVERRIDE;
private:
- void OnSetContentSecurityPolicy(const std::string& policy, Ewk_CSP_Header_Type header_type);
+ void OnSetContentSecurityPolicy(const std::string& policy, tizen_webview::ContentSecurityPolicyType header_type);
void OnScale(double scale_factor, int x, int y);
void OnSetScroll(int x, int y);
void OnUseSettingsFont();
--- /dev/null
+// Copyright (c) 2014 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.
+
+#ifndef TIZEN_WEBVIEW_PUBLIC_TW_CONTENT_SECURITY_POLICY_H_
+#define TIZEN_WEBVIEW_PUBLIC_TW_CONTENT_SECURITY_POLICY_H_
+
+namespace tizen_webview {
+
+enum ContentSecurityPolicyType {
+ TW_CSP_REPORT_ONLY,
+ TW_CSP_ENFORCE_POLICY,
+ TW_CSP_DEFAULT_POLICY
+};
+} // namespace tizen_webview
+
+#endif // TIZEN_WEBVIEW_PUBLIC_TW_CONTENT_SECURITY_POLICY_H_
callback.Run(true);
}
-void WebContentsDelegateEfl::SetContentSecurityPolicy(const std::string& policy, Ewk_CSP_Header_Type header_type) {
+void WebContentsDelegateEfl::SetContentSecurityPolicy(const std::string& policy, tizen_webview::ContentSecurityPolicyType header_type) {
if (document_created_) {
RenderViewHost* rvh = web_contents_->GetRenderViewHost();
rvh->Send(new EwkViewMsg_SetCSP(rvh->GetRoutingID(), policy, header_type));
void WebContentsDelegateEfl::OnGetContentSecurityPolicy(IPC::Message* reply_msg) {
document_created_ = true;
if (!pending_content_security_policy_.get()) {
- EwkHostMsg_GetContentSecurityPolicy::WriteReplyParams(reply_msg, std::string(), EWK_DEFAULT_POLICY);
+ EwkHostMsg_GetContentSecurityPolicy::WriteReplyParams(reply_msg, std::string(), TW_CSP_DEFAULT_POLICY);
} else {
EwkHostMsg_GetContentSecurityPolicy::WriteReplyParams(reply_msg,
pending_content_security_policy_->policy, pending_content_security_policy_->header_type);
#include "third_party/WebKit/Source/platform/text/TextDirection.h"
#include "ui/base/ime/text_input_type.h"
+#include "tizen_webview/public/tw_content_security_policy.h"
+
class DidPrintPagesParams;
namespace tizen_webview {
virtual void DidDownloadFavicon(bool success, const GURL& icon_url, const SkBitmap& bitmap);
void OnFormSubmit(const GURL&);
- void SetContentSecurityPolicy(const std::string& policy, Ewk_CSP_Header_Type header_type);
+ void SetContentSecurityPolicy(const std::string& policy, tizen_webview::ContentSecurityPolicyType header_type);
void ShowPopupMenu(const gfx::Rect& rect, WebCore::TextDirection textDirection, double pageScaleFactor, const std::vector<MenuItem>& items, int data, int selectedIndex);
void HidePopupMenu();
virtual void ShowContextMenu(RenderFrameHost* render_frame_host, const ContextMenuParams& params) OVERRIDE;
scoped_ptr<WebContents> web_contents_;
struct ContentSecurityPolicy {
- ContentSecurityPolicy(const std::string& p, Ewk_CSP_Header_Type type)
+ ContentSecurityPolicy(const std::string& p, tizen_webview::ContentSecurityPolicyType type)
: policy(p),
header_type(type) {
}
std::string policy;
- Ewk_CSP_Header_Type header_type;
+ tizen_webview::ContentSecurityPolicyType header_type;
};
// Structure to hold media request and its callback.