"//tizen_src/chromium_impl/content/browser/input_picker/input_picker_base.h",
"//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/webview_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_common_helper_efl.cc",
#include "content/browser/date_time_chooser_efl.h"
#include "chromium_impl/content/browser/web_contents/web_contents_impl_efl.h"
#include "content/browser/web_contents/web_contents_impl.h"
-#include "ewk/efl_integration/web_contents_efl_delegate_ewk.h"
+#include "ewk/efl_integration/webview_delegate_efl.h"
namespace content {
#include "content/browser/screen_orientation/screen_orientation_provider.h"
#include "content/public/browser/web_contents.h"
#include "content/public/browser/web_contents_delegate.h"
-#include "ewk/efl_integration/web_contents_efl_delegate_ewk.h"
+#include "ewk/efl_integration/webview_delegate_efl.h"
namespace content {
case ui::ET_GESTURE_LONG_PRESS: {
ClearSelectionViaEWebView();
HideHandleAndContextMenu();
- // Long press data will call to WebContentsViewDelegateEwk.
+ // Long press data will call to WebContentsViewDelegateEfl.
// It is called by the chain that handles FrameHostMsg_ContextMenu.
break;
}
#include "content/public/browser/notification_types.h"
#include "content/public/browser/storage_partition.h"
#include "content/public/browser/web_contents_delegate.h"
-#include "content/public/browser/web_contents_efl_delegate.h"
+#include "content/public/browser/webview_delegate.h"
#include "content/public/common/content_client.h"
#include "content/public/common/result_codes.h"
#include "net/http/http_util.h"
WebContentsImplEfl::~WebContentsImplEfl() = default;
-void WebContentsImplEfl::SetEflDelegate(WebContentsEflDelegate* delegate) {
- efl_delegate_.reset(delegate);
+void WebContentsImplEfl::SetWebviewDelegate(WebViewDelegate* delegate) {
+ webview_delegate_ = delegate;
}
std::unique_ptr<WebContents> WebContentsImplEfl::Clone() {
LOG(INFO) << __FUNCTION__ << ", opener:" << opener
<< ", target url: " << params.target_url;
WebContents* new_contents = nullptr;
- WebContentsEflDelegate::WebContentsCreateCallback callback =
- base::BindRepeating(&WebContentsImplEfl::HandleNewWebContentsCreate,
- base::Unretained(this), opener, std::cref(params),
- is_new_browsing_instance, has_user_gesture,
- base::RetainedRef(session_storage_namespace),
- &new_contents);
-
- if (efl_delegate_) {
- if (efl_delegate_->WebContentsCreateAsync(std::move(callback))) {
+ WebViewDelegate::WebContentsCreateCallback callback = base::BindRepeating(
+ &WebContentsImplEfl::HandleNewWebContentsCreate, base::Unretained(this),
+ opener, std::cref(params), is_new_browsing_instance, has_user_gesture,
+ base::RetainedRef(session_storage_namespace), &new_contents);
+
+ if (webview_delegate_) {
+ if (webview_delegate_->WebContentsCreateAsync(std::move(callback))) {
return new_contents ? &(static_cast<WebContentsImpl*>(new_contents)
->GetPrimaryFrameTree())
: nullptr;
namespace content {
class SiteInstance;
-class WebContentsEflDelegate;
+class WebViewDelegate;
class CONTENT_EXPORT WebContentsImplEfl : public WebContentsImpl {
public:
web_contents_for_new_window_ = web_contents;
}
- void SetEflDelegate(WebContentsEflDelegate*);
- WebContentsEflDelegate* GetEflDelegate() { return efl_delegate_.get(); }
+ void SetWebviewDelegate(WebViewDelegate*);
+ WebViewDelegate* GetEflDelegate() { return webview_delegate_; }
// Overrides for WebContents
std::unique_ptr<WebContents> Clone() override;
void* platform_data_for_new_window_ = nullptr;
WebContentsImpl* web_contents_for_new_window_ = nullptr;
- std::unique_ptr<WebContentsEflDelegate> efl_delegate_;
+ // Delegate owned by EWebView
+ WebViewDelegate* webview_delegate_;
};
} // namespace content
popup_client_.set_disconnect_handler(base::BindOnce(
&WebContentsViewAuraHelperEfl::HidePopupMenu, base::Unretained(this)));
- if (efl_delegate_) {
- efl_delegate_->ShowPopupMenu(
+ if (webview_delegate_) {
+ webview_delegate_->ShowPopupMenu(
render_frame_host, bounds, item_height, item_font_size, selected_item,
std::move(items), right_aligned, allow_multiple_selection);
}
}
void WebContentsViewAuraHelperEfl::HidePopupMenu() {
- if (efl_delegate_)
- efl_delegate_->HidePopupMenu();
+ if (webview_delegate_)
+ webview_delegate_->HidePopupMenu();
popup_client_.reset();
}
}
#endif
-void WebContentsViewAuraHelperEfl::SetEflDelegate(
- WebContentsEflDelegate* delegate) {
- efl_delegate_ = delegate;
+void WebContentsViewAuraHelperEfl::SetWebviewDelegate(WebViewDelegate* delegate) {
+ webview_delegate_ = delegate;
}
-WebContentsEflDelegate* WebContentsViewAuraHelperEfl::GetEflDelegate() {
- return efl_delegate_;
+WebViewDelegate* WebContentsViewAuraHelperEfl::GetEflDelegate() {
+ return webview_delegate_;
}
void WebContentsViewAuraHelperEfl::UpdateDragDest(RenderViewHost* host) {
void WebContentsViewAuraHelperEfl::ShowContextMenu(
const ContextMenuParams& params) {
- if (efl_delegate_)
- efl_delegate_->ShowContextMenu(params);
+ if (webview_delegate_)
+ webview_delegate_->ShowContextMenu(params);
}
void WebContentsViewAuraHelperEfl::CancelContextMenu(int request_id) {
- if (efl_delegate_)
- efl_delegate_->CancelContextMenu(request_id);
+ if (webview_delegate_)
+ webview_delegate_->CancelContextMenu(request_id);
}
bool WebContentsViewAuraHelperEfl::ImePanelEnabled() const {
#if !defined(EWK_BRINGUP)
- if (efl_delegate_)
- return efl_delegate_->ImePanelEnabled();
+ if (webview_delegate_)
+ return webview_delegate_->ImePanelEnabled();
#endif
return true;
}
bool WebContentsViewAuraHelperEfl::ImeHandleKeyEventEnabled() const {
#if !defined(EWK_BRINGUP)
- if (efl_delegate_)
- return efl_delegate_->ImeHandleKeyEventEnabled();
+ if (webview_delegate_)
+ return webview_delegate_->ImeHandleKeyEventEnabled();
#endif
return true;
}
void WebContentsViewAuraHelperEfl::OnOverscrolled(
const gfx::Vector2dF& accumulated_overscroll,
const gfx::Vector2dF& latest_overscroll_delta) {
- if (efl_delegate_) {
- efl_delegate_->OnOverscrolled(accumulated_overscroll,
+ if (webview_delegate_) {
+ webview_delegate_->OnOverscrolled(accumulated_overscroll,
latest_overscroll_delta);
}
}
#include "content/common/buildflags.h"
#include "content/public/browser/render_frame_host.h"
#include "content/public/browser/render_view_host.h"
-#include "content/public/browser/web_contents_efl_delegate.h"
+#include "content/public/browser/webview_delegate.h"
#include "mojo/public/cpp/bindings/pending_remote.h"
#include "mojo/public/cpp/bindings/remote.h"
#include "third_party/blink/public/common/page/drag_operation.h"
#include "third_party/blink/public/mojom/choosers/popup_menu.mojom.h"
#include "third_party/blink/public/mojom/drag/drag.mojom.h"
-#include "tizen_src/chromium_impl/content/public/browser/web_contents_efl_delegate.h"
#include "ui/gfx/image/image_skia.h"
namespace content {
bool ImePanelEnabled() const;
bool ImeHandleKeyEventEnabled() const;
- void SetEflDelegate(WebContentsEflDelegate*);
- WebContentsEflDelegate* GetEflDelegate();
+ void SetWebviewDelegate(WebViewDelegate*);
+ WebViewDelegate* GetEflDelegate();
void SetViewDelegate(WebContentsViewDelegate* delegate);
void UpdateDragDest(RenderViewHost* host);
void StartDragging(const DropData& drop_data,
WebContentsViewAura* wcv_aura_ = nullptr;
WebContentsImpl* web_contents_ = nullptr;
- // Delegate owned by WebContentsImplEfl
- WebContentsEflDelegate* efl_delegate_ = nullptr;
+ // Delegate owned by EWebView
+ WebViewDelegate* webview_delegate_ = nullptr;
// Our optional, generic views wrapper.
WebContentsViewDelegate* view_delegate_ = nullptr;
+++ /dev/null
-// Copyright (c) 2012 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 CONTENT_PUBLIC_BROWSER_WEB_CONTENTS_EFL_DELEGATE_H_
-#define CONTENT_PUBLIC_BROWSER_WEB_CONTENTS_EFL_DELEGATE_H_
-
-#include <vector>
-
-#include "base/functional/callback.h"
-#include "content/browser/date_time_chooser_efl.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 "third_party/blink/public/mojom/choosers/popup_menu.mojom.h"
-#include "ui/base/ime/text_input_type.h"
-#include "ui/gfx/geometry/rect.h"
-
-class GURL;
-
-namespace content {
-
-class RenderFrameHost;
-class WebContents;
-
-class CONTENT_EXPORT WebContentsEflDelegate {
- public:
- virtual ~WebContentsEflDelegate() {}
-
- // Callback function allowing the embedder to create new web contents object
- // in an asynchronous manner. The callback takes one opaque parameter
- // intended to pass platform specific data to WebContents constructor. It
- // returns a pointer to new WebContents created by the function. The caller
- // is expected to take ownership of the returned object.
- typedef base::RepeatingCallback<WebContents*(void*)>
- WebContentsCreateCallback;
-
- // Allows the delegate to control new web contents creation in an
- // asynchronous manner. The function is called with a callback object the
- // delegate may keep if it wants to delay creation of new web contents. In
- // such case the function should return true. Returning false means new web
- // contents creation should be handled in normal, synchronous manner.
- virtual bool WebContentsCreateAsync(WebContentsCreateCallback) = 0;
-
- // Make it possible to early hook native_view and its associated smart
- // parent.
- // 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,
- std::vector<blink::mojom::MenuItemPtr> items,
- bool right_aligned,
- bool allow_multiple_selection) = 0;
- virtual void HidePopupMenu() = 0;
-
- virtual void CancelContextMenu(int request_id) = 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 OpenDateTimeDialog(
- ui::TextInputType dialog_type,
- double dialog_value,
- content::DateTimeChooserEfl* date_chooser) = 0;
-
- virtual void OnOverscrolled(
- const gfx::Vector2dF& accumulated_overscroll,
- const gfx::Vector2dF& latest_overscroll_delta) = 0;
-};
-
-} // namespace content
-
-#endif // CONTENT_PUBLIC_BROWSER_WEB_CONTENTS_EFL_DELEGATE_H_
--- /dev/null
+// Copyright (c) 2012 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 CONTENT_PUBLIC_BROWSER_WEBVIEW_DELEGATE_H_
+#define CONTENT_PUBLIC_BROWSER_WEBVIEW_DELEGATE_H_
+
+#include <vector>
+
+#include "base/functional/callback.h"
+#include "content/browser/date_time_chooser_efl.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 "third_party/blink/public/mojom/choosers/popup_menu.mojom.h"
+#include "ui/base/ime/text_input_type.h"
+#include "ui/gfx/geometry/rect.h"
+
+class GURL;
+
+namespace content {
+
+class RenderFrameHost;
+class WebContents;
+
+class CONTENT_EXPORT WebViewDelegate {
+ public:
+ virtual ~WebViewDelegate() {}
+
+ // Callback function allowing the embedder to create new web contents object
+ // in an asynchronous manner. The callback takes one opaque parameter
+ // intended to pass platform specific data to WebContents constructor. It
+ // returns a pointer to new WebContents created by the function. The caller
+ // is expected to take ownership of the returned object.
+ typedef base::RepeatingCallback<WebContents*(void*)>
+ WebContentsCreateCallback;
+
+ // Allows the delegate to control new web contents creation in an
+ // asynchronous manner. The function is called with a callback object the
+ // delegate may keep if it wants to delay creation of new web contents. In
+ // such case the function should return true. Returning false means new web
+ // contents creation should be handled in normal, synchronous manner.
+ virtual bool WebContentsCreateAsync(WebContentsCreateCallback) = 0;
+
+ virtual void ShowPopupMenu(RenderFrameHost* render_frame_host,
+ const gfx::Rect& bounds,
+ int item_height,
+ double item_font_size,
+ int selected_item,
+ std::vector<blink::mojom::MenuItemPtr> items,
+ bool right_aligned,
+ bool allow_multiple_selection) = 0;
+ virtual void HidePopupMenu() = 0;
+
+ virtual void CancelContextMenu(int request_id) = 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 OpenDateTimeDialog(
+ ui::TextInputType dialog_type,
+ double dialog_value,
+ content::DateTimeChooserEfl* date_chooser) = 0;
+
+ virtual void OnOverscrolled(
+ const gfx::Vector2dF& accumulated_overscroll,
+ const gfx::Vector2dF& latest_overscroll_delta) = 0;
+};
+
+} // namespace content
+
+#endif // CONTENT_PUBLIC_BROWSER_WEBVIEW_DELEGATE_H_
"usermedia_permission_popup.h",
"web_contents_delegate_efl.cc",
"web_contents_delegate_efl.h",
- "web_contents_efl_delegate_ewk.cc",
- "web_contents_efl_delegate_ewk.h",
- "web_contents_view_delegate_ewk.cc",
- "web_contents_view_delegate_ewk.h",
+ "web_contents_view_delegate_efl.cc",
+ "web_contents_view_delegate_efl.h",
+ "webview_delegate_efl.cc",
+ "webview_delegate_efl.h",
# Make use of Android webview"s simplified pref class.
"browser/autofill/autocomplete_history_manager_factory.cc",
#include "services/network/public/cpp/features.h"
#include "shared_url_loader_factory_efl.h"
#include "web_contents_delegate_efl.h"
-#include "web_contents_view_delegate_ewk.h"
+#include "web_contents_view_delegate_efl.h"
#if defined(TIZEN_AUTOFILL)
#include "components/autofill/core/common/autofill_switches.h"
std::unique_ptr<WebContentsViewDelegate>
ContentBrowserClientEfl::GetWebContentsViewDelegate(WebContents* web_contents) {
- return std::make_unique<WebContentsViewDelegateEwk>(
+ return std::make_unique<WebContentsViewDelegateEfl>(
WebViewFromWebContents(web_contents));
}
#include "ui/ozone/platform/efl/efl_event_handler.h"
#include "ui/platform_window/platform_window_init_properties.h"
#include "web_contents_delegate_efl.h"
-#include "web_contents_efl_delegate_ewk.h"
+#include "webview_delegate_efl.h"
#include <iostream>
#endif
int EWebView::find_request_id_counter_ = 0;
-content::WebContentsEflDelegate::WebContentsCreateCallback
+content::WebViewDelegate::WebContentsCreateCallback
EWebView::create_new_window_web_contents_cb_ =
base::BindRepeating(&NullCreateWebContents);
}
bool EWebView::CreateNewWindow(
- content::WebContentsEflDelegate::WebContentsCreateCallback cb) {
+ content::WebViewDelegate::WebContentsCreateCallback cb) {
create_new_window_web_contents_cb_ = cb;
Evas_Object* new_object = NULL;
SmartCallback<EWebViewCallbacks::CreateNewWindow>().call(&new_object);
<< "Aborting execution ...";
}
}
+
web_contents_delegate_.reset(new WebContentsDelegateEfl(this));
web_contents_->SetDelegate(web_contents_delegate_.get());
+
+ // EWebView's delegate. Calls to WebContentsImplEfl and
+ // WebContentsViewAuraHelperEfl are delegated to this class.
+ // For more details, refer commit message of patch 301647.
+ webview_delegate_.reset(new WebViewDelegateEfl(this));
WebContentsImplEfl* wc_efl =
static_cast<WebContentsImplEfl*>(web_contents_.get());
- wc_efl->SetEflDelegate(new WebContentsEflDelegateEwk(this));
- wcva()->wcva_helper()->SetEflDelegate(wc_efl->GetEflDelegate());
+ wc_efl->SetWebviewDelegate(webview_delegate_.get());
+ wcva()->wcva_helper()->SetWebviewDelegate(webview_delegate_.get());
back_forward_list_.reset(new _Ewk_Back_Forward_List(web_contents_.get()));
#include "content/public/browser/context_menu_params.h"
#include "content/public/browser/navigation_controller.h"
#include "content/public/browser/web_contents_delegate.h"
-#include "content/public/browser/web_contents_efl_delegate.h"
+#include "content/public/browser/webview_delegate.h"
#include "content/public/common/input_event_ack_state.h"
#include "content_browser_client_efl.h"
#include "context_menu_controller_efl.h"
// call this once after created and before use
void Initialize();
- bool CreateNewWindow(
- content::WebContentsEflDelegate::WebContentsCreateCallback);
+ bool CreateNewWindow(content::WebViewDelegate::WebContentsCreateCallback);
static Evas_Object* GetHostWindowDelegate(const content::WebContents*);
content::WebContentsViewAura* wcva() const;
scoped_refptr<Ewk_Context> context_;
std::unique_ptr<content::WebContents> web_contents_;
std::unique_ptr<content::WebContentsDelegateEfl> web_contents_delegate_;
+ std::unique_ptr<content::WebViewDelegate> webview_delegate_;
std::string pending_url_request_;
std::unique_ptr<Ewk_Settings> settings_;
std::unique_ptr<_Ewk_Frame> frame_;
std::unique_ptr<_Ewk_Back_Forward_List> back_forward_list_;
- static content::WebContentsEflDelegate::WebContentsCreateCallback
+ static content::WebViewDelegate::WebContentsCreateCallback
create_new_window_web_contents_cb_;
#if defined(TIZEN_VIDEO_HOLE)
+++ /dev/null
-// Copyright (c) 2012 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.
-
-#include "web_contents_efl_delegate_ewk.h"
-#include "ewk/efl_integration/private/webview_delegate_ewk.h"
-
-#include <tuple>
-
-#include "eweb_view.h"
-
-WebContentsEflDelegateEwk::WebContentsEflDelegateEwk(EWebView* wv)
- : web_view_(wv) {
-}
-
-bool WebContentsEflDelegateEwk::WebContentsCreateAsync(
- content::WebContentsEflDelegate::WebContentsCreateCallback callback) {
- return web_view_->CreateNewWindow(std::move(callback));
-}
-
-void WebContentsEflDelegateEwk::SetUpSmartObject(void* platform_data, void* native_view) {
- EWebView* new_web_view = static_cast<EWebView*>(platform_data);
- 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,
- std::vector<blink::mojom::MenuItemPtr> items,
- bool right_aligned,
- bool allow_multiple_selection) {
- web_view_->HandlePopupMenu(std::move(items), selected_item,
- allow_multiple_selection, bounds);
-}
-
-void WebContentsEflDelegateEwk::HidePopupMenu() {
- web_view_->HidePopupMenu();
-}
-
-void WebContentsEflDelegateEwk::CancelContextMenu(int request_id) {
- web_view_->CancelContextMenu(request_id);
-}
-
-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_);
-}
-
-void WebContentsEflDelegateEwk::OpenDateTimeDialog(
- ui::TextInputType dialog_type,
- double dialog_value,
- content::DateTimeChooserEfl* date_time_chooser) {
- web_view_->InputPickerShow(dialog_type, dialog_value, date_time_chooser);
-}
-
-void WebContentsEflDelegateEwk::OnOverscrolled(
- const gfx::Vector2dF& accumulated_overscroll,
- const gfx::Vector2dF& latest_overscroll_delta) {
- web_view_->OnOverscrolled(accumulated_overscroll, latest_overscroll_delta);
-}
+++ /dev/null
-// Copyright (c) 2012 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 CONTENT_PUBLIC_BROWSER_WEB_CONTENTS_EFL_DELEGATE_EWK_H_
-#define CONTENT_PUBLIC_BROWSER_WEB_CONTENTS_EFL_DELEGATE_EWK_H_
-
-#include "content/public/browser/web_contents_efl_delegate.h"
-#include "third_party/blink/public/mojom/choosers/popup_menu.mojom.h"
-
-class EWebView;
-
-class WebContentsEflDelegateEwk : public content::WebContentsEflDelegate {
- public:
- WebContentsEflDelegateEwk(EWebView*);
-
- WebContentsEflDelegateEwk(const WebContentsEflDelegateEwk&) = delete;
- WebContentsEflDelegateEwk& operator=(const WebContentsEflDelegateEwk&) =
- delete;
-
- bool WebContentsCreateAsync(WebContentsCreateCallback) override;
-
- 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,
- std::vector<blink::mojom::MenuItemPtr> items,
- bool right_aligned,
- bool allow_multiple_selection) override;
- void HidePopupMenu() override;
-
- void CancelContextMenu(int request_id) 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;
- void OpenDateTimeDialog(
- ui::TextInputType dialog_type,
- double dialog_value,
- content::DateTimeChooserEfl* date_time_chooser) override;
-
- private:
- void OnOverscrolled(const gfx::Vector2dF& accumulated_overscroll,
- const gfx::Vector2dF& latest_overscroll_delta) override;
-
- EWebView* web_view_;
-};
-
-#endif // CONTENT_PUBLIC_BROWSER_WEB_CONTENTS_EFL_DELEGATE_EWK_H_
--- /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_delegate_efl.h"
+
+#include "eweb_view.h"
+
+WebContentsViewDelegateEfl::WebContentsViewDelegateEfl(EWebView* wv)
+ : web_view_(wv) {}
+
+// Note: WebContentsViewDelegate::ShowContextMenu is the hook called
+// by chromium in response to either a long press gesture (in case of
+// touch-based input event is the source) or a right button mouse click
+// (in case source is mouse-based).
+// For the former, EWK apps enter selection mode, whereas for the
+// later, context menu is shown right way.
+void WebContentsViewDelegateEfl::ShowContextMenu(
+ content::RenderFrameHost& render_frame_host,
+ const content::ContextMenuParams& params) {
+ if (params.source_type == ui::MENU_SOURCE_LONG_PRESS) {
+ CHECK(web_view_->TouchEventsEnabled());
+ web_view_->HandleLongPressGesture(params);
+ } else {
+ web_view_->ShowContextMenu(params);
+ }
+}
+
+void WebContentsViewDelegateEfl::OnSelectionRectReceived(
+ const gfx::Rect& selection_rect) const {
+ web_view_->OnSelectionRectReceived(selection_rect);
+}
--- /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_DELEGATE_EFL
+#define WEB_CONTENTS_VIEW_DELEGATE_EFL
+
+#include "content/public/browser/web_contents_view_delegate.h"
+#include "third_party/blink/public/common/context_menu_data/menu_item_info.h"
+
+class EWebView;
+
+namespace content {
+class RenderFrameHost;
+}
+
+class WebContentsViewDelegateEfl : public content::WebContentsViewDelegate {
+ public:
+ WebContentsViewDelegateEfl(EWebView*);
+
+ void ShowContextMenu(content::RenderFrameHost& render_frame_host,
+ const content::ContextMenuParams& params) override;
+
+ void OnSelectionRectReceived(const gfx::Rect& selection_rect) const override;
+
+ private:
+ EWebView* web_view_;
+};
+
+#endif // WEB_CONTENTS_VIEW_DELEGATE_EFL
+++ /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_delegate_ewk.h"
-
-#include "eweb_view.h"
-
-WebContentsViewDelegateEwk::WebContentsViewDelegateEwk(EWebView* wv)
- : web_view_(wv) {
-}
-
-// Note: WebContentsViewDelegate::ShowContextMenu is the hook called
-// by chromium in response to either a long press gesture (in case of
-// touch-based input event is the source) or a right button mouse click
-// (in case source is mouse-based).
-// For the former, EWK apps enter selection mode, whereas for the
-// later, context menu is shown right way.
-void WebContentsViewDelegateEwk::ShowContextMenu(
- content::RenderFrameHost& render_frame_host,
- const content::ContextMenuParams& params) {
- if (params.source_type == ui::MENU_SOURCE_LONG_PRESS) {
- CHECK(web_view_->TouchEventsEnabled());
- web_view_->HandleLongPressGesture(params);
- } else {
- web_view_->ShowContextMenu(params);
- }
-}
-
-void WebContentsViewDelegateEwk::OnSelectionRectReceived(
- const gfx::Rect& selection_rect) const {
- web_view_->OnSelectionRectReceived(selection_rect);
-}
+++ /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_delegate.h"
-#include "third_party/blink/public/common/context_menu_data/menu_item_info.h"
-
-class EWebView;
-
-namespace content {
-class RenderFrameHost;
-}
-
-class WebContentsViewDelegateEwk
- : public content::WebContentsViewDelegate {
- public:
- WebContentsViewDelegateEwk(EWebView*);
-
- void ShowContextMenu(content::RenderFrameHost& render_frame_host,
- const content::ContextMenuParams& params) override;
-
- void OnSelectionRectReceived(const gfx::Rect& selection_rect) const override;
-
- private:
- EWebView* web_view_;
-};
-
-#endif // WEB_CONTENTS_VIEW_EFL_DELEGATE_EWK
-
--- /dev/null
+// Copyright (c) 2012 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.
+
+#include "webview_delegate_efl.h"
+#include "ewk/efl_integration/private/webview_delegate_ewk.h"
+
+#include <tuple>
+
+#include "eweb_view.h"
+
+WebViewDelegateEfl::WebViewDelegateEfl(EWebView* wv) : web_view_(wv) {}
+
+bool WebViewDelegateEfl::WebContentsCreateAsync(
+ content::WebViewDelegate::WebContentsCreateCallback callback) {
+ return web_view_->CreateNewWindow(std::move(callback));
+}
+
+void WebViewDelegateEfl::ShowPopupMenu(
+ content::RenderFrameHost* render_frame_host,
+ const gfx::Rect& bounds,
+ int item_height,
+ double item_font_size,
+ int selected_item,
+ std::vector<blink::mojom::MenuItemPtr> items,
+ bool right_aligned,
+ bool allow_multiple_selection) {
+ web_view_->HandlePopupMenu(std::move(items), selected_item,
+ allow_multiple_selection, bounds);
+}
+
+void WebViewDelegateEfl::HidePopupMenu() {
+ web_view_->HidePopupMenu();
+}
+
+void WebViewDelegateEfl::CancelContextMenu(int request_id) {
+ web_view_->CancelContextMenu(request_id);
+}
+
+void WebViewDelegateEfl::HandleZoomGesture(blink::WebGestureEvent& event) {
+ web_view_->HandleZoomGesture(event);
+}
+
+bool WebViewDelegateEfl::UseKeyPadWithoutUserAction() {
+ return web_view_->GetSettings()->useKeyPadWithoutUserAction();
+}
+
+void WebViewDelegateEfl::ShowContextMenu(
+ const content::ContextMenuParams& params) {
+ web_view_->ShowContextMenu(params);
+}
+
+void WebViewDelegateEfl::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 WebViewDelegateEfl::OrientationUnlock() {
+ WebViewDelegateEwk::GetInstance().RequestHandleOrientationUnlock(web_view_);
+}
+
+void WebViewDelegateEfl::OpenDateTimeDialog(
+ ui::TextInputType dialog_type,
+ double dialog_value,
+ content::DateTimeChooserEfl* date_time_chooser) {
+ web_view_->InputPickerShow(dialog_type, dialog_value, date_time_chooser);
+}
+
+void WebViewDelegateEfl::OnOverscrolled(
+ const gfx::Vector2dF& accumulated_overscroll,
+ const gfx::Vector2dF& latest_overscroll_delta) {
+ web_view_->OnOverscrolled(accumulated_overscroll, latest_overscroll_delta);
+}
--- /dev/null
+// Copyright (c) 2012 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 CONTENT_PUBLIC_BROWSER_WEBVIEW_DELEGATE_EFL_H_
+#define CONTENT_PUBLIC_BROWSER_WEBVIEW_DELEGATE_EFL_H_
+
+#include "content/public/browser/webview_delegate.h"
+#include "third_party/blink/public/mojom/choosers/popup_menu.mojom.h"
+
+class EWebView;
+
+class WebViewDelegateEfl : public content::WebViewDelegate {
+ public:
+ WebViewDelegateEfl(EWebView*);
+
+ WebViewDelegateEfl(const WebViewDelegateEfl&) = delete;
+ WebViewDelegateEfl& operator=(const WebViewDelegateEfl&) = delete;
+
+ bool WebContentsCreateAsync(WebContentsCreateCallback) override;
+
+ void ShowPopupMenu(content::RenderFrameHost* render_frame_host,
+ const gfx::Rect& bounds,
+ int item_height,
+ double item_font_size,
+ int selected_item,
+ std::vector<blink::mojom::MenuItemPtr> items,
+ bool right_aligned,
+ bool allow_multiple_selection) override;
+ void HidePopupMenu() override;
+
+ void CancelContextMenu(int request_id) 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;
+ void OpenDateTimeDialog(
+ ui::TextInputType dialog_type,
+ double dialog_value,
+ content::DateTimeChooserEfl* date_time_chooser) override;
+
+ private:
+ void OnOverscrolled(const gfx::Vector2dF& accumulated_overscroll,
+ const gfx::Vector2dF& latest_overscroll_delta) override;
+
+ EWebView* web_view_;
+};
+
+#endif // CONTENT_PUBLIC_BROWSER_WEBVIEW_DELEGATE_EFL_H_