Fix WebContentsDelegateEfl because of updates in chromium WebContentsDelegate .
authorViatcheslav Ostapenko <sl.ostapenko@samsung.com>
Tue, 29 Jul 2014 05:27:47 +0000 (01:27 -0400)
committerYoungsoo Choi <kenshin.choi@samsung.com>
Tue, 10 Jul 2018 06:57:09 +0000 (06:57 +0000)
tizen_src/impl/web_contents_delegate_efl.cc
tizen_src/impl/web_contents_delegate_efl.h

index 8f913f35581d8f677f226d5eb4e11ea2bd68d001..b5b9cf238d31dd1c61fc6ad396a5ef7c953e1d95 100755 (executable)
@@ -108,7 +108,8 @@ void WebContentsDelegateEfl::NavigationStateChanged(const WebContents* source, u
   }
 }
 
-void WebContentsDelegateEfl::LoadingStateChanged(WebContents* source) {
+void WebContentsDelegateEfl::LoadingStateChanged(WebContents* source,
+                                                 bool to_different_document) {
   if (source->IsLoading())
     web_view_->SmartCallback<EWebViewCallbacks::LoadProgressStarted>().call();
   else
@@ -142,7 +143,7 @@ bool WebContentsDelegateEfl::ShouldCreateWebContents(
 
 void WebContentsDelegateEfl::WebContentsCreated(
     WebContents* source_contents,
-    int64 source_frame_id,
+    int opener_render_frame_id,
     const string16& frame_name,
     const GURL& target_url,
     WebContents* new_contents) {
@@ -174,10 +175,10 @@ bool WebContentsDelegateEfl::IsFullscreenForTabOrPending(
 }
 
 void WebContentsDelegateEfl::RegisterProtocolHandler(WebContents* web_contents,
-        const std::string& protocol, const GURL& url, const string16& title, bool user_gesture) {
+        const std::string& protocol, const GURL& url, bool user_gesture) {
   scoped_ptr<tizen_webview::Custom_Handlers_Data> protocol_data(
       new tizen_webview::Custom_Handlers_Data(protocol.c_str(),
-          url.host().c_str(), url.spec().c_str(), UTF16ToUTF8(title).c_str()));
+          url.host().c_str(), url.spec().c_str()));
   web_view_->SmartCallback<EWebViewCallbacks::RegisterProtocolHandler>().call(protocol_data.get());
 }
 
@@ -245,21 +246,16 @@ void WebContentsDelegateEfl::OnAuthRequired(net::URLRequest* request,
   web_view_->InvokeAuthCallback(login_delegate, request->url(), realm);
 }
 
-void WebContentsDelegateEfl::DidStartProvisionalLoadForFrame(int64 frame_id,
-                                                             int64 parent_frame_id,
-                                                             bool is_main_frame,
+void WebContentsDelegateEfl::DidStartProvisionalLoadForFrame(RenderFrameHost* render_frame_host,
                                                              const GURL& validated_url,
                                                              bool is_error_page,
-                                                             bool is_iframe_srcdoc,
-                                                             RenderViewHost* render_view_host) {
+                                                             bool is_iframe_srcdoc) {
   web_view_->SmartCallback<EWebViewCallbacks::ProvisionalLoadStarted>().call();
 }
 
-void WebContentsDelegateEfl::DidCommitProvisionalLoadForFrame(int64 frame_id,
-                                                              bool is_main_frame,
+void WebContentsDelegateEfl::DidCommitProvisionalLoadForFrame(RenderFrameHost* render_frame_host,
                                                               const GURL& url,
-                                                              PageTransition transition_type,
-                                                              RenderViewHost* render_view_host) {
+                                                              PageTransition transition_type) {
   web_view_->SmartCallback<EWebViewCallbacks::LoadCommitted>().call();
 }
 
@@ -268,22 +264,17 @@ void WebContentsDelegateEfl::DidNavigateAnyFrame(const LoadCommittedDetails& det
   static_cast<BrowserContextEfl*>(web_contents_->GetBrowserContext())->AddVisitedURLs(params.redirects);
 }
 
-void WebContentsDelegateEfl::DidFailProvisionalLoad(int64 frame_id,
-                                                    const string16& frame_unique_name,
-                                                    bool is_main_frame,
+void WebContentsDelegateEfl::DidFailProvisionalLoad(RenderFrameHost* render_frame_host,
                                                     const GURL& validated_url,
                                                     int error_code,
-                                                    const string16& error_description,
-                                                    RenderViewHost* render_view_host) {
-  DidFailLoad(frame_id, validated_url, is_main_frame, error_code, error_description, render_view_host);
+                                                    const string16& error_description) {
+  DidFailLoad(render_frame_host, validated_url, error_code, error_description);
 }
-void WebContentsDelegateEfl::DidFailLoad(int64 frame_id,
+void WebContentsDelegateEfl::DidFailLoad(RenderFrameHost* render_frame_host,
                                          const GURL& validated_url,
-                                         bool is_main_frame,
                                          int error_code,
-                                         const string16& error_description,
-                                         RenderViewHost* render_view_host) {
-  if (!is_main_frame)
+                                         const string16& error_description) {
+  if (render_frame_host->GetParent())
     return;
 
   scoped_ptr<_Ewk_Error> error(new _Ewk_Error(error_code,
@@ -295,11 +286,9 @@ void WebContentsDelegateEfl::DidFailLoad(int64 frame_id,
   web_view_->SmartCallback<EWebViewCallbacks::LoadError>().call(error.get());
 }
 
-void WebContentsDelegateEfl::DidFinishLoad(int64 frame_id,
-                                           const GURL& validated_url,
-                                           bool is_main_frame,
-                                           RenderViewHost* render_view_host) {
-  if (!is_main_frame)
+void WebContentsDelegateEfl::DidFinishLoad(RenderFrameHost* render_frame_host,
+                                           const GURL& validated_url) {
+  if (!render_frame_host->GetParent())
     return;
 
   NavigationEntry *entry = web_contents()->GetController().GetActiveEntry();
@@ -328,7 +317,7 @@ void WebContentsDelegateEfl::DidStartLoading(RenderViewHost* render_view_host) {
   web_view_->SmartCallback<EWebViewCallbacks::LoadStarted>().call();
 }
 
-void WebContentsDelegateEfl::DidUpdateFaviconURL(int32 page_id, const std::vector<FaviconURL>& candidates) {
+void WebContentsDelegateEfl::DidUpdateFaviconURL(const std::vector<FaviconURL>& candidates) {
   // select and set proper favicon
   for (unsigned int i = 0; i < candidates.size(); ++i) {
     FaviconURL favicon = candidates[i];
@@ -402,14 +391,6 @@ void WebContentsDelegateEfl::HidePopupMenu() {
   web_view_->HidePopupMenu();
 }
 
-void WebContentsDelegateEfl::ShowContextMenu(RenderFrameHost* render_frame_host, const ContextMenuParams& params) {
-  web_view_->ShowContextMenu(params);
-}
-
-void WebContentsDelegateEfl::CancelContextMenu(int request_id) {
-  web_view_->CancelContextMenu(request_id);
-}
-
 void WebContentsDelegateEfl::FindReply(WebContents* web_contents,
                                        int request_id,
                                        int number_of_matches,
@@ -465,7 +446,7 @@ void WebContentsDelegateEfl::OnWrtPluginSyncMessage(const tizen_webview::WrtIpcM
   Send(reply);
 }
 
-void WebContentsDelegateEfl::DidFirstVisuallyNonEmptyPaint(int32 page_id) {
+void WebContentsDelegateEfl::DidFirstVisuallyNonEmptyPaint() {
   web_view_->SmartCallback<EWebViewCallbacks::FrameRendered>().call(0);
 }
 
index e8f4a0cfceb98e0bc7498ac31ed97a01b1937650..58dfde6735339d508fbf38fc8519baf2e110a123 100755 (executable)
@@ -45,7 +45,8 @@ class WebContentsDelegateEfl
                                       unsigned changed_flags) OVERRIDE;
 
   virtual void LoadProgressChanged(WebContents* source, double progress) OVERRIDE;
-  virtual void LoadingStateChanged(WebContents* source) OVERRIDE;
+  virtual void LoadingStateChanged(WebContents* source,
+                                   bool to_different_document) OVERRIDE;
 
   virtual bool ShouldCreateWebContents(
       WebContents*,
@@ -58,7 +59,7 @@ class WebContentsDelegateEfl
 
   virtual void WebContentsCreated(
       WebContents* source_contents,
-      int64 source_frame_id,
+      int opener_render_frame_id,
       const base::string16& frame_name,
       const GURL& target_url,
       WebContents* new_contents) OVERRIDE;
@@ -76,7 +77,6 @@ class WebContentsDelegateEfl
   void RegisterProtocolHandler(WebContents* web_contents,
                                const std::string& protocol,
                                const GURL& url,
-                               const base::string16& title,
                                bool user_gesture) OVERRIDE;
 
   void FindReply(WebContents* web_contents,
@@ -96,59 +96,45 @@ class WebContentsDelegateEfl
   EWebView* web_view() const { return web_view_; }
   WebContents* web_contents() const { return web_contents_; }
 
-  virtual void DidStartProvisionalLoadForFrame(int64 frame_id,
-                                               int64 parent_frame_id,
-                                               bool is_main_frame,
+  virtual void DidStartProvisionalLoadForFrame(RenderFrameHost* render_frame_host,
                                                const GURL& validated_url,
                                                bool is_error_page,
-                                               bool is_iframe_srcdoc,
-                                               RenderViewHost* render_view_host) OVERRIDE;
+                                               bool is_iframe_srcdoc) OVERRIDE;
 
-  virtual void DidCommitProvisionalLoadForFrame(int64 frame_id,
-                                                bool is_main_frame,
+  virtual void DidCommitProvisionalLoadForFrame(RenderFrameHost* render_frame_host,
                                                 const GURL& url,
-                                                PageTransition transition_type,
-                                                RenderViewHost* render_view_host) OVERRIDE;
+                                                PageTransition transition_type) OVERRIDE;
 
   virtual void DidNavigateAnyFrame(const LoadCommittedDetails& details, const FrameNavigateParams& params) OVERRIDE;
   void OnAuthRequired(net::URLRequest* request,
                       const std::string& realm,
                       LoginDelegateEfl* login_delegate);
-  virtual void DidFailProvisionalLoad(int64 frame_id,
-                                      const base::string16& frame_unique_name,
-                                      bool is_main_frame,
+  virtual void DidFailProvisionalLoad(RenderFrameHost* render_frame_host,
                                       const GURL& validated_url,
                                       int error_code,
-                                      const base::string16& error_description,
-                                      RenderViewHost* render_view_host) OVERRIDE;
-  virtual void DidFailLoad(int64 frame_id,
+                                      const base::string16& error_description) OVERRIDE;
+  virtual void DidFailLoad(RenderFrameHost* render_frame_host,
                            const GURL& validated_url,
-                           bool is_main_frame,
                            int error_code,
-                           const base::string16& error_description,
-                           RenderViewHost* render_view_host) OVERRIDE;
+                           const base::string16& error_description) OVERRIDE;
 
-  virtual void DidFinishLoad(int64 frame_id,
-                             const GURL& validated_url,
-                             bool is_main_frame,
-                             RenderViewHost* render_view_host) OVERRIDE;
+  virtual void DidFinishLoad(RenderFrameHost* render_frame_host,
+                             const GURL& validated_url) OVERRIDE;
 
   virtual void DidStartLoading(RenderViewHost* render_view_host) OVERRIDE;
-  virtual void DidUpdateFaviconURL(int32 page_id,
-                                   const std::vector<FaviconURL>& candidates) OVERRIDE;
+  virtual void DidUpdateFaviconURL(const std::vector<FaviconURL>& candidates) OVERRIDE;
   virtual void DidDownloadFavicon(bool success, const GURL& icon_url, const SkBitmap& bitmap);
 
   void OnFormSubmit(const GURL&);
   void SetContentSecurityPolicy(const std::string& policy, tizen_webview::ContentSecurityPolicyType header_type);
   void ShowPopupMenu(const gfx::Rect& rect, blink::TextDirection textDirection, double pageScaleFactor, const std::vector<MenuItem>& items, int data, int selectedIndex, bool multiple);
   void HidePopupMenu();
-  virtual void ShowContextMenu(RenderFrameHost* render_frame_host, const ContextMenuParams& params) OVERRIDE;
-  virtual void CancelContextMenu(int request_id) OVERRIDE;
+
   void set_new_window_policy(bool policy) { should_open_new_window_ = policy; }
   bool get_new_window_policy() const { return should_open_new_window_; }
   JavaScriptDialogManager* GetJavaScriptDialogManager() OVERRIDE;
 
-  void DidFirstVisuallyNonEmptyPaint(int32 page_id) OVERRIDE;
+  void DidFirstVisuallyNonEmptyPaint() OVERRIDE;
 
   bool OnMessageReceived(const IPC::Message& message) OVERRIDE;
   void OnPrintedMetafileReceived(const DidPrintPagesParams& params);