For AURA, WebContentsViewEfl is not used as it is replaced by WebContentsViewAura,
hence its delegate WebContentsViewEflDelegate cannot be instantiated without it.
So this patch moves the interfaces from WebContentsViewEflDelegate to WebContentsEflDelegate,
and called via WebContentsImplEfl::GetDelegate().
As there are many delegate classes under tizen_src causing confusion sometimes;
removing WebContentsViewEflDelegate improves code structure and understandability.
Reference: https://review.tizen.org/gerrit/274379
Change-Id: I0f8e2220ece36594a710d179a4706878b14a9ab4
Signed-off-by: Bakka Uday Kiran <b.kiran@samsung.com>
"//tizen_src/chromium_impl/content/browser/javascript_dialog/javascript_modal_dialog.cc",
"//tizen_src/chromium_impl/content/browser/javascript_dialog/javascript_modal_dialog.h",
"//tizen_src/chromium_impl/content/browser/public/browser/web_contents_efl_delegate.h",
- "//tizen_src/chromium_impl/content/browser/public/browser/web_contents_view_efl_delegate.h",
"//tizen_src/chromium_impl/content/browser/renderer_host/edge_effect.cc",
"//tizen_src/chromium_impl/content/browser/renderer_host/edge_effect.h",
"//tizen_src/chromium_impl/content/browser/renderer_host/rwhv_aura_offscreen_helper_efl.cc",
#include "chromium_impl/content/browser/web_contents/web_contents_impl_efl.h"
#include "content/public/browser/web_contents.h"
#include "content/public/browser/web_contents_delegate.h"
-#include "ewk/efl_integration/web_contents_view_efl_delegate_ewk.h"
+#include "ewk/efl_integration/web_contents_efl_delegate_ewk.h"
namespace content {
void ScreenOrientationDelegateEfl::Lock(
WebContents* web_contents,
device::mojom::ScreenOrientationLockType lock_orientation) {
-#if !defined(USE_AURA)
- WebContentsImpl* wci = static_cast<WebContentsImpl*>(web_contents);
- WebContentsViewEfl* wcve = static_cast<WebContentsViewEfl*>(wci->GetView());
- if (wcve->GetEflDelegate())
- wcve->GetEflDelegate()->OrientationLock(lock_orientation);
-#endif
+ WebContentsImplEfl* wcie = static_cast<WebContentsImplEfl*>(web_contents);
+ if (wcie->GetEflDelegate())
+ wcie->GetEflDelegate()->OrientationLock(lock_orientation);
}
bool ScreenOrientationDelegateEfl::ScreenOrientationProviderSupported(
}
void ScreenOrientationDelegateEfl::Unlock(WebContents* web_contents) {
-#if !defined(USE_AURA)
- WebContentsImpl* wci = static_cast<WebContentsImpl*>(web_contents);
- WebContentsViewEfl* wcve = static_cast<WebContentsViewEfl*>(wci->GetView());
- if (wcve->GetEflDelegate())
- wcve->GetEflDelegate()->OrientationUnlock();
-#endif
+ WebContentsImplEfl* wcie = static_cast<WebContentsImplEfl*>(web_contents);
+ if (wcie->GetEflDelegate())
+ wcie->GetEflDelegate()->OrientationUnlock();
}
} // namespace content
#ifndef CONTENT_PUBLIC_BROWSER_WEB_CONTENTS_EFL_DELEGATE_H_
#define CONTENT_PUBLIC_BROWSER_WEB_CONTENTS_EFL_DELEGATE_H_
+#include <vector>
+
#include "base/callback.h"
#include "content/common/content_export.h"
+#include "content/public/browser/context_menu_params.h"
+#include "services/device/public/mojom/screen_orientation_lock_types.mojom.h"
+#include "third_party/blink/public/common/context_menu_data/menu_item_info.h"
+#include "third_party/blink/public/common/input/web_gesture_event.h"
+#include "third_party/blink/public/common/input/web_input_event.h"
+#include "ui/gfx/geometry/rect.h"
class GURL;
namespace content {
+class RenderFrameHost;
class WebContents;
class CONTENT_EXPORT WebContentsEflDelegate {
// This is needed when a window is created with window.open or target:_blank,
// where RenderWidgetHostViewXXX objects are created earlier in the call chain.
virtual void SetUpSmartObject(void* platform_data, void* native_view) = 0;
+
+ virtual void ShowPopupMenu(RenderFrameHost* render_frame_host,
+ const gfx::Rect& bounds,
+ int item_height,
+ double item_font_size,
+ int selected_item,
+ const std::vector<blink::MenuItemInfo>& items,
+ bool right_aligned,
+ bool allow_multiple_selection) = 0;
+ virtual void HidePopupMenu() = 0;
+
+ virtual void CancelContextMenu(int request_id) = 0;
+
+ virtual void QuerySelectionStyle() = 0;
+ virtual void HandleZoomGesture(blink::WebGestureEvent& event) = 0;
+
+ virtual bool UseKeyPadWithoutUserAction() = 0;
+
+ virtual void ShowContextMenu(const ContextMenuParams& params) = 0;
+
+ virtual void OrientationLock(device::mojom::ScreenOrientationLockType) = 0;
+ virtual void OrientationUnlock() = 0;
};
} // namespace content
+++ /dev/null
-// Copyright 2015 Samsung Electronics. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef CONTENT_PUBLIC_BROWSER_WEB_CONTENTS_VIEW_EFL_DELEGATE_H_
-#define CONTENT_PUBLIC_BROWSER_WEB_CONTENTS_VIEW_EFL_DELEGATE_H_
-
-#include <vector>
-
-#include "content/common/content_export.h"
-#include "content/public/browser/context_menu_params.h"
-#include "services/device/public/mojom/screen_orientation_lock_types.mojom.h"
-#include "third_party/blink/public/common/context_menu_data/menu_item_info.h"
-#include "third_party/blink/public/common/input/web_gesture_event.h"
-#include "third_party/blink/public/common/input/web_input_event.h"
-#include "ui/gfx/geometry/rect.h"
-
-namespace content {
-
-class RenderFrameHost;
-
-class WebContentsViewEflDelegate {
- public:
- WebContentsViewEflDelegate() {};
- virtual ~WebContentsViewEflDelegate() {};
-
- virtual void ShowPopupMenu(RenderFrameHost* render_frame_host,
- const gfx::Rect& bounds,
- int item_height,
- double item_font_size,
- int selected_item,
- const std::vector<blink::MenuItemInfo>& items,
- bool right_aligned,
- bool allow_multiple_selection) = 0;
- virtual void HidePopupMenu() = 0;
-
- virtual void SetPageTitle(const std::u16string& title) = 0;
- virtual void CancelContextMenu(int request_id) = 0;
-
- virtual void QuerySelectionStyle() = 0;
- virtual void HandleZoomGesture(blink::WebGestureEvent& event) = 0;
-
- virtual bool UseKeyPadWithoutUserAction() = 0;
-
- virtual void ShowContextMenu(const ContextMenuParams& params) = 0;
-
- virtual void OrientationLock(device::mojom::ScreenOrientationLockType) = 0;
- virtual void OrientationUnlock() = 0;
-
- virtual void OnOverscrolled(
- const gfx::Vector2dF& accumulated_overscroll,
- const gfx::Vector2dF& latest_overscroll_delta) = 0;
-};
-
-} // namespace content
-
-#endif // CONTENT_PUBLIC_BROWSER_WEB_CONTENTS_VIEW_EFL_DELEGATE_H_
"web_contents_efl_delegate_ewk.h",
"web_contents_view_delegate_ewk.cc",
"web_contents_view_delegate_ewk.h",
- "web_contents_view_efl_delegate_ewk.cc",
- "web_contents_view_efl_delegate_ewk.h",
# Make use of Android webview"s simplified pref class.
"browser/autofill/autofill_client_efl.cc",
#include "ui/platform_window/platform_window_init_properties.h"
#include "web_contents_delegate_efl.h"
#include "web_contents_efl_delegate_ewk.h"
-#include "web_contents_view_efl_delegate_ewk.h"
#include <Ecore_Evas.h>
#include <Elementary.h>
}
web_contents_delegate_.reset(new WebContentsDelegateEfl(this));
web_contents_->SetDelegate(web_contents_delegate_.get());
-#if !defined(USE_AURA)
- GetWebContentsViewEfl()->SetEflDelegate(
- new WebContentsViewEflDelegateEwk(this));
-#endif
WebContentsImplEfl* wc_efl =
static_cast<WebContentsImplEfl*>(web_contents_.get());
wc_efl->SetEflDelegate(new WebContentsEflDelegateEwk(this));
// found in the LICENSE file.
#include "web_contents_efl_delegate_ewk.h"
+#include "ewk/efl_integration/private/webview_delegate_ewk.h"
#include <tuple>
Evas_Object* _native_view = static_cast<Evas_Object*>(native_view);
evas_object_smart_member_add(_native_view, new_web_view->evas_object());
}
+
+void WebContentsEflDelegateEwk::ShowPopupMenu(
+ content::RenderFrameHost* render_frame_host,
+ const gfx::Rect& bounds,
+ int item_height,
+ double item_font_size,
+ int selected_item,
+ const std::vector<blink::MenuItemInfo>& items,
+ bool right_aligned,
+ bool allow_multiple_selection) {
+ web_view_->ShowPopupMenu(items, selected_item, allow_multiple_selection);
+}
+
+void WebContentsEflDelegateEwk::HidePopupMenu() {
+ web_view_->HidePopupMenu();
+}
+
+void WebContentsEflDelegateEwk::CancelContextMenu(int request_id) {
+ web_view_->CancelContextMenu(request_id);
+}
+
+void WebContentsEflDelegateEwk::QuerySelectionStyle() {
+ web_view_->QuerySelectionStyle();
+}
+
+void WebContentsEflDelegateEwk::HandleZoomGesture(
+ blink::WebGestureEvent& event) {
+ web_view_->HandleZoomGesture(event);
+}
+
+bool WebContentsEflDelegateEwk::UseKeyPadWithoutUserAction() {
+ return web_view_->GetSettings()->useKeyPadWithoutUserAction();
+}
+
+void WebContentsEflDelegateEwk::ShowContextMenu(
+ const content::ContextMenuParams& params) {
+ web_view_->ShowContextMenu(params);
+}
+
+void WebContentsEflDelegateEwk::OrientationLock(
+ device::mojom::ScreenOrientationLockType orientation) {
+ // Conversion of WebScreenOrientationLockType to
+ // list of orientations.
+ // This is related to the commentary to the M42 version
+ // (currently non-existent) of prototype
+ // Eina_Bool (*orientation_lock)(Ewk_View_Smart_Data* sd, int orientations)
+ // InvalidOrientation = 0,
+ // OrientationPortraitPrimary = 1,
+ // OrientationLandscapePrimary = 1 << 1,
+ // OrientationPortraitSecondary = 1 << 2,
+ // OrientationLandscapeSecondary = 1 << 3,
+ // OrientationPortrait =
+ // OrientationPortraitPrimary | OrientationPortraitSecondary,
+ // OrientationLandscape =
+ // OrientationLandscapePrimary | OrientationLandscapeSecondary,
+ // OrientationNatural =
+ // OrientationPortraitPrimary | OrientationLandscapePrimary,
+ // OrientationAny = OrientationPortrait | OrientationLandscape
+ int orientation_convert[9] = {0, 1, 4, 2, 8, 15, 10, 5, 3};
+
+ WebViewDelegateEwk::GetInstance().RequestHandleOrientationLock(
+ web_view_, orientation_convert[static_cast<int>(orientation)]);
+}
+
+void WebContentsEflDelegateEwk::OrientationUnlock() {
+ WebViewDelegateEwk::GetInstance().RequestHandleOrientationUnlock(web_view_);
+}
\ No newline at end of file
void SetUpSmartObject(void*platform_data, void* native_view) override;
+ void ShowPopupMenu(content::RenderFrameHost* render_frame_host,
+ const gfx::Rect& bounds,
+ int item_height,
+ double item_font_size,
+ int selected_item,
+ const std::vector<blink::MenuItemInfo>& items,
+ bool right_aligned,
+ bool allow_multiple_selection) override;
+ void HidePopupMenu() override;
+
+ void CancelContextMenu(int request_id) override;
+
+ void QuerySelectionStyle() override;
+
+ void HandleZoomGesture(blink::WebGestureEvent& event) override;
+
+ bool UseKeyPadWithoutUserAction() override;
+
+ void ShowContextMenu(const content::ContextMenuParams& params) override;
+
+ virtual void OrientationLock(
+ device::mojom::ScreenOrientationLockType) override;
+ virtual void OrientationUnlock() override;
+
private:
EWebView* web_view_;
+++ /dev/null
-// Copyright 2015 Samsung Electronics. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "web_contents_view_efl_delegate_ewk.h"
-
-#include "eweb_view.h"
-#include "ewk/efl_integration/private/webview_delegate_ewk.h"
-
-WebContentsViewEflDelegateEwk::WebContentsViewEflDelegateEwk(EWebView* wv)
- : web_view_(wv) {
-}
-
-void WebContentsViewEflDelegateEwk::ShowPopupMenu(
- content::RenderFrameHost* render_frame_host,
- const gfx::Rect& bounds,
- int item_height,
- double item_font_size,
- int selected_item,
- const std::vector<blink::MenuItemInfo>& items,
- bool right_aligned,
- bool allow_multiple_selection) {
- web_view_->ShowPopupMenu(items, selected_item, allow_multiple_selection);
-}
-
-void WebContentsViewEflDelegateEwk::HidePopupMenu() {
- web_view_->HidePopupMenu();
-}
-
-void WebContentsViewEflDelegateEwk::SetPageTitle(const std::u16string& title) {
- web_view_->SmartCallback<EWebViewCallbacks::TitleChange>().
- call(base::UTF16ToUTF8(title).c_str());
-}
-
-void WebContentsViewEflDelegateEwk::CancelContextMenu(int request_id) {
- web_view_->CancelContextMenu(request_id);
-}
-
-void WebContentsViewEflDelegateEwk::QuerySelectionStyle() {
- web_view_->QuerySelectionStyle();
-}
-
-void WebContentsViewEflDelegateEwk::HandleZoomGesture(blink::WebGestureEvent& event) {
- web_view_->HandleZoomGesture(event);
-}
-
-bool WebContentsViewEflDelegateEwk::UseKeyPadWithoutUserAction() {
- return web_view_->GetSettings()->useKeyPadWithoutUserAction();
-}
-
-void WebContentsViewEflDelegateEwk::ShowContextMenu(
- const content::ContextMenuParams& params) {
- web_view_->ShowContextMenu(params);
-}
-
-void WebContentsViewEflDelegateEwk::OrientationLock(
- device::mojom::ScreenOrientationLockType orientation) {
- // Conversion of WebScreenOrientationLockType to
- // list of orientations.
- // This is related to the commentary to the M42 version
- // (currently non-existent) of prototype
- // Eina_Bool (*orientation_lock)(Ewk_View_Smart_Data* sd, int orientations)
- // InvalidOrientation = 0,
- // OrientationPortraitPrimary = 1,
- // OrientationLandscapePrimary = 1 << 1,
- // OrientationPortraitSecondary = 1 << 2,
- // OrientationLandscapeSecondary = 1 << 3,
- // OrientationPortrait =
- // OrientationPortraitPrimary | OrientationPortraitSecondary,
- // OrientationLandscape =
- // OrientationLandscapePrimary | OrientationLandscapeSecondary,
- // OrientationNatural =
- // OrientationPortraitPrimary | OrientationLandscapePrimary,
- // OrientationAny = OrientationPortrait | OrientationLandscape
- int orientation_convert[9] = { 0, 1, 4, 2, 8, 15, 10, 5, 3 };
-
- WebViewDelegateEwk::GetInstance().RequestHandleOrientationLock(
- web_view_,
- orientation_convert[static_cast<int>(orientation)]);
-}
-
-void WebContentsViewEflDelegateEwk::OrientationUnlock() {
- WebViewDelegateEwk::GetInstance().RequestHandleOrientationUnlock(web_view_);
-}
-
-void WebContentsViewEflDelegateEwk::OnOverscrolled(
- const gfx::Vector2dF& accumulated_overscroll,
- const gfx::Vector2dF& latest_overscroll_delta) {
- web_view_->OnOverscrolled(accumulated_overscroll, latest_overscroll_delta);
-}
+++ /dev/null
-// Copyright 2015 Samsung Electronics. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef WEB_CONTENTS_VIEW_EFL_DELEGATE_EWK
-#define WEB_CONTENTS_VIEW_EFL_DELEGATE_EWK
-
-#include "content/public/browser/web_contents_view_efl_delegate.h"
-#include "third_party/blink/public/common/context_menu_data/menu_item_info.h"
-
-class EWebView;
-
-namespace content {
-class RenderFrameHost;
-}
-
-class WebContentsViewEflDelegateEwk
- : public content::WebContentsViewEflDelegate {
- public:
- WebContentsViewEflDelegateEwk(EWebView*);
-
- void ShowPopupMenu(content::RenderFrameHost* render_frame_host,
- const gfx::Rect& bounds,
- int item_height,
- double item_font_size,
- int selected_item,
- const std::vector<blink::MenuItemInfo>& items,
- bool right_aligned,
- bool allow_multiple_selection) override;
- void HidePopupMenu() override;
-
- void SetPageTitle(const std::u16string& title) override;
-
- void CancelContextMenu(int request_id) override;
-
- void QuerySelectionStyle() override;
-
- void HandleZoomGesture(blink::WebGestureEvent& event) override;
-
- bool UseKeyPadWithoutUserAction() override;
-
- void ShowContextMenu(const content::ContextMenuParams& params) override;
-
- virtual void OrientationLock(
- device::mojom::ScreenOrientationLockType) override;
- virtual void OrientationUnlock() override;
-
- private:
- void OnOverscrolled(const gfx::Vector2dF& accumulated_overscroll,
- const gfx::Vector2dF& latest_overscroll_delta) override;
-
- EWebView* web_view_;
-};
-
-#endif // WEB_CONTENTS_VIEW_EFL_DELEGATE_EWK
-