This commit fixes some of the EWK_BRINGUPs added during M114 upversion.
Change-Id: I35402c34d802890e5fe67eab2c31ac0a5d9c765c
Signed-off-by: Nikhil Shingne <n.shingne@samsung.com>
class StartupTabProviderImpl;
class WebEngineBrowserMainParts;
+#if BUILDFLAG(IS_EFL)
+class EwkGlobalData;
+struct GLSharedContextEfl;
+
+namespace content {
+class URLRequestContextGetterEfl;
+}
+#endif
+
namespace base {
class Environment;
class File;
friend class base::win::OSInfo;
friend class content::WebContentsImpl; // http://crbug.com/1262162
#endif
+#if BUILDFLAG(IS_EFL)
+ friend class ::EwkGlobalData;
+ friend class content::URLRequestContextGetterEfl;
+ friend struct ::GLSharedContextEfl;
+#endif
// Sorted by function name (with namespace), ignoring the return type.
friend bool ::EnsureBrowserStateDirectoriesCreated(const base::FilePath&,
public:
ScreenshotCapturedCallback(Screenshot_Captured_Callback func, void* user_data)
: func_(func), user_data_(user_data) {}
- void Run(Evas_Object* image) {
+ void Run(void* image) {
if (func_ != NULL)
- (func_)(image, user_data_);
+ (func_)((Evas_Object*)image, user_data_);
}
private:
TTRACE(TTRACE_TAG_WEB,
"RenderWidgetHostViewAuraHelperEfl::GetMagnifierSnapshot");
#endif
-#if !defined(EWK_BRINGUP) // FIXME: m114 bringup
// GetSnapshot might be replaced with something designed for magnifier.
Evas_Object* image = GetSnapshot(snapshot_area, scale_factor, true);
base::SingleThreadTaskRunner::GetCurrentDefault()->PostTask(
- FROM_HERE,
- base::BindOnce(&ScreenshotCapturedCallback::Run,
- base::Owned(cb.release()), base::Unretained(image)));
-#endif
+ FROM_HERE, base::BindOnce(&ScreenshotCapturedCallback::Run,
+ base::Owned(cb.release()),
+ base::Unretained((void*)image)));
}
void RWHVAuraOffscreenHelperEfl::RequestMagnifierSnapshotAsync(
}
void SelectionBoxEfl::ClearRectData() {
-#if !defined(EWK_BRINGUP) // FIXME: m114 bringup
TRACE_EVENT0("selection,efl", __PRETTY_FUNCTION__);
-#endif
left_rect_ = right_rect_ = gfx::Rect(0, 0, 0, 0);
context_params_->x = context_params_->y = 0;
}
bool SelectionBoxEfl::UpdateRectData(const gfx::Rect& left_rect, const gfx::Rect& right_rect) {
-#if !defined(EWK_BRINGUP) // FIXME: m114 bringup
TRACE_EVENT2("selection,efl", __PRETTY_FUNCTION__,
"left_rect", left_rect.ToString(),
"right_rect", right_rect.ToString());
-#endif
bool ret = false;
if (left_rect_ != left_rect || right_rect_ != right_rect)
ret = true;
}
void SelectionControllerEfl::SetSelectionStatus(bool enable) {
-#if !defined(EWK_BRINGUP) // FIXME: m114 bringup
TRACE_EVENT1("selection,efl", __PRETTY_FUNCTION__, "enable", enable);
-#endif
selection_data_->SetStatus(enable);
}
bool SelectionControllerEfl::GetSelectionStatus() const {
-#if !defined(EWK_BRINGUP) // FIXME: m114 bringup
TRACE_EVENT1("selection,efl", __PRETTY_FUNCTION__, "status",
selection_data_->GetStatus());
-#endif
return selection_data_->GetStatus();
}
#endif
void SelectionControllerEfl::SetSelectionEditable(bool enable) {
-#if !defined(EWK_BRINGUP) // FIXME: m114 bringup
TRACE_EVENT1("selection,efl", __PRETTY_FUNCTION__, "enable", enable);
-#endif
selection_data_->SetEditable(enable);
}
bool SelectionControllerEfl::GetSelectionEditable() const {
-#if !defined(EWK_BRINGUP) // FIXME: m114 bringup
TRACE_EVENT1("selection,efl", __PRETTY_FUNCTION__, "editable",
selection_data_->GetEditable());
-#endif
return selection_data_->GetEditable();
}
bool SelectionControllerEfl::GetCaretSelectionStatus() const {
-#if !defined(EWK_BRINGUP) // FIXME: m114 bringup
TRACE_EVENT1("selection,efl", __PRETTY_FUNCTION__, "caret selection",
selection_mode_ == SelectionMode::CARET);
-#endif
return selection_mode_ == SelectionMode::CARET;
}
void SelectionControllerEfl::SetControlsTemporarilyHidden(bool value,
bool set_forcefully) {
-#if !defined(EWK_BRINGUP) // FIXME: m114 bringup
TRACE_EVENT1("selection,efl", __PRETTY_FUNCTION__,
"controls are hidden:", value);
-#endif
if (controls_temporarily_hidden_ == value)
return;
// Make sure to show selection controls only when no finger
const gfx::Rect& left_rect,
const gfx::Rect& right_rect,
bool /* show */) {
-#if !defined(EWK_BRINGUP) // FIXME: m114 bringup
TRACE_EVENT0("selection,efl", __PRETTY_FUNCTION__);
-#endif
DetermineSelectionMode(left_rect, right_rect);
bool selection_changed =
selection_data_->UpdateRectData(left_rect, right_rect);
void SelectionControllerEfl::ShowHandleAndContextMenuIfRequired(
Reason explicit_reason) {
-#if !defined(EWK_BRINGUP) // FIXME: m114 bringup
TRACE_EVENT0("selection,efl", __PRETTY_FUNCTION__);
-#endif
Reason saved_reason = selection_change_reason_;
Reason effective_reason = selection_change_reason_;
bool SelectionControllerEfl::IsSelectionValid(const gfx::Rect& left_rect,
const gfx::Rect& right_rect) {
-#if !defined(EWK_BRINGUP) // FIXME: m114 bringup
TRACE_EVENT2("selection,efl", __PRETTY_FUNCTION__, "left_rect",
left_rect.ToString(), "right_rect", right_rect.ToString());
-#endif
// For all normal cases the widht will be 0 and we want to check empty which
// Implies x, y, h w all to be 0
if ((IsRectEmpty(left_rect) || IsRectEmpty(right_rect))) {
}
void SelectionControllerEfl::ClearSelection() {
-#if !defined(EWK_BRINGUP) // FIXME: m114 bringup
TRACE_EVENT0("selection,efl", __PRETTY_FUNCTION__);
-#endif
Clear();
CancelContextMenu(0);
SetSelectionStatus(false);
}
void SelectionControllerEfl::OnParentParentViewMove() {
-#if !defined(EWK_BRINGUP) // FIXME: m114 bringup
TRACE_EVENT0("selection,efl", __PRETTY_FUNCTION__);
-#endif
// Update positions of large handle and selection range handles
input_handle_->Move(selection_data_->GetLeftRect().bottom_left());
start_handle_->Move(start_handle_->GetBasePosition());
void SelectionHandleEfl::ChangeObjectDirection(HandleDirection direction) {
if (!controller_.rwhva()->offscreen_helper())
return;
-#if !defined(EWK_BRINGUP) // FIXME: m114 bringup
TRACE_EVENT2("selection,efl", __PRETTY_FUNCTION__, "handle type",
handle_type_, "direction", direction);
-#endif
is_top_ = (direction == DirectionTopNormal || direction == DirectionTopReverse);
switch (direction) {
// static
void GLSharedContextEfl::Initialize(Evas_Object* object) {
if (!g_private_part) {
-#if !defined(EWK_BRINGUP) // FIXME: m114 bringup
- base::ThreadRestrictions::ScopedAllowIO allow_io;
-#endif
+ base::ScopedAllowBlocking allow_io;
g_private_part = new GLSharedContextEflPrivate(object);
}
}
// OnGotQuotaManagedOrigins().
quota_managed_origins_to_delete_count_ = 0;
quota_managed_storage_types_to_delete_count_ = 0;
-#if !defined(EWK_BRINGUP) // FIXME: m114 bringup
- if (delete_begin_.is_null())
- ClearQuotaManagedDataInternal(blink::mojom::StorageType::kPersistent);
-#endif
+ if (delete_begin_.is_null()) {
+ ClearQuotaManagedDataInternal(
+ blink::mojom::StorageType::kDeprecatedPersistent);
+ }
// Do the same for temporary quota.
ClearQuotaManagedDataInternal(blink::mojom::StorageType::kTemporary);
}
void EWebView::Suspend() {
- CHECK(web_contents_);
#if BUILDFLAG(IS_TIZEN)
+ CHECK(web_contents_);
if (IsMobileProfile() && web_contents_->IsFullscreen())
web_contents_->ExitFullscreen(true);
-#endif
-#if !defined(EWK_BRINGUP) // FIXME: m114 bringup
RenderViewHost* rvh = web_contents_->GetRenderViewHost();
RenderFrameHost* rfh = web_contents_->GetPrimaryMainFrame();
CHECK(rvh);
CHECK(rfh);
- rfh->BlockRequestsForFrame();
if (rvh->IsRenderViewLive()) {
RenderWidgetHostImpl* rwhi = static_cast<RenderWidgetHostImpl*>(rvh->GetWidget());
rwhi->PauseScheduledTasks();
}
void EWebView::Resume() {
+#if BUILDFLAG(IS_TIZEN)
CHECK(web_contents_);
-#if !defined(EWK_BRINGUP) // FIXME: m114 bringup
RenderViewHost* rvh = web_contents_->GetRenderViewHost();
RenderFrameHost* rfh = web_contents_->GetPrimaryMainFrame();
CHECK(rvh);
CHECK(rfh);
- rfh->ResumeBlockedRequestsForFrame();
if (rvh->IsRenderViewLive() && rwhva())
rwhva()->host()->UnPauseScheduledTasks();
#endif
}
bool EWebView::SetDrawsTransparentBackground(bool enabled) {
+#if BUILDFLAG(IS_TIZEN)
RenderViewHost* render_view_host = web_contents_->GetRenderViewHost();
if (!render_view_host || !rwhva())
return false;
-#if BUILDFLAG(IS_EFL)
if (!rwhva()->offscreen_helper())
return false;
elm_object_style_set(rwhva()->offscreen_helper()->content_image_elm_host(),
enabled ? "transparent" : "default");
evas_object_image_alpha_set(rwhva()->offscreen_helper()->content_image(),
enabled);
-#endif
-#if !defined(EWK_BRINGUP) // FIXME: m114 bringup
GetWebContentsViewAura()->SetBackgroundColor(enabled ? SK_ColorTRANSPARENT
: SK_ColorWHITE);
static_cast<RenderViewHostImpl*>(render_view_host)
->GetAssociatedFrameWidget()
->SetDrawsTransparentBackground(enabled);
rwhva()->SetBackgroundColor(enabled ? SK_ColorTRANSPARENT : SK_ColorWHITE);
-#endif
return true;
+#else
+ return false;
+#endif
}
bool EWebView::GetDrawsTransparentBackground() {
-#if !defined(EWK_BRINGUP) // FIXME: m114 bringup
+#if BUILDFLAG(IS_TIZEN)
return GetWebContentsViewAura()->GetBackgroundColor() == SK_ColorTRANSPARENT;
#else
return false;
}
bool EWebView::SetBackgroundColor(int red, int green, int blue, int alpha) {
+#if BUILDFLAG(IS_TIZEN)
if (!alpha)
return SetDrawsTransparentBackground(true);
if (!render_view_host || !rwhva())
return false;
-#if BUILDFLAG(IS_EFL)
if (!rwhva()->offscreen_helper())
return false;
elm_object_style_set(rwhva()->offscreen_helper()->content_image_elm_host(),
alpha < 255 ? "transparent" : "default");
evas_object_image_alpha_set(rwhva()->offscreen_helper()->content_image(),
alpha < 255);
-#endif
-#if !defined(EWK_BRINGUP) // FIXME: m114 bringup
GetWebContentsViewAura()->SetBackgroundColor(
SkColorSetARGB(alpha, red, green, blue));
static_cast<RenderViewHostImpl*>(render_view_host)
->GetAssociatedFrameWidget()
->SetBackgroundColor(red, green, blue, alpha);
rwhva()->SetBackgroundColor(SkColorSetARGB(alpha, red, green, blue));
-#endif
return true;
+#else
+ return false;
+#endif
}
void EWebView::GetSessionData(const char** data, unsigned* length) const {
instance_->browser_main_runner_ = BrowserMainRunner::Create();
instance_->browser_main_runner_->Initialize(std::move(main_funtion_params));
-#if !defined(EWK_BRINGUP) // FIXME: m114 bringup
- base::ThreadRestrictions::ScopedAllowIO allow_io;
-#endif
+ base::ScopedAllowBlocking allow_io;
if (base::CommandLine::ForCurrentProcess()->HasSwitch(
switches::kSingleProcess)) {
content::UtilityProcessHost::RegisterUtilityMainThreadFactory(
if (path.empty())
return;
-#if !defined(EWK_BRINGUP) // FIXME: m114 bringup
- base::ThreadRestrictions::ScopedAllowIO allow_io;
-#endif
+
+ base::ScopedAllowBlocking allow_io;
if (base::DirectoryExists(path) || base::CreateDirectory(path)) {
const base::FilePath& cookie_path = path.AppendASCII("Cookies");
persistent_store = new net::SQLitePersistentCookieStore(