break dependency to enum Ewk_CSP_Header_Type
authorSeungSeop Park <sns.park@samsung.com>
Mon, 16 Jun 2014 10:21:24 +0000 (19:21 +0900)
committerYoungsoo Choi <kenshin.choi@samsung.com>
Tue, 10 Jul 2018 06:57:09 +0000 (06:57 +0000)
Replaced by tizen_webview::ContentSecurityPolicyType

Issue: CBEFL-92
Change-Id: I3f3f650a186a6ffe02a0bee9f3ecf68d42f399cc

tizen_src/ewk_api_headers/public/ewk_view.h
tizen_src/impl/chromium-efl.gyp
tizen_src/impl/common/render_messages_efl.h
tizen_src/impl/eweb_view.cc
tizen_src/impl/eweb_view.h
tizen_src/impl/renderer/render_view_observer_efl.cc
tizen_src/impl/renderer/render_view_observer_efl.h
tizen_src/impl/tizen_webview/public/tw_content_security_policy.h [new file with mode: 0644]
tizen_src/impl/web_contents_delegate_efl.cc
tizen_src/impl/web_contents_delegate_efl.h

index 16a175e..7fcd29f 100644 (file)
@@ -258,13 +258,6 @@ struct Ewk_View_Smart_Data {
     } 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
  *
index 4ea4bb2..a4485e7 100644 (file)
       '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',
index df40377..2958a3f 100644 (file)
@@ -15,6 +15,7 @@
 #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"
 
@@ -39,7 +40,7 @@ IPC_STRUCT_TRAITS_BEGIN(CacheParamsEfl)
   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)
@@ -145,7 +146,7 @@ IPC_MESSAGE_ROUTED0(EwkViewMsg_GetSelectionStyle)
 
 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 */
@@ -172,7 +173,7 @@ IPC_SYNC_MESSAGE_CONTROL1_1(EwkHostMsg_DecideNavigationPolicy,
 
 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 */,
index f737c00..28c5cdd 100644 (file)
@@ -1157,7 +1157,7 @@ void EWebView::UpdateWebKitPreferences() {
   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);
 }
 
index aef7848..6950040 100644 (file)
@@ -71,6 +71,9 @@
 #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"
@@ -259,7 +262,7 @@ class EWebView
   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_; }
index ea94a66..bbcde25 100644 (file)
@@ -151,15 +151,15 @@ bool RenderViewObserverEfl::OnMessageReceived(const IPC::Message& message)
 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);
index b3484f0..f2a26ff 100644 (file)
@@ -8,6 +8,7 @@
 #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 {
@@ -41,7 +42,7 @@ class RenderViewObserverEfl: public content::RenderViewObserver {
   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();
diff --git a/tizen_src/impl/tizen_webview/public/tw_content_security_policy.h b/tizen_src/impl/tizen_webview/public/tw_content_security_policy.h
new file mode 100644 (file)
index 0000000..9e6d581
--- /dev/null
@@ -0,0 +1,17 @@
+// 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_
index efe9cf7..c3e77b6 100644 (file)
@@ -369,7 +369,7 @@ void WebContentsDelegateEfl::RequestCertificateConfirm(WebContents* /*web_conten
     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));
@@ -457,7 +457,7 @@ void WebContentsDelegateEfl::DidFirstVisuallyNonEmptyPaint(int32 page_id) {
 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);
index 049e81c..1c2fd32 100644 (file)
@@ -20,6 +20,8 @@
 #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 {
@@ -136,7 +138,7 @@ class WebContentsDelegateEfl
   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;
@@ -177,12 +179,12 @@ class WebContentsDelegateEfl
   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.