This resolves compiler errors to enable EFL port.
Reference: https://review.tizen.org/gerrit/#/c/169959/
Change-Id: I634566226533aea17f774ffff45cdb7d2236c57b
Signed-off-by: Youngsoo Choi <kenshin.choi@samsung.com>
#include "base/base_export.h"
#include "base/message_loop/message_pump.h"
-#include "base/threading/non_thread_safe.h"
#include <Ecore.h>
void HandleScheduledWork();
-private:
+ private:
// We may make recursive calls to Run, so we save state that needs to be
// separate between them in this structure type.
struct RunState;
} // namespace base
-#endif // BASE_MESSAGE_LOOP_MESSAGE_PUMP_EFL_H_
+#endif // BASE_MESSAGE_LOOP_MESSAGE_PUMP_EFL_H_
]
deps = [
"//base",
+ "//content/public/common",
"//skia",
+ "//third_party/boringssl",
]
include_dirs = [ ".." ]
sources = [
}
void JavaScriptDialogManagerEfl::RunJavaScriptDialog(
- content::WebContents* web_contents,
- const GURL& origin_url,
- content::JavaScriptMessageType type,
+ WebContents* web_contents,
+ RenderFrameHost* render_frame_host,
+ JavaScriptDialogType dialog_type,
const base::string16& message_text,
const base::string16& default_prompt_text,
- const DialogClosedCallback& callback,
+ DialogClosedCallback callback,
bool* did_suppress_message) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
JavaScriptModalDialogEfl::Type efl_type;
- switch (type) {
- case JAVASCRIPT_MESSAGE_TYPE_ALERT:
+ switch (dialog_type) {
+ case JAVASCRIPT_DIALOG_TYPE_ALERT:
efl_type = JavaScriptModalDialogEfl::ALERT;
break;
- case JAVASCRIPT_MESSAGE_TYPE_CONFIRM:
+ case JAVASCRIPT_DIALOG_TYPE_CONFIRM:
efl_type = JavaScriptModalDialogEfl::CONFIRM;
break;
- case JAVASCRIPT_MESSAGE_TYPE_PROMPT:
+ case JAVASCRIPT_DIALOG_TYPE_PROMPT:
efl_type = JavaScriptModalDialogEfl::PROMPT;
break;
default:
NOTREACHED();
}
- CancelActiveAndPendingDialogs(web_contents);
- open_dialogs_[web_contents] = new JavaScriptModalDialogEfl(web_contents,
- efl_type, message_text, default_prompt_text, callback);
- *did_suppress_message = false;
+ CancelDialogs(web_contents, false);
+ open_dialogs_[web_contents] =
+ new JavaScriptModalDialogEfl(web_contents, efl_type, message_text,
+ default_prompt_text, std::move(callback));
}
void JavaScriptDialogManagerEfl::RunBeforeUnloadDialog(
content::WebContents* web_contents,
bool is_reload,
- const DialogClosedCallback& callback) {
+ DialogClosedCallback callback) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
- CancelActiveAndPendingDialogs(web_contents);
+ CancelDialogs(web_contents, false);
open_dialogs_[web_contents] = new JavaScriptModalDialogEfl(
web_contents, JavaScriptModalDialogEfl::NAVIGATION,
base::UTF8ToUTF16(
std::string(dgettext("WebKit", "IDS_WEBVIEW_BEFOREUNLOAD_MESSAGE"))),
- base::string16(), callback);
+ base::string16(), std::move(callback));
}
bool JavaScriptDialogManagerEfl::HandleJavaScriptDialog(
return false;
}
-void JavaScriptDialogManagerEfl::CancelActiveAndPendingDialogs(
- content::WebContents* web_contents) {
+void JavaScriptDialogManagerEfl::CancelDialogs(
+ content::WebContents* web_contents,
+ bool reset_state) {
if (open_dialogs_.find(web_contents) != open_dialogs_.end()) {
open_dialogs_[web_contents]->Close();
delete open_dialogs_[web_contents];
}
}
-void JavaScriptDialogManagerEfl::ResetDialogState(
- content::WebContents* web_contents) {
- NOTIMPLEMENTED();
-}
-
} // namespace content
#include <map>
#include <Evas.h>
+#include "base/callback.h"
+#include "base/callback_forward.h"
#include "base/strings/string16.h"
#include "content/public/browser/javascript_dialog_manager.h"
-#include "content/public/common/javascript_message_type.h"
+#include "content/public/common/javascript_dialog_type.h"
#include "url/gurl.h"
namespace content{
JavaScriptDialogManagerEfl();
~JavaScriptDialogManagerEfl() override;
- void RunJavaScriptDialog(
- content::WebContents* web_contents,
- const GURL& origin_url,
- content::JavaScriptMessageType type,
- const base::string16& message_text,
- const base::string16& default_prompt_text,
- const DialogClosedCallback& callback,
- bool* did_suppress_message) override;
- void RunBeforeUnloadDialog(
- content::WebContents* web_contents,
- bool is_reload,
- const DialogClosedCallback& callback) override;
- bool HandleJavaScriptDialog(
- content::WebContents* web_contents,
- bool accept,
- const base::string16* prompt_override) override;
- void CancelActiveAndPendingDialogs(
- content::WebContents* web_contents) override;
- void ResetDialogState(
- content::WebContents* web_contents) override;
+ // Displays a JavaScript dialog. |did_suppress_message| will not be nil; if
+ // |true| is returned in it, the caller will handle faking the reply.
+ void RunJavaScriptDialog(WebContents* web_contents,
+ RenderFrameHost* render_frame_host,
+ JavaScriptDialogType dialog_type,
+ const base::string16& message_text,
+ const base::string16& default_prompt_text,
+ DialogClosedCallback callback,
+ bool* did_suppress_message) override;
+
+ // Displays a dialog asking the user if they want to leave a page.
+ void RunBeforeUnloadDialog(WebContents* web_contents,
+ RenderFrameHost* render_frame_host,
+ bool is_reload,
+ DialogClosedCallback callback) override;
+
+ // Accepts or dismisses the active JavaScript dialog, which must be owned
+ // by the given |web_contents|. If |prompt_override| is not null, the prompt
+ // text of the dialog should be set before accepting. Returns true if the
+ // dialog was handled.
+ bool HandleJavaScriptDialog(WebContents* web_contents,
+ bool accept,
+ const base::string16* prompt_override) override;
+
+ // Cancels all active and pending dialogs for the given WebContents. If
+ // |reset_state| is true, resets any saved state tied to |web_contents|.
+ void CancelDialogs(WebContents* web_contents,
+ bool reset_state) override;
private:
std::map<WebContents*, JavaScriptModalDialogEfl*> open_dialogs_;
-// Copyright 2014 Samsung Electronics. All rights reserved.
+// Copyright 2014 Samsung Electroncs. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "javascript_modal_dialog_efl.h"
+#include "base/callback.h"
#include "base/files/file_path.h"
#include "base/path_service.h"
#include "base/strings/utf_string_conversions.h"
Type type,
const base::string16& message_text,
const base::string16& default_prompt_text,
- const content::JavaScriptDialogManager::DialogClosedCallback& callback)
- : popup_(NULL)
- , callback_(callback)
- , prompt_entry_(NULL)
- , imf_context_(NULL) {
-
+ JavaScriptDialogManager::DialogClosedCallback callback)
+ : popup_(NULL),
+ callback_(std::move(callback)),
+ prompt_entry_(NULL),
+ imf_context_(NULL) {
Evas_Object *parent_view = static_cast<Evas_Object *>(
web_contents->GetNativeView());
popup_ = elm_popup_add(parent_view);
void JavaScriptModalDialogEfl::SetLabelText(const base::string16& txt) {
std::string txt2;
- base::ReplaceChars(UTF16ToUTF8(txt).c_str(), "\n", "</br>", &txt2);
+ base::ReplaceChars(base::UTF16ToUTF8(txt).c_str(), "\n", "</br>", &txt2);
Evas_Object* label = elm_label_add(popup_);
elm_label_line_wrap_set(label, ELM_WRAP_MIXED);
if (type == PROMPT) {
DCHECK(message.length());
- elm_object_part_text_set(popup_, "title,text", UTF16ToUTF8(message).c_str());
+ elm_object_part_text_set(popup_, "title,text",
+ base::UTF16ToUTF8(message).c_str());
prompt_entry_ = elm_entry_add(popup_);
elm_entry_editable_set(prompt_entry_, EINA_TRUE);
elm_entry_single_line_set(prompt_entry_, EINA_TRUE);
evas_object_size_hint_align_set(prompt_entry_, EVAS_HINT_FILL, EVAS_HINT_FILL);
elm_entry_input_panel_return_key_type_set(prompt_entry_,
ELM_INPUT_PANEL_RETURN_KEY_TYPE_DONE);
- elm_object_text_set(prompt_entry_,
- UTF16ToUTF8(content).c_str());
+ elm_object_text_set(prompt_entry_, base::UTF16ToUTF8(content).c_str());
elm_entry_cursor_end_set(prompt_entry_);
evas_object_smart_callback_add(prompt_entry_, "activated",
&PromptEnterKeyDownCallback, this);
elm_object_part_content_set(popup_, "default", prompt_entry_);
} else if (type == NAVIGATION) {
if (message.length())
- elm_object_part_text_set(popup_, "title,text", UTF16ToUTF8(message).c_str());
+ elm_object_part_text_set(popup_, "title,text",
+ base::UTF16ToUTF8(message).c_str());
if (content.length())
SetLabelText(content);
} else {
void JavaScriptModalDialogEfl::Close(bool accept, std::string reply) {
if (popup_) {
- callback_.Run(accept, base::UTF8ToUTF16(reply));
+ std::move(callback_).Run(accept, base::UTF8ToUTF16(reply));
evas_object_del(popup_);
popup_ = NULL;
prompt_entry_ = NULL;
#include <string>
#include <Elementary.h>
+#include "base/callback.h"
+#include "base/callback_forward.h"
#include "base/strings/string16.h"
#include "base/strings/string_util.h"
#include "content/public/browser/javascript_dialog_manager.h"
PROMPT
};
- JavaScriptModalDialogEfl(
- content::WebContents* web_contents,
- Type type,
- const base::string16& message_text,
- const base::string16& default_prompt_text,
- const content::JavaScriptDialogManager::DialogClosedCallback&);
+ JavaScriptModalDialogEfl(content::WebContents* web_contents,
+ Type type,
+ const base::string16& message_text,
+ const base::string16& default_prompt_text,
+ JavaScriptDialogManager::DialogClosedCallback);
~JavaScriptModalDialogEfl();
void Close(bool accept = false, std::string reply = std::string());
#include "content/browser/compositor/context_factory_efl.h"
-#include "cc/output/texture_mailbox_deleter.h"
#include "cc/raster/single_thread_task_graph_runner.h"
-#include "cc/surfaces/display.h"
-#include "cc/surfaces/surface_display_output_surface.h"
-#include "components/display_compositor/gl_helper.h"
+#include "components/viz/common/gl_helper.h"
+#include "components/viz/service/display/display.h"
+#include "components/viz/service/display/texture_mailbox_deleter.h"
+#include "content/browser/browser_main_loop.h"
#include "content/browser/compositor/mailbox_output_surface_efl.h"
#include "content/browser/gpu/browser_gpu_channel_host_factory.h"
#include "content/browser/gpu/browser_gpu_memory_buffer_manager.h"
-#include "content/browser/gpu/gpu_surface_tracker.h"
-#include "content/common/host_shared_bitmap_manager.h"
+#include "content/renderer/render_thread_impl.h"
+#include "gpu/ipc/common/gpu_surface_tracker.h"
#include "ui/compositor/reflector.h"
namespace content {
void AddMirroringLayer(ui::Layer* layer) override {}
void RemoveMirroringLayer(ui::Layer* layer) override {}
};
-}
+} // namespace
ContextFactoryEfl::ContextFactoryEfl()
- : next_surface_id_namespace_(1u),
- task_graph_runner_(new cc::SingleThreadTaskGraphRunner) {
- surface_manager_ = base::WrapUnique(new cc::SurfaceManager);
+ : task_graph_runner_(new cc::SingleThreadTaskGraphRunner),
+ frame_sink_id_allocator_(0u) {
task_graph_runner_->Start("CompositorTileWorker1",
base::SimpleThread::Options());
}
task_graph_runner_->Shutdown();
}
-void ContextFactoryEfl::CreateOutputSurface(
+void ContextFactoryEfl::CreateLayerTreeFrameSink(
base::WeakPtr<ui::Compositor> compositor) {
- gpu::gles2::ContextCreationAttribHelper attrs;
- attrs.alpha_size = -1;
- attrs.depth_size = 0;
- attrs.stencil_size = 0;
- attrs.samples = 0;
- attrs.sample_buffers = 0;
- attrs.bind_generates_resource = false;
- attrs.lose_context_when_out_of_memory = true;
-
- scoped_refptr<content::ContextProviderCommandBuffer> context_provider;
- scoped_refptr<gpu::GpuChannelHost> gpu_channel_host(
- BrowserGpuChannelHostFactory::instance()->EstablishGpuChannelSync(
- CAUSE_FOR_GPU_LAUNCH_BROWSER_SHARED_MAIN_THREAD_CONTEXT));
- if (gpu_channel_host.get() && !gpu_channel_host->IsLost()) {
- GURL url("chrome://gpu/Compositor::createContext3D");
- constexpr bool automatic_flushes = false;
- constexpr bool support_locking = false;
- constexpr gl::GpuPreference gpu_preference = gl::PreferIntegratedGpu;
- context_provider = new content::ContextProviderCommandBuffer(
- std::move(gpu_channel_host), gpu::GPU_STREAM_DEFAULT,
- gpu::GpuStreamPriority::NORMAL, gpu::kNullSurfaceHandle, url,
- gpu_preference, automatic_flushes, support_locking,
- gpu::SharedMemoryLimits(), attrs, NULL,
- command_buffer_metrics::DISPLAY_COMPOSITOR_ONSCREEN_CONTEXT);
- }
- if (!context_provider.get()) {
- LOG(ERROR) << "Failed to create 3D context for compositor.";
- compositor->SetOutputSurface(std::unique_ptr<cc::OutputSurface>());
- }
-
- std::unique_ptr<cc::SyntheticBeginFrameSource> begin_frame_source;
- if (!compositor->GetRendererSettings().disable_display_vsync) {
- begin_frame_source.reset(new cc::DelayBasedBeginFrameSource(
- base::MakeUnique<cc::DelayBasedTimeSource>(
- compositor->task_runner().get())));
- } else {
- begin_frame_source.reset(new cc::BackToBackBeginFrameSource(
- base::MakeUnique<cc::DelayBasedTimeSource>(
- compositor->task_runner().get())));
- }
-
- std::unique_ptr<MailboxOutputSurfaceEfl> display_output_surface =
- base::WrapUnique(
- new MailboxOutputSurfaceEfl(context_provider, cc::RGBA_8888));
- display_output_surface->SetCompositorClient(compositor->client());
-
- std::unique_ptr<cc::DisplayScheduler> scheduler(new cc::DisplayScheduler(
- begin_frame_source.get(), compositor->task_runner().get(),
- display_output_surface->capabilities().max_frames_pending));
-
- cc::SurfaceManager* surface_manager = surface_manager_.get();
-
- display_ = base::MakeUnique<cc::Display>(
- surface_manager, GetSharedBitmapManager(), GetGpuMemoryBufferManager(),
- compositor->GetRendererSettings(),
- compositor->surface_id_allocator()->id_namespace(),
- std::move(begin_frame_source), std::move(display_output_surface),
- std::move(scheduler), base::MakeUnique<cc::TextureMailboxDeleter>(
- compositor->task_runner().get()));
-
- std::unique_ptr<cc::SurfaceDisplayOutputSurface> delegated_output_surface(
- new cc::SurfaceDisplayOutputSurface(
- surface_manager, compositor->surface_id_allocator(), display_.get(),
- context_provider, nullptr));
-
- display_->Resize(compositor->size());
- compositor->SetOutputSurface(std::move(delegated_output_surface));
+ NOTIMPLEMENTED();
}
-std::unique_ptr<ui::Reflector> ContextFactoryEfl::CreateReflector(
- ui::Compositor* mirrored_compositor,
- ui::Layer* mirroring_layer) {
- return base::WrapUnique(new FakeReflector);
+scoped_refptr<viz::ContextProvider>
+ContextFactoryEfl::SharedMainThreadContextProvider() {
+ NOTIMPLEMENTED() << "Return dummy.";
+ return main_context_provider_;
}
-void ContextFactoryEfl::RemoveReflector(ui::Reflector* reflector) {}
-
-scoped_refptr<cc::ContextProvider>
-ContextFactoryEfl::SharedMainThreadContextProvider() {
- if (shared_main_thread_contexts_.get())
- return shared_main_thread_contexts_;
-
- gpu::gles2::ContextCreationAttribHelper attrs;
- attrs.alpha_size = -1;
- attrs.depth_size = 0;
- attrs.stencil_size = 0;
- attrs.samples = 0;
- attrs.sample_buffers = 0;
- attrs.bind_generates_resource = false;
- attrs.lose_context_when_out_of_memory = true;
-
- scoped_refptr<content::ContextProviderCommandBuffer> context_provider;
- scoped_refptr<gpu::GpuChannelHost> gpu_channel_host(
- BrowserGpuChannelHostFactory::instance()->EstablishGpuChannelSync(
- CAUSE_FOR_GPU_LAUNCH_BROWSER_SHARED_MAIN_THREAD_CONTEXT));
- if (gpu_channel_host.get() && !gpu_channel_host->IsLost()) {
- GURL url("chrome://gpu/Compositor::createContext3D");
- constexpr bool automatic_flushes = false;
- constexpr bool support_locking = false;
- constexpr gl::GpuPreference gpu_preference = gl::PreferIntegratedGpu;
- shared_main_thread_contexts_ = new content::ContextProviderCommandBuffer(
- std::move(gpu_channel_host), gpu::GPU_STREAM_DEFAULT,
- gpu::GpuStreamPriority::NORMAL, gpu::kNullSurfaceHandle, url,
- gpu_preference, automatic_flushes, support_locking,
- gpu::SharedMemoryLimits(), attrs, NULL,
- command_buffer_metrics::BROWSER_OFFSCREEN_MAINTHREAD_CONTEXT);
- }
+double ContextFactoryEfl::GetRefreshRate() const {
+ return 60.0;
+}
- if (!shared_main_thread_contexts_->BindToCurrentThread())
- shared_main_thread_contexts_ = NULL;
- return shared_main_thread_contexts_;
+gpu::GpuMemoryBufferManager* ContextFactoryEfl::GetGpuMemoryBufferManager() {
+ return content::BrowserGpuMemoryBufferManager::current();
}
-void ContextFactoryEfl::RemoveCompositor(ui::Compositor* compositor) {}
+cc::TaskGraphRunner* ContextFactoryEfl::GetTaskGraphRunner() {
+ return task_graph_runner_.get();
+}
-bool ContextFactoryEfl::DoesCreateTestContexts() {
- return false;
+void ContextFactoryEfl::AddObserver(ui::ContextFactoryObserver* observer) {
+ observer_list_.AddObserver(observer);
}
-uint32_t ContextFactoryEfl::GetImageTextureTarget(gfx::BufferFormat format,
- gfx::BufferUsage usage) {
- return GL_TEXTURE_2D;
+void ContextFactoryEfl::RemoveObserver(ui::ContextFactoryObserver* observer) {
+ observer_list_.RemoveObserver(observer);
}
-cc::SharedBitmapManager* ContextFactoryEfl::GetSharedBitmapManager() {
- return content::HostSharedBitmapManager::current();
+std::unique_ptr<ui::Reflector> ContextFactoryEfl::CreateReflector(
+ ui::Compositor* source,
+ ui::Layer* target) {
+ NOTIMPLEMENTED();
+ return nullptr;
}
-gpu::GpuMemoryBufferManager* ContextFactoryEfl::GetGpuMemoryBufferManager() {
- return content::BrowserGpuMemoryBufferManager::current();
+void ContextFactoryEfl::RemoveReflector(ui::Reflector* reflector) {
+ NOTIMPLEMENTED();
}
-cc::TaskGraphRunner* ContextFactoryEfl::GetTaskGraphRunner() {
- return task_graph_runner_.get();
+viz::FrameSinkId ContextFactoryEfl::AllocateFrameSinkId() {
+ NOTIMPLEMENTED() << "Return dummy.";
+ return frame_sink_id_allocator_.NextFrameSinkId();
}
-std::unique_ptr<cc::SurfaceIdAllocator>
-ContextFactoryEfl::CreateSurfaceIdAllocator() {
- std::unique_ptr<cc::SurfaceIdAllocator> allocator = base::WrapUnique(
- new cc::SurfaceIdAllocator(next_surface_id_namespace_++));
- if (GetSurfaceManager())
- allocator->RegisterSurfaceIdNamespace(GetSurfaceManager());
- return allocator;
+viz::HostFrameSinkManager* ContextFactoryEfl::GetHostFrameSinkManager() {
+ return BrowserMainLoop::GetInstance()->host_frame_sink_manager();
}
+void ContextFactoryEfl::SetDisplayVisible(ui::Compositor* compositor,
+ bool visible) {}
+
void ContextFactoryEfl::ResizeDisplay(ui::Compositor* compositor,
const gfx::Size& size) {
- if (display_)
- display_->Resize(size);
+ // Do nothing and resize when a CompositorFrame with a new size arrives.
}
+void ContextFactoryEfl::SetDisplayColorSpace(
+ ui::Compositor* compositor,
+ const gfx::ColorSpace& blending_color_space,
+ const gfx::ColorSpace& output_color_space) {}
+
+void ContextFactoryEfl::SetAuthoritativeVSyncInterval(
+ ui::Compositor* compositor,
+ base::TimeDelta interval) {}
+
+void ContextFactoryEfl::SetDisplayVSyncParameters(ui::Compositor* compositor,
+ base::TimeTicks timebase,
+ base::TimeDelta interval) {}
+
+void ContextFactoryEfl::IssueExternalBeginFrame(
+ ui::Compositor* compositor,
+ const viz::BeginFrameArgs& args) {}
+
+void ContextFactoryEfl::SetOutputIsSecure(ui::Compositor* compositor,
+ bool secure) {}
+
ui::ContextFactory* ContextFactoryEfl::GetContextFactory() {
return this;
}
-cc::SurfaceManager* ContextFactoryEfl::GetSurfaceManager() {
- return surface_manager_.get();
+ui::ContextFactoryPrivate* ContextFactoryEfl::GetContextFactoryPrivate() {
+ return this;
}
-display_compositor::GLHelper* ContextFactoryEfl::GetGLHelper() {
+viz::GLHelper* ContextFactoryEfl::GetGLHelper() {
if (!gl_helper_) {
- scoped_refptr<cc::ContextProvider> provider =
+ scoped_refptr<viz::ContextProvider> provider =
SharedMainThreadContextProvider();
if (provider.get())
- gl_helper_.reset(new display_compositor::GLHelper(
- provider->ContextGL(), provider->ContextSupport()));
+ gl_helper_.reset(
+ new viz::GLHelper(provider->ContextGL(), provider->ContextSupport()));
}
- return gl_helper_.get();
-}
-void ContextFactoryEfl::AddObserver(ui::ContextFactoryObserver* observer) {
- observer_list_.AddObserver(observer);
+ return gl_helper_.get();
}
-void ContextFactoryEfl::RemoveObserver(ui::ContextFactoryObserver* observer) {
- observer_list_.RemoveObserver(observer);
+void ContextFactoryEfl::SetGpuChannelEstablishFactory(
+ gpu::GpuChannelEstablishFactory* factory) {
+ NOTIMPLEMENTED();
}
} // namespace content
#ifndef CONTENT_BROWSER_COMPOSITOR_CONTEXT_FACTORY_EFL_H_
#define CONTENT_BROWSER_COMPOSITOR_CONTEXT_FACTORY_EFL_H_
-#include "cc/surfaces/display.h"
+#include "components/viz/common/surfaces/frame_sink_id_allocator.h"
#include "content/browser/compositor/image_transport_factory.h"
#include "ui/compositor/compositor.h"
namespace cc {
class SingleThreadTaskGraphRunner;
-class SurfaceManager;
+} // namespace cc
+
+namespace gpu {
+class GpuChannelEstablishFactory;
}
-namespace content {
+namespace ui {
class ContextProviderCommandBuffer;
+}
+
+namespace content {
class ContextFactoryEfl : public ui::ContextFactory,
+ public ui::ContextFactoryPrivate,
public ImageTransportFactory {
public:
ContextFactoryEfl();
~ContextFactoryEfl() override;
// ui::ContextFactory implementation.
- void CreateOutputSurface(base::WeakPtr<ui::Compositor> compositor) override;
+ void CreateLayerTreeFrameSink(
+ base::WeakPtr<ui::Compositor> compositor) override;
+ scoped_refptr<viz::ContextProvider> SharedMainThreadContextProvider()
+ override;
+ double GetRefreshRate() const override;
+ gpu::GpuMemoryBufferManager* GetGpuMemoryBufferManager() override;
+ cc::TaskGraphRunner* GetTaskGraphRunner() override;
+ void AddObserver(ui::ContextFactoryObserver* observer) override;
+ void RemoveObserver(ui::ContextFactoryObserver* observer) override;
+
+ // ui::ContextFactoryPrivate implementation.
std::unique_ptr<ui::Reflector> CreateReflector(ui::Compositor* source,
ui::Layer* target) override;
void RemoveReflector(ui::Reflector* reflector) override;
void RemoveCompositor(ui::Compositor* compositor) override;
- scoped_refptr<cc::ContextProvider> SharedMainThreadContextProvider() override;
- bool DoesCreateTestContexts() override;
- uint32_t GetImageTextureTarget(gfx::BufferFormat format,
- gfx::BufferUsage usage) override;
- cc::SharedBitmapManager* GetSharedBitmapManager() override;
- gpu::GpuMemoryBufferManager* GetGpuMemoryBufferManager() override;
- cc::TaskGraphRunner* GetTaskGraphRunner() override;
- std::unique_ptr<cc::SurfaceIdAllocator> CreateSurfaceIdAllocator() override;
+ viz::FrameSinkId AllocateFrameSinkId() override;
+ viz::HostFrameSinkManager* GetHostFrameSinkManager() override;
+ void SetDisplayVisible(ui::Compositor* compositor, bool visible) override;
void ResizeDisplay(ui::Compositor* compositor,
const gfx::Size& size) override;
+ void SetDisplayColorSpace(ui::Compositor* compositor,
+ const gfx::ColorSpace& blending_color_space,
+ const gfx::ColorSpace& output_color_space) override;
void SetAuthoritativeVSyncInterval(ui::Compositor* compositor,
- base::TimeDelta interval) override {}
-
- void SetOutputIsSecure(ui::Compositor* compositor, bool secure) override {}
+ base::TimeDelta interval) override;
+ void SetDisplayVSyncParameters(ui::Compositor* compositor,
+ base::TimeTicks timebase,
+ base::TimeDelta interval) override;
+ void IssueExternalBeginFrame(ui::Compositor* compositor,
+ const viz::BeginFrameArgs& args) override;
+ void SetOutputIsSecure(ui::Compositor* compositor, bool secure) override;
// ImageTransportFactory implementation.
ui::ContextFactory* GetContextFactory() override;
- cc::SurfaceManager* GetSurfaceManager() override;
- display_compositor::GLHelper* GetGLHelper() override;
- void AddObserver(ui::ContextFactoryObserver* observer) override;
- void RemoveObserver(ui::ContextFactoryObserver* observer) override;
+ ui::ContextFactoryPrivate* GetContextFactoryPrivate() override;
+ viz::GLHelper* GetGLHelper() override;
+ void SetGpuChannelEstablishFactory(
+ gpu::GpuChannelEstablishFactory* factory) override;
private:
- std::unique_ptr<display_compositor::GLHelper> gl_helper_;
+ std::unique_ptr<viz::GLHelper> gl_helper_;
base::ObserverList<ui::ContextFactoryObserver> observer_list_;
- std::unique_ptr<cc::SurfaceManager> surface_manager_;
- uint32_t next_surface_id_namespace_;
- std::unique_ptr<cc::Display> display_;
+ scoped_refptr<ui::ContextProviderCommandBuffer> main_context_provider_;
std::unique_ptr<cc::SingleThreadTaskGraphRunner> task_graph_runner_;
- scoped_refptr<ContextProviderCommandBuffer> shared_main_thread_contexts_;
+
+ viz::FrameSinkIdAllocator frame_sink_id_allocator_;
DISALLOW_COPY_AND_ASSIGN(ContextFactoryEfl);
};
#include "base/threading/thread_task_runner_handle.h"
#include "build/tizen_version.h"
-#include "cc/output/output_surface_client.h"
+//#include "cc/output/output_surface_client.h"
+#include "components/viz/service/display/output_surface_client.h"
+//#include "cc/output/output_surface_frame.h"
#include "cc/raster/single_thread_task_graph_runner.h"
+#include "components/viz/service/display/output_surface_frame.h"
#include "content/browser/renderer_host/render_widget_host_impl.h"
#include "gpu/command_buffer/client/context_support.h"
#include "gpu/command_buffer/client/gles2_interface.h"
namespace content {
MailboxOutputSurfaceEfl::MailboxOutputSurfaceEfl(
- const scoped_refptr<ContextProviderCommandBuffer>& context_provider,
- cc::ResourceFormat format)
- : cc::OutputSurface(context_provider, nullptr, nullptr),
+ const scoped_refptr<ui::ContextProviderCommandBuffer>& context_provider,
+ viz::ResourceFormat format)
+ : viz::OutputSurface(context_provider),
swap_buffers_completion_callback_(
base::Bind(&MailboxOutputSurfaceEfl::OnSwapBuffersCompleted,
base::Unretained(this))),
format_(format) {
capabilities_.max_frames_pending = 1;
capabilities_.uses_default_gl_framebuffer = false;
- capabilities_.adjust_deadline_for_parent = false;
}
MailboxOutputSurfaceEfl::~MailboxOutputSurfaceEfl() {}
-void MailboxOutputSurfaceEfl::DetachFromClient() {
- DiscardBackbuffer();
- while (!pending_textures_.empty()) {
- if (pending_textures_.front().texture_id) {
- context_provider_->ContextGL()->DeleteTextures(
- 1, &pending_textures_.front().texture_id);
- }
- pending_textures_.pop_front();
- }
- cc::OutputSurface::DetachFromClient();
-}
-
void MailboxOutputSurfaceEfl::EnsureBackbuffer() {
is_backbuffer_discarded_ = false;
// Find a texture of matching size to recycle.
while (!returned_textures_.empty()) {
TransferableFrame& texture = returned_textures_.front();
+#if !defined(EWK_BRINGUP) // FIXME: m67 bringup
+ // FIXME: EWK_BRINGUP definition should be removed.
+ // surface_size_ variable was removed in
+ // cc/output/output_surface.h
if (texture.size == surface_size_) {
current_backing_ = texture;
if (current_backing_.sync_token.HasData())
returned_textures_.pop();
break;
}
+#endif // !defined(EWK_BRINGUP)
gl->DeleteTextures(1, &texture.texture_id);
returned_textures_.pop();
if (!current_backing_.texture_id) {
gl->GenTextures(1, ¤t_backing_.texture_id);
+#if !defined(EWK_BRINGUP) // FIXME: m67 bringup
+ // FIXME: EWK_BRINGUP definition should be removed.
+ // surface_size_ variable was removed in
+ // cc/output/output_surface.h
current_backing_.size = surface_size_;
+#endif // !defined(EWK_BRINGUP)
gl->BindTexture(GL_TEXTURE_2D, current_backing_.texture_id);
gl->TexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
gl->TexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
gl->TexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
gl->TexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
+#if !defined(EWK_BRINGUP) // FIXME: m67 bringup
+ // FIXME: EWK_BRINGUP definition should be removed.
+ // surface_size_ variable was removed in
+ // cc/output/output_surface.h
gl->TexImage2D(GL_TEXTURE_2D, 0, GLInternalFormat(format_),
surface_size_.width(), surface_size_.height(), 0,
GLDataFormat(format_), GLDataType(format_), NULL);
+#endif // !defined(EWK_BRINGUP)
gl->GenMailboxCHROMIUM(current_backing_.mailbox.name);
gl->ProduceTextureCHROMIUM(GL_TEXTURE_2D, current_backing_.mailbox.name);
texture_upload_pending_ = true;
}
}
-void MailboxOutputSurfaceEfl::DiscardBackbuffer() {
+/*void MailboxOutputSurfaceEfl::fvDiscardBackbuffer() {
is_backbuffer_discarded_ = true;
GLES2Interface* gl = context_provider_->ContextGL();
gl->DeleteFramebuffers(1, &fbo_);
fbo_ = 0;
}
-}
+}*/
void MailboxOutputSurfaceEfl::Reshape(const gfx::Size& size,
float scale_factor,
- bool alpha) {
+ const gfx::ColorSpace& color_space,
+ bool has_alpha,
+ bool use_stencil) {
+#if !defined(EWK_BRINGUP) // FIXME: m67 bringup
+ // FIXME: EWK_BRINGUP definition should be removed.
+ // surface_size_ variable was removed in cc/output/output_surface.h
if (size == surface_size_)
return;
surface_size_ = size;
device_scale_factor_ = scale_factor;
+#endif // !defined(EWK_BRINGUP)
DiscardBackbuffer();
EnsureBackbuffer();
}
current_backing_.texture_id, 0);
}
+#if !defined(EWK_BRINGUP) // FIXME: m67 bringup
+// FIXME: EWK_BRINGUP definition should be removed.
+// cc::GLFrameData was removed in cc/output/gl_frame_data.h
void MailboxOutputSurfaceEfl::DrawTexture(
std::unique_ptr<cc::GLFrameData> gl_frame_data) {
// Draw texture on RWHV
}
client_->DidSwapBuffersComplete();
}
+#endif // !defined(EWK_BRINGUP)
-void MailboxOutputSurfaceEfl::SwapBuffers(cc::CompositorFrame frame) {
+void MailboxOutputSurfaceEfl::SwapBuffers(viz::OutputSurfaceFrame frame) {
+#if !defined(EWK_BRINGUP) // FIXME: m67 bringup
+ // FIXME: EWK_BRINGUP definition should be removed.
+ // The type of frame was changed, so gl_frame_data isn't member of
+ // frame
DCHECK(frame.gl_frame_data);
DCHECK(!surface_size_.IsEmpty());
DCHECK(surface_size_ == current_backing_.size);
DCHECK(!current_backing_.mailbox.IsZero() ||
context_provider_->ContextGL()->GetGraphicsResetStatusKHR() !=
GL_NO_ERROR);
-
frame.gl_frame_data->mailbox = current_backing_.mailbox;
// Using glFinish call instead of glFlush, fixes black screen issue with
pending_textures_.push_back(current_backing_);
current_backing_ = TransferableFrame();
+#endif // !defined(EWK_BRINGUP)
}
uint32_t MailboxOutputSurfaceEfl::GetFramebufferCopyTextureFormat() {
auto* gl =
- static_cast<ContextProviderCommandBuffer*>(context_provider_.get());
+ static_cast<ui::ContextProviderCommandBuffer*>(context_provider_.get());
return gl->GetCopyTextureInternalFormat();
}
-bool MailboxOutputSurfaceEfl::BindToClient(cc::OutputSurfaceClient* client) {
- if (!OutputSurface::BindToClient(client))
- return false;
+void MailboxOutputSurfaceEfl::BindToClient(viz::OutputSurfaceClient* client) {
+ OutputSurface::BindToClient(client);
GetCommandBufferProxy()->SetSwapBuffersCompletionCallback(
swap_buffers_completion_callback_.callback());
- return true;
+ return;
}
gpu::CommandBufferProxyImpl* MailboxOutputSurfaceEfl::GetCommandBufferProxy() {
- ContextProviderCommandBuffer* provider_command_buffer =
- static_cast<ContextProviderCommandBuffer*>(context_provider_.get());
+ ui::ContextProviderCommandBuffer* provider_command_buffer =
+ static_cast<ui::ContextProviderCommandBuffer*>(context_provider_.get());
gpu::CommandBufferProxyImpl* command_buffer_proxy =
provider_command_buffer->GetCommandBufferProxy();
DCHECK(command_buffer_proxy);
return command_buffer_proxy;
}
-void MailboxOutputSurfaceEfl::OnSwapBuffersCompleted(
+/*void MailboxOutputSurfaceEfl::OnSwapBuffersCompleted(
const std::vector<ui::LatencyInfo>& latency_info,
gfx::SwapResult result,
const gpu::GpuProcessHostedCALayerTreeParamsMac* params_mac) {
RenderWidgetHostImpl::CompositorFrameDrawn(latency_info);
+#if !defined(EWK_BRINGUP) // FIXME: m67 bringup
+ // FIXME: EWK_BRINGUP definition should be removed.
+ // OnSwapBuffersComplete was removed in cc/output/output_surface.h
OutputSurface::OnSwapBuffersComplete();
-}
+#endif // !defined(EWK_BRINGUP)
+}*/
MailboxOutputSurfaceEfl::TransferableFrame::TransferableFrame()
: texture_id(0) {}
const gfx::Size size)
: texture_id(texture_id), mailbox(mailbox), size(size) {}
+void MailboxOutputSurfaceEfl::SetDrawRectangle(const gfx::Rect& rect) {}
+
+bool MailboxOutputSurfaceEfl::HasExternalStencilTest() const {
+ NOTIMPLEMENTED();
+ return false;
+}
+
+void MailboxOutputSurfaceEfl::ApplyExternalStencil() {
+ NOTIMPLEMENTED();
+}
+
+viz::OverlayCandidateValidator*
+MailboxOutputSurfaceEfl::GetOverlayCandidateValidator() const {
+ return nullptr;
+}
+
+bool MailboxOutputSurfaceEfl::IsDisplayedAsOverlayPlane() const {
+ return false;
+}
+
+unsigned MailboxOutputSurfaceEfl::GetOverlayTextureId() const {
+ return 0;
+}
+
+gfx::BufferFormat MailboxOutputSurfaceEfl::GetOverlayBufferFormat() const {
+ return gfx::BufferFormat::RGBX_8888;
+}
+
+bool MailboxOutputSurfaceEfl::SurfaceIsSuspendForRecycle() const {
+ return false;
+}
+
} // namespace content
#define CONTENT_BROWSER_COMPOSITOR_MAILBOX_OUTPUT_SURFACE_EFL_H_
#include "base/cancelable_callback.h"
-#include "cc/output/gl_frame_data.h"
-#include "cc/output/output_surface.h"
-#include "cc/resources/resource_format.h"
-#include "content/common/gpu/client/context_provider_command_buffer.h"
+#include "components/viz/common/resources/resource_format.h"
+#include "components/viz/service/display/output_surface.h"
#include "gpu/ipc/client/command_buffer_proxy_impl.h"
-#include "ui/gfx/swap_result.h"
+#include "services/ui/public/cpp/gpu/context_provider_command_buffer.h"
#include "ui/compositor/compositor.h"
+#include "ui/gfx/swap_result.h"
namespace content {
-class MailboxOutputSurfaceEfl : public cc::OutputSurface {
+class MailboxOutputSurfaceEfl : public viz::OutputSurface {
public:
MailboxOutputSurfaceEfl(
- const scoped_refptr<ContextProviderCommandBuffer>& context_provider,
- cc::ResourceFormat format);
+ const scoped_refptr<ui::ContextProviderCommandBuffer>& context_provider,
+ viz::ResourceFormat format);
~MailboxOutputSurfaceEfl() override;
- // cc::OutputSurface implementation.
- bool BindToClient(cc::OutputSurfaceClient* client) override;
- void DetachFromClient() override;
+ // viz::OutputSurface implementation.
+ void BindToClient(viz::OutputSurfaceClient* client) override;
void EnsureBackbuffer() override;
void DiscardBackbuffer() override;
- void Reshape(const gfx::Size& size, float scale_factor, bool alpha) override;
void BindFramebuffer() override;
- void SwapBuffers(cc::CompositorFrame frame) override;
-
- void SetCompositorClient(ui::CompositorClient* client) {
- compositor_client_ = client;
- }
-
+ void SetDrawRectangle(const gfx::Rect& rect) override;
+ void Reshape(const gfx::Size& size,
+ float scale_factor,
+ const gfx::ColorSpace& color_space,
+ bool has_alpha,
+ bool use_stencil) override;
+ void SwapBuffers(viz::OutputSurfaceFrame frame) override;
+ bool HasExternalStencilTest() const override;
+ void ApplyExternalStencil() override;
uint32_t GetFramebufferCopyTextureFormat() override;
+ viz::OverlayCandidateValidator* GetOverlayCandidateValidator() const override;
+ bool IsDisplayedAsOverlayPlane() const override;
+ unsigned GetOverlayTextureId() const override;
+ gfx::BufferFormat GetOverlayBufferFormat() const override;
+ bool SurfaceIsSuspendForRecycle() const override;
private:
+#if !defined(EWK_BRINGUP) // FIXME: m67 bringup
+ // FIXME: EWK_BRINGUP definition should be removed.
+ // cc::GLFrameData was removed in cc/output/gl_frame_data.h
void OnSwapAck(std::unique_ptr<cc::GLFrameData> gl_frame_data);
void DrawTexture(std::unique_ptr<cc::GLFrameData> gl_frame_data);
+#endif // !defined(EWK_BRINGUP)
gpu::CommandBufferProxyImpl* GetCommandBufferProxy();
void OnSwapBuffersCompleted(
const std::vector<ui::LatencyInfo>& latency_info,
uint32_t fbo_;
bool is_backbuffer_discarded_;
bool texture_upload_pending_;
- cc::ResourceFormat format_;
+ viz::ResourceFormat format_;
};
} // namespace content
#include "content/public/browser/render_frame_host.h"
#include "content/public/browser/web_contents_observer.h"
#include "media/base/efl/media_player_manager_efl.h"
-#include "third_party/WebKit/public/platform/WebMediaPlayer.h"
+#include "third_party/blink/public/platform/WebMediaPlayer.h"
namespace content {
#include "content/browser/renderer_host/render_widget_host_impl.h"
#include "content/browser/renderer_host/render_widget_host_view_efl.h"
#include "third_party/icu/source/common/unicode/uchar.h"
-#include "wtf/text/icu/UnicodeIcu.h"
#ifdef IM_CTX_DEBUG
#define IM_CTX_LOG_CHANNEL LOG(ERROR)
#define IM_CTX_LOG IM_CTX_LOG_CHANNEL << "## IMCTX ## " << __FUNCTION__ << " "
// FIXME: we do not handle text compositing correctly yet.
-// Limit the functinality of this class to the handling of virtual keyboard for now.
+// Limit the functinality of this class to the handling of virtual keyboard for
+// now.
#define USE_IM_COMPOSITING 1
namespace {
}
Eina_Bool IsIMFVisible(Ecore_IMF_Context* context_) {
- return ecore_imf_context_input_panel_state_get(context_)
- == ECORE_IMF_INPUT_PANEL_STATE_SHOW;
+ return ecore_imf_context_input_panel_state_get(context_) ==
+ ECORE_IMF_INPUT_PANEL_STATE_SHOW;
}
-} // namespace
+} // namespace
namespace content {
return new IMContextEfl(view, context);
}
-IMContextEfl::IMContextEfl(RenderWidgetHostViewEfl* view, Ecore_IMF_Context* context)
+IMContextEfl::IMContextEfl(RenderWidgetHostViewEfl* view,
+ Ecore_IMF_Context* context)
: view_(view),
context_(context),
is_focused_(false),
}
void IMContextEfl::InitializeIMFContext(Ecore_IMF_Context* context) {
- // FIXME: IME was not shown when this value was set as false on Wayland.
- // So temporarily block the code until find root cause.
+// FIXME: IME was not shown when this value was set as false on Wayland.
+// So temporarily block the code until find root cause.
#if !defined(USE_WAYLAND)
ecore_imf_context_input_panel_enabled_set(context, false);
#endif
ecore_imf_context_use_preedit_set(context, false);
- ecore_imf_context_event_callback_add(context, ECORE_IMF_CALLBACK_PREEDIT_CHANGED, &IMFPreeditChangedCallback, this);
- ecore_imf_context_event_callback_add(context, ECORE_IMF_CALLBACK_COMMIT, &IMFCommitCallback, this);
- ecore_imf_context_input_panel_event_callback_add(context, ECORE_IMF_INPUT_PANEL_STATE_EVENT, &IMFInputPanelStateChangedCallback, this);
- ecore_imf_context_input_panel_event_callback_add(context, ECORE_IMF_INPUT_PANEL_GEOMETRY_EVENT, &IMFInputPanelGeometryChangedCallback, this);
- ecore_imf_context_input_panel_event_callback_add(context, ECORE_IMF_CANDIDATE_PANEL_STATE_EVENT, &IMFCandidatePanelStateChangedCallback, this);
- ecore_imf_context_input_panel_event_callback_add(context, ECORE_IMF_CANDIDATE_PANEL_GEOMETRY_EVENT, &IMFCandidatePanelGeometryChangedCallback, this);
- ecore_imf_context_input_panel_event_callback_add(context, ECORE_IMF_INPUT_PANEL_LANGUAGE_EVENT, &IMFCandidatePanelLanguageChangedCallback, this);
- ecore_imf_context_event_callback_add(context, ECORE_IMF_CALLBACK_DELETE_SURROUNDING, &IMFDeleteSurroundingCallback, this);
- ecore_imf_context_retrieve_surrounding_callback_set(context, &IMFRetrieveSurroundingCallback, this);
+ ecore_imf_context_event_callback_add(context,
+ ECORE_IMF_CALLBACK_PREEDIT_CHANGED,
+ &IMFPreeditChangedCallback, this);
+ ecore_imf_context_event_callback_add(context, ECORE_IMF_CALLBACK_COMMIT,
+ &IMFCommitCallback, this);
+ ecore_imf_context_input_panel_event_callback_add(
+ context, ECORE_IMF_INPUT_PANEL_STATE_EVENT,
+ &IMFInputPanelStateChangedCallback, this);
+ ecore_imf_context_input_panel_event_callback_add(
+ context, ECORE_IMF_INPUT_PANEL_GEOMETRY_EVENT,
+ &IMFInputPanelGeometryChangedCallback, this);
+ ecore_imf_context_input_panel_event_callback_add(
+ context, ECORE_IMF_CANDIDATE_PANEL_STATE_EVENT,
+ &IMFCandidatePanelStateChangedCallback, this);
+ ecore_imf_context_input_panel_event_callback_add(
+ context, ECORE_IMF_CANDIDATE_PANEL_GEOMETRY_EVENT,
+ &IMFCandidatePanelGeometryChangedCallback, this);
+ ecore_imf_context_input_panel_event_callback_add(
+ context, ECORE_IMF_INPUT_PANEL_LANGUAGE_EVENT,
+ &IMFCandidatePanelLanguageChangedCallback, this);
+ ecore_imf_context_event_callback_add(context,
+ ECORE_IMF_CALLBACK_DELETE_SURROUNDING,
+ &IMFDeleteSurroundingCallback, this);
+ ecore_imf_context_retrieve_surrounding_callback_set(
+ context, &IMFRetrieveSurroundingCallback, this);
}
IMContextEfl::~IMContextEfl() {
}
void IMContextEfl::HandleKeyDownEvent(const Evas_Event_Key_Down* event,
- bool* wasFiltered, std::string* utf8_key) {
+ bool* wasFiltered,
+ std::string* utf8_key) {
#if USE_IM_COMPOSITING
Ecore_IMF_Event im_event;
is_handling_keydown_ = true;
utf8_key_ = event->keyname;
- ecore_imf_evas_event_key_down_wrap(const_cast<Evas_Event_Key_Down*>(event), &im_event.key_down);
- *wasFiltered = ecore_imf_context_filter_event(context_, ECORE_IMF_EVENT_KEY_DOWN, &im_event);
+ ecore_imf_evas_event_key_down_wrap(const_cast<Evas_Event_Key_Down*>(event),
+ &im_event.key_down);
+ *wasFiltered = ecore_imf_context_filter_event(
+ context_, ECORE_IMF_EVENT_KEY_DOWN, &im_event);
// In November 2003, UTF-8 was restricted by RFC 3629 to end at U+10FFFF,
// in order to match the constraints of the UTF-16 character encoding.
// This removed all 5- and 6-byte sequences, and about half of the 4-byte
#endif
}
-void IMContextEfl::HandleKeyUpEvent(const Evas_Event_Key_Up* event, bool* wasFiltered) {
+void IMContextEfl::HandleKeyUpEvent(const Evas_Event_Key_Up* event,
+ bool* wasFiltered) {
#if USE_IM_COMPOSITING
Ecore_IMF_Event im_event;
- ecore_imf_evas_event_key_up_wrap(const_cast<Evas_Event_Key_Up*>(event), &im_event.key_up);
- *wasFiltered = ecore_imf_context_filter_event(context_, ECORE_IMF_EVENT_KEY_UP, &im_event);
+ ecore_imf_evas_event_key_up_wrap(const_cast<Evas_Event_Key_Up*>(event),
+ &im_event.key_up);
+ *wasFiltered = ecore_imf_context_filter_event(
+ context_, ECORE_IMF_EVENT_KEY_UP, &im_event);
#endif
}
}
Ecore_IMF_Input_Panel_Layout layout;
- Ecore_IMF_Input_Panel_Return_Key_Type return_key_type = ECORE_IMF_INPUT_PANEL_RETURN_KEY_TYPE_DEFAULT;
+ Ecore_IMF_Input_Panel_Return_Key_Type return_key_type =
+ ECORE_IMF_INPUT_PANEL_RETURN_KEY_TYPE_DEFAULT;
Ecore_IMF_Autocapital_Type cap_type = ECORE_IMF_AUTOCAPITAL_TYPE_NONE;
bool allow_prediction = true;
bool can_compose_inline,
bool show_if_needed) {
if (current_type_ != type || can_compose_inline_ != can_compose_inline) {
- UpdateInputMethodType(type, ui::TEXT_INPUT_MODE_DEFAULT, can_compose_inline);
+ UpdateInputMethodType(type, ui::TEXT_INPUT_MODE_DEFAULT,
+ can_compose_inline);
// Workaround on platform issue:
// http://107.108.218.239/bugzilla/show_bug.cgi?id=11494
// Keyboard layout doesn't update after change.
if (IsIMFVisible(context_) && type != ui::TEXT_INPUT_TYPE_NONE) {
- HidePanel();
- ShowPanel();
+ HidePanel();
+ ShowPanel();
}
}
bool show = type != ui::TEXT_INPUT_TYPE_NONE;
if (show && !IsIMFVisible(context_) && show_if_needed) {
ShowPanel();
- // TODO(youngsoo): workaround on tizen v3.0 platform issue
- // Even if virtual keyboard is shown,
- // the API 'ecore_imf_context_input_panel_state_get()'
- // returns '1' which means the keyboard is not shown.
- // It makes the 'HidePanel()' unreachable.
-#if TIZEN_VERSION_EQ(3,0,0)
+// TODO(youngsoo): workaround on tizen v3.0 platform issue
+// Even if virtual keyboard is shown,
+// the API 'ecore_imf_context_input_panel_state_get()'
+// returns '1' which means the keyboard is not shown.
+// It makes the 'HidePanel()' unreachable.
+#if TIZEN_VERSION_EQ(3, 0, 0)
} else if (!show) {
#else
} else if (!show && IsIMFVisible(context_)) {
if (composition_.text.length() > 0) {
base::string16 empty;
view_->ConfirmComposition(empty);
- composition_.Clear();
+ composition_.text = base::UTF8ToUTF16("");
}
}
return;
if (is_in_form_tag_)
- ecore_imf_context_input_panel_return_key_type_set(context_,
- ECORE_IMF_INPUT_PANEL_RETURN_KEY_TYPE_GO);
+ ecore_imf_context_input_panel_return_key_type_set(
+ context_, ECORE_IMF_INPUT_PANEL_RETURN_KEY_TYPE_GO);
else {
if (current_type_ == ui::TEXT_INPUT_TYPE_TEXT ||
current_type_ == ui::TEXT_INPUT_TYPE_NUMBER)
- ecore_imf_context_input_panel_return_key_type_set(context_,
- ECORE_IMF_INPUT_PANEL_RETURN_KEY_TYPE_DONE);
+ ecore_imf_context_input_panel_return_key_type_set(
+ context_, ECORE_IMF_INPUT_PANEL_RETURN_KEY_TYPE_DONE);
else
- ecore_imf_context_input_panel_return_key_type_set(context_,
- ECORE_IMF_INPUT_PANEL_RETURN_KEY_TYPE_DEFAULT);
+ ecore_imf_context_input_panel_return_key_type_set(
+ context_, ECORE_IMF_INPUT_PANEL_RETURN_KEY_TYPE_DEFAULT);
}
}
#if USE_IM_COMPOSITING
IM_CTX_LOG;
- composition_.Clear();
+ composition_.text = base::UTF8ToUTF16("");
char* text = static_cast<char*>(event_info);
if (!buf.length())
return;
- std::string str = base::UTF16ToUTF8(buf.substr(buf.length() -1));
+ std::string str = base::UTF16ToUTF8(buf.substr(buf.length() - 1));
Evas_Event_Key_Down downEvent;
memset(&downEvent, 0, sizeof(Evas_Event_Key_Down));
downEvent.string = str.c_str();
NativeWebKeyboardEvent n_event = MakeWebKeyboardEvent(true, &downEvent);
- n_event.isSystemKey = true;
+ n_event.is_system_key = true;
if (!view_->GetRenderWidgetHost())
return;
- PushToKeyUpEventQueue(n_event.windowsKeyCode);
+ PushToKeyUpEventQueue(n_event.windows_key_code);
view_->GetRenderWidgetHost()->ForwardKeyboardEvent(n_event);
}
-void IMContextEfl::OnPreeditChanged(void* data, Ecore_IMF_Context* context, void* event_info) {
+void IMContextEfl::OnPreeditChanged(void* data,
+ Ecore_IMF_Context* context,
+ void* event_info) {
if (is_ime_ctx_reset_)
return;
#if USE_IM_COMPOSITING
- composition_.Clear();
-
+ composition_.text = base::UTF8ToUTF16("");
char* buffer = 0;
ecore_imf_context_preedit_string_get(context, &buffer, 0);
// Add empty commit to stop processing commits.
commit_queue_.push(base::string16());
+ composition_.text = base::UTF8ToUTF16("");
base::string16 text16 = base::UTF8ToUTF16(buffer);
if (!text16.empty())
SendFakeCompositionKeyEvent(text16);
- composition_.Clear();
composition_.text = text16;
- composition_.underlines.push_back(ui::CompositionUnderline(0, composition_.text.length(), SK_ColorBLACK, false));
+ ui::ImeTextSpan text_underline(ui::ImeTextSpan::Type::kComposition, 0,
+ composition_.text.length(), SK_ColorBLACK,
+ false, SK_ColorTRANSPARENT);
+ composition_.ime_text_spans.push_back(text_underline);
composition_.selection = gfx::Range(composition_.text.length());
// Only add preedit to queue, till we dont know if key event
IM_CTX_LOG << ": show";
if (view_->smart_parent())
evas_object_smart_callback_call(view_->smart_parent(),
- "editorclient,ime,opened", 0);
+ "editorclient,ime,opened", 0);
view_->ScrollFocusedEditableNode();
} else if (state == ECORE_IMF_INPUT_PANEL_STATE_HIDE) {
IM_CTX_LOG << ": hide";
if (view_->smart_parent())
evas_object_smart_callback_call(view_->smart_parent(),
- "editorclient,ime,closed", 0);
+ "editorclient,ime,closed", 0);
}
// ignore ECORE_IMF_INPUT_PANEL_WILL_SHOW value
void IMContextEfl::OnInputPanelGeometryChanged() {
Eina_Rectangle rect;
- ecore_imf_context_input_panel_geometry_get(context_, &rect.x, &rect.y, &rect.w, &rect.h);
+ ecore_imf_context_input_panel_geometry_get(context_, &rect.x, &rect.y,
+ &rect.w, &rect.h);
if (view_->smart_parent())
evas_object_smart_callback_call(view_->smart_parent(),
- "inputmethod,changed", static_cast<void*>(&rect));
+ "inputmethod,changed",
+ static_cast<void*>(&rect));
// Scroll to focused editable node if virtual keyboard
// changed geometry
if (rect.w > 0 || rect.h > 0)
if (state == ECORE_IMF_CANDIDATE_PANEL_SHOW) {
if (view_->smart_parent())
evas_object_smart_callback_call(view_->smart_parent(),
- "editorclient,candidate,opened", 0);
- }
- else {
+ "editorclient,candidate,opened", 0);
+ } else {
if (view_->smart_parent())
evas_object_smart_callback_call(view_->smart_parent(),
- "editorclient,candidate,closed", 0);
+ "editorclient,candidate,closed", 0);
}
}
-void IMContextEfl::OnCandidateInputPanelGeometryChanged() {
-}
+void IMContextEfl::OnCandidateInputPanelGeometryChanged() {}
bool IMContextEfl::OnRetrieveSurrounding(char** text, int* offset) {
return false;
}
-void IMContextEfl::OnDeleteSurrounding(void* event_info) {
-}
+void IMContextEfl::OnDeleteSurrounding(void* event_info) {}
-void IMContextEfl::OnCandidateInputPanelLanguageChanged(Ecore_IMF_Context*, int) {
- RenderWidgetHostImpl *rwhi = GetRenderWidgetHostImpl();
+void IMContextEfl::OnCandidateInputPanelLanguageChanged(Ecore_IMF_Context*,
+ int) {
+ RenderWidgetHostImpl* rwhi = GetRenderWidgetHostImpl();
if (!rwhi || composition_.text.length() == 0)
return;
keydown_event_queue_ = KeyDownEventQueue();
}
-void IMContextEfl::IMFCommitCallback(
- void* data, Ecore_IMF_Context*, void* event_info) {
+void IMContextEfl::IMFCommitCallback(void* data,
+ Ecore_IMF_Context*,
+ void* event_info) {
static_cast<IMContextEfl*>(data)->OnCommit(event_info);
}
-void IMContextEfl::IMFPreeditChangedCallback(
- void* data, Ecore_IMF_Context* context, void* event_info) {
- static_cast<IMContextEfl*>(data)->
- OnPreeditChanged(data, context, event_info);
+void IMContextEfl::IMFPreeditChangedCallback(void* data,
+ Ecore_IMF_Context* context,
+ void* event_info) {
+ static_cast<IMContextEfl*>(data)->OnPreeditChanged(data, context, event_info);
}
-void IMContextEfl::IMFInputPanelStateChangedCallback(
- void* data, Ecore_IMF_Context*, int state) {
+void IMContextEfl::IMFInputPanelStateChangedCallback(void* data,
+ Ecore_IMF_Context*,
+ int state) {
static_cast<IMContextEfl*>(data)->OnInputPanelStateChanged(state);
}
-void IMContextEfl::IMFInputPanelGeometryChangedCallback(
- void* data, Ecore_IMF_Context*, int state) {
+void IMContextEfl::IMFInputPanelGeometryChangedCallback(void* data,
+ Ecore_IMF_Context*,
+ int state) {
static_cast<IMContextEfl*>(data)->OnInputPanelGeometryChanged();
}
-void IMContextEfl::IMFCandidatePanelStateChangedCallback(
- void* data, Ecore_IMF_Context*, int state) {
+void IMContextEfl::IMFCandidatePanelStateChangedCallback(void* data,
+ Ecore_IMF_Context*,
+ int state) {
static_cast<IMContextEfl*>(data)->OnCandidateInputPanelStateChanged(state);
}
-void IMContextEfl::IMFCandidatePanelGeometryChangedCallback(
- void* data, Ecore_IMF_Context*, int state) {
+void IMContextEfl::IMFCandidatePanelGeometryChangedCallback(void* data,
+ Ecore_IMF_Context*,
+ int state) {
static_cast<IMContextEfl*>(data)->OnCandidateInputPanelGeometryChanged();
}
-Eina_Bool IMContextEfl::IMFRetrieveSurroundingCallback(
- void* data, Ecore_IMF_Context*, char** text, int* offset) {
+Eina_Bool IMContextEfl::IMFRetrieveSurroundingCallback(void* data,
+ Ecore_IMF_Context*,
+ char** text,
+ int* offset) {
return static_cast<IMContextEfl*>(data)->OnRetrieveSurrounding(text, offset);
}
-void IMContextEfl::IMFDeleteSurroundingCallback(
- void* data, Ecore_IMF_Context*, void* event_info) {
+void IMContextEfl::IMFDeleteSurroundingCallback(void* data,
+ Ecore_IMF_Context*,
+ void* event_info) {
static_cast<IMContextEfl*>(data)->OnDeleteSurrounding(event_info);
}
void IMContextEfl::IMFCandidatePanelLanguageChangedCallback(
- void* data, Ecore_IMF_Context* context, int value) {
- static_cast<IMContextEfl*>(data)->
- OnCandidateInputPanelLanguageChanged(context, value);
+ void* data,
+ Ecore_IMF_Context* context,
+ int value) {
+ static_cast<IMContextEfl*>(data)->OnCandidateInputPanelLanguageChanged(
+ context, value);
}
void IMContextEfl::HandleKeyEvent(bool processed) {
- ProcessNextCommitText(processed);
- ProcessNextPreeditText(processed);
- ProcessNextKeyDownEvent();
- ProcessNextKeyUpEvent();
+ ProcessNextCommitText(processed);
+ ProcessNextPreeditText(processed);
+ ProcessNextKeyDownEvent();
+ ProcessNextKeyUpEvent();
}
void IMContextEfl::ProcessNextCommitText(bool processed) {
if (keydown_event_queue_.empty())
return;
- GetRenderWidgetHostImpl()
- ->ForwardKeyboardEvent(keydown_event_queue_.front());
+ GetRenderWidgetHostImpl()->ForwardKeyboardEvent(keydown_event_queue_.front());
keydown_event_queue_.pop();
}
keyup_event_queue_.pop();
}
-void IMContextEfl::SendCompositionKeyUpEvent(char c) {
- NativeWebKeyboardEvent event;
- event.windowsKeyCode = c;
- event.skip_in_browser = false;
- event.type = blink::WebInputEvent::KeyUp;
+// #if !defined(EWK_BRINGUP) // FIXME: m67 bringup
+// TODO: Changes made for M63 bring-up. Check its working.
+void IMContextEfl::SendCompositionKeyUpEvent(int code) {
+ blink::WebKeyboardEvent keyboard_event(
+ blink::WebInputEvent::kKeyUp, blink::WebInputEvent::kNoModifiers, 0.0);
+ keyboard_event.windows_key_code = code;
- GetRenderWidgetHostImpl()->ForwardKeyboardEvent(event);
+ gfx::NativeView native_view;
+ GetRenderWidgetHostImpl()->ForwardKeyboardEvent(
+ NativeWebKeyboardEvent(keyboard_event, native_view));
}
void IMContextEfl::PushToKeyUpEventQueue(int key) {
return NULL;
return RenderWidgetHostImpl::From(rwh);
}
-} // namespace content
+} // namespace content
#include <Evas.h>
-#include "content/public/browser/native_web_keyboard_event.h"
#include "content/browser/renderer_host/web_event_factory_efl.h"
+#include "content/public/browser/native_web_keyboard_event.h"
#include "ui/base/ime/composition_text.h"
#include "ui/gfx/geometry/rect.h"
~IMContextEfl();
- void HandleKeyDownEvent(const Evas_Event_Key_Down* event, bool* wasFiltered,
- std::string* utf8_key);
+ void HandleKeyDownEvent(const Evas_Event_Key_Down* event,
+ bool* wasFiltered,
+ std::string* utf8_key);
void HandleKeyUpEvent(const Evas_Event_Key_Up* event, bool* wasFiltered);
- void UpdateInputMethodType(ui::TextInputType, ui::TextInputMode,
+ void UpdateInputMethodType(ui::TextInputType,
+ ui::TextInputMode,
bool can_compose_inline);
- void UpdateInputMethodState(ui::TextInputType, bool can_compose_inline,
+ void UpdateInputMethodState(ui::TextInputType,
+ bool can_compose_inline,
bool show_if_needed);
void UpdateCaretBounds(const gfx::Rect& caret_bounds);
void InitializeIMFContext(Ecore_IMF_Context*);
// callbacks
- static void IMFCommitCallback(void* data, Ecore_IMF_Context*, void* event_info);
- static void IMFPreeditChangedCallback(void* data, Ecore_IMF_Context* context, void* event_info);
- static void IMFInputPanelStateChangedCallback(void* data, Ecore_IMF_Context*, int state);
- static void IMFInputPanelGeometryChangedCallback(void* data, Ecore_IMF_Context*, int state);
- static void IMFCandidatePanelStateChangedCallback(void* data, Ecore_IMF_Context*, int state);
- static void IMFCandidatePanelGeometryChangedCallback(void* data, Ecore_IMF_Context*, int state);
- static Eina_Bool IMFRetrieveSurroundingCallback(void* data, Ecore_IMF_Context*, char** text, int* offset);
- static void IMFDeleteSurroundingCallback(void* data, Ecore_IMF_Context*, void* event_info);
- static void IMFCandidatePanelLanguageChangedCallback(void* data, Ecore_IMF_Context* context, int value);
+ static void IMFCommitCallback(void* data,
+ Ecore_IMF_Context*,
+ void* event_info);
+ static void IMFPreeditChangedCallback(void* data,
+ Ecore_IMF_Context* context,
+ void* event_info);
+ static void IMFInputPanelStateChangedCallback(void* data,
+ Ecore_IMF_Context*,
+ int state);
+ static void IMFInputPanelGeometryChangedCallback(void* data,
+ Ecore_IMF_Context*,
+ int state);
+ static void IMFCandidatePanelStateChangedCallback(void* data,
+ Ecore_IMF_Context*,
+ int state);
+ static void IMFCandidatePanelGeometryChangedCallback(void* data,
+ Ecore_IMF_Context*,
+ int state);
+ static Eina_Bool IMFRetrieveSurroundingCallback(void* data,
+ Ecore_IMF_Context*,
+ char** text,
+ int* offset);
+ static void IMFDeleteSurroundingCallback(void* data,
+ Ecore_IMF_Context*,
+ void* event_info);
+ static void IMFCandidatePanelLanguageChangedCallback(
+ void* data,
+ Ecore_IMF_Context* context,
+ int value);
// callback handlers
void OnCommit(void* event_info);
- void OnPreeditChanged(void* data, Ecore_IMF_Context* context, void* event_info);
+ void OnPreeditChanged(void* data,
+ Ecore_IMF_Context* context,
+ void* event_info);
void OnInputPanelStateChanged(int state);
void OnInputPanelGeometryChanged();
bool OnRetrieveSurrounding(char** text, int* offset);
void OnDeleteSurrounding(void* event_info);
- void OnCandidateInputPanelLanguageChanged(Ecore_IMF_Context* context, int value);
+ void OnCandidateInputPanelLanguageChanged(Ecore_IMF_Context* context,
+ int value);
void ProcessNextCommitText(bool processed);
void ProcessNextPreeditText(bool processed);
void ProcessNextKeyDownEvent();
void ProcessNextKeyUpEvent();
- void SendCompositionKeyUpEvent(char c);
+ void SendCompositionKeyUpEvent(int code);
RenderWidgetHostImpl* GetRenderWidgetHostImpl() const;
std::string utf8_key_;
};
-} // namespace content
+} // namespace content
#endif
#include "content/public/browser/native_web_keyboard_event.h"
+#include "ui/events/base_event_utils.h"
+#include "ui/events/blink/web_input_event.h"
#include "ui/events/event.h"
+#include "ui/events/keycodes/dom/keycode_converter.h"
namespace content {
return event ? ui::Event::Clone(*event).release() : nullptr;
}
-NativeWebKeyboardEvent::NativeWebKeyboardEvent()
- : os_event(NULL),
- skip_in_browser(false) {
-}
+NativeWebKeyboardEvent::NativeWebKeyboardEvent(blink::WebInputEvent::Type type,
+ int modifiers,
+ base::TimeTicks timestamp)
+ : NativeWebKeyboardEvent(type,
+ modifiers,
+ ui::EventTimeStampToSeconds(timestamp)) {}
-NativeWebKeyboardEvent::NativeWebKeyboardEvent(const NativeWebKeyboardEvent& other)
- : WebKeyboardEvent(other)
- , os_event(CopyEvent(other.os_event))
- , skip_in_browser(other.skip_in_browser) {
-}
+NativeWebKeyboardEvent::NativeWebKeyboardEvent(blink::WebInputEvent::Type type,
+ int modifiers,
+ double timestampSeconds)
+ : WebKeyboardEvent(type, modifiers, timestampSeconds),
+ os_event(nullptr),
+ skip_in_browser(false) {}
-NativeWebKeyboardEvent::~NativeWebKeyboardEvent() {
- delete os_event;
+NativeWebKeyboardEvent::NativeWebKeyboardEvent(
+ const blink::WebKeyboardEvent& web_event,
+ gfx::NativeView native_view)
+ : WebKeyboardEvent(web_event), os_event(nullptr), skip_in_browser(false) {}
+
+NativeWebKeyboardEvent::NativeWebKeyboardEvent(gfx::NativeEvent native_event)
+ : NativeWebKeyboardEvent(static_cast<ui::KeyEvent&>(*native_event)) {}
+
+NativeWebKeyboardEvent::NativeWebKeyboardEvent(const ui::KeyEvent& key_event)
+ : WebKeyboardEvent(ui::MakeWebKeyboardEvent(key_event)),
+#if !defined(EWK_BRINGUP) // FIXME: m67 bringup
+ os_event(CopyEvent(&key_event)),
+#else
+ os_event(nullptr),
+#endif
+ skip_in_browser(false) {
}
NativeWebKeyboardEvent& NativeWebKeyboardEvent::operator=(
- const NativeWebKeyboardEvent& other) {
+ const NativeWebKeyboardEvent& other) {
WebKeyboardEvent::operator=(other);
delete os_event;
os_event = CopyEvent(other.os_event);
skip_in_browser = other.skip_in_browser;
+
return *this;
}
+NativeWebKeyboardEvent::~NativeWebKeyboardEvent() {
+ delete os_event;
}
+
+} // namespace content
#include <Ecore.h>
#include <Ecore_Evas.h>
#include <Ecore_Input.h>
-#include "ecore_x_wayland_wrapper.h"
#include <Elementary.h>
+#include "ecore_x_wayland_wrapper.h"
#include "base/auto_reset.h"
#include "base/bind.h"
-#include "base/command_line.h"
#include "base/callback_helpers.h"
#include "base/command_line.h"
-#include "base/trace_event/trace_event.h"
+#include "base/logging.h"
+#include "base/memory/ptr_util.h"
#include "base/message_loop/message_loop.h"
#include "base/strings/string_number_conversions.h"
-#include "base/threading/thread_task_runner_handle.h"
-#include "base/logging.h"
#include "base/strings/utf_string_conversions.h"
-#include "components/display_compositor/gl_helper.h"
+#include "base/threading/thread_task_runner_handle.h"
+#include "base/trace_event/trace_event.h"
#include "content/browser/gpu/browser_gpu_channel_host_factory.h"
#include "content/browser/gpu/compositor_util.h"
-#include "content/browser/renderer_host/render_widget_host_impl.h"
-#include "content/browser/renderer_host/resize_lock.h"
-#include "content/browser/renderer_host/ui_events_helper.h"
-#include "content/browser/renderer_host/im_context_efl.h"
+#include "content/browser/gpu/gpu_process_host.h"
+#include "content/browser/renderer_host/compositor_resize_lock.h"
+#include "content/browser/renderer_host/disambiguation_popup_efl.h"
#include "content/browser/renderer_host/edge_effect.h"
#include "content/browser/renderer_host/event_with_latency_info.h"
-#include "content/browser/renderer_host/disambiguation_popup_efl.h"
-#include "content/browser/renderer_host/web_event_factory_efl.h"
-#include "content/browser/renderer_host/input/web_input_event_util.h"
+#include "content/browser/renderer_host/im_context_efl.h"
#include "content/browser/renderer_host/render_view_host_impl.h"
-#include "content/browser/gpu/gpu_process_host.h"
-#include "content/common/input/did_overscroll_params.h"
-#include "content/common/input_messages.h"
+#include "content/browser/renderer_host/render_widget_host_impl.h"
+#include "content/browser/renderer_host/ui_events_helper.h"
+#include "content/browser/renderer_host/web_event_factory_efl.h"
#include "content/common/cursors/webcursor_efl.h"
+#include "content/common/input_messages.h"
#include "content/common/view_messages.h"
#include "content/gpu/shared_mailbox_manager.h"
-#include "content/public/browser/render_widget_host_view_frame_subscriber.h"
-#include "content/public/browser/screen_orientation_dispatcher_host.h"
-#include "content/public/browser/web_contents_delegate.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/context_factory.h"
#include "content/public/browser/render_process_host.h"
+#include "content/public/browser/web_contents_delegate.h"
#include "content/public/common/content_switches.h"
#include "gpu/command_buffer/service/mailbox_manager.h"
#include "gpu/ipc/common/gpu_messages.h"
#include "media/base/video_frame.h"
#include "media/base/video_util.h"
#include "skia/ext/image_operations.h"
-#include "third_party/WebKit/public/web/WebInputEvent.h"
-#include "third_party/WebKit/public/platform/WebScreenInfo.h"
-#include "third_party/WebKit/public/web/WebTouchPoint.h"
+#include "third_party/blink/public/platform/web_input_event.h"
+#include "third_party/blink/public/platform/WebScreenInfo.h"
+#include "third_party/blink/public/platform/WebTouchPoint.h"
#include "ui/base/clipboard/clipboard_helper_efl.h"
#include "ui/base/layout.h"
#include "ui/events/blink/blink_event_util.h"
+#include "ui/events/blink/did_overscroll_params.h"
#include "ui/events/event_switches.h"
#include "ui/events/event_utils.h"
#define private public
#include "ui/events/gestures/gesture_provider_aura.h"
#undef private
-#include "ui/events/gestures/gesture_recognizer_impl_efl.h"
#include "ui/compositor/compositor.h"
+#include "ui/display/device_display_info_efl.h"
#include "ui/display/display.h"
#include "ui/display/screen.h"
-#include "ui/display/device_display_info_efl.h"
+#include "ui/events/gestures/gesture_recognizer_impl_efl.h"
#include "ui/gfx/geometry/dip_util.h"
#include "ui/gfx/geometry/rect.h"
#include "ui/gfx/selection_bound.h"
#include "ui/gl/gl_shared_context_efl.h"
+#if !defined(EWK_BRINGUP) // FIXME: m67 bringup
+#include "components/display_compositor/gl_helper.h"
+#include "content/browser/renderer_host/resize_lock.h"
+#endif
+
#if defined(OS_TIZEN_MOBILE)
#include <efl_extension.h>
#endif
#define EFL_MAX_WIDTH 10000
#define EFL_MAX_HEIGHT 10000 // borrowed from GTK+ port
-#define MAX_SURFACE_WIDTH_EGL 4096 //max supported Framebuffer width
-#define MAX_SURFACE_HEIGHT_EGL 4096 //max supported Framebuffer height
+#define MAX_SURFACE_WIDTH_EGL 4096 // max supported Framebuffer width
+#define MAX_SURFACE_HEIGHT_EGL 4096 // max supported Framebuffer height
// These two constants are redefinitions of the original constants defined
// in evas_common.c. These are not supposed to be used directly by apps,
namespace {
-bool IsShiftKey(const char * key) {
+bool IsShiftKey(const char* key) {
if (!key)
return false;
return !strcmp(key, "Shift_L") || !strcmp(key, "Shift_R");
event.root_location_f(), event.flags(), event.unique_touch_event_id());
}
-} // namespace
+} // namespace
class ScreenshotCapturedCallback {
public:
- ScreenshotCapturedCallback(Screenshot_Captured_Callback func, void *user_data)
- : func_(func), user_data_(user_data) {}
+ ScreenshotCapturedCallback(Screenshot_Captured_Callback func, void* user_data)
+ : func_(func), user_data_(user_data) {}
void Run(Evas_Object* image) {
if (func_ != NULL)
(func_)(image, user_data_);
private:
Screenshot_Captured_Callback func_;
- void *user_data_;
+ void* user_data_;
};
+#if !defined(EWK_BRINGUP) // FIXME: m67 bringup
+// FIXME: EWK_BRINGUP definition should be removed.
+// GetDefaultScreenInfo was removed in
+// content/browser/renderer_host/render_widget_host_view_base.h
void RenderWidgetHostViewBase::GetDefaultScreenInfo(
blink::WebScreenInfo* results) {
- const display::Display display = display::Screen::GetScreen()->GetPrimaryDisplay();
+ const display::Display display =
+ display::Screen::GetScreen()->GetPrimaryDisplay();
results->rect = display.bounds();
results->availableRect = display.work_area();
results->orientationAngle = display.RotationAsDegree();
#if defined(OS_TIZEN_MOBILE)
results->orientationType =
- RenderWidgetHostViewBase::GetOrientationTypeForMobile(display);
+// RenderWidgetHostViewBase::GetOrientationTypeForMobile(display);
#else
results->orientationType =
- RenderWidgetHostViewBase::GetOrientationTypeForDesktop(display);
+// RenderWidgetHostViewBase::GetOrientationTypeForDesktop(display);
#endif
- // TODO(derat|oshima): Don't hardcode this. Get this from display object.
- results->depth = 24;
+ // TODO(derat|oshima): Don't hardcode this. Get this from display object.
+ results->depth = 24;
results->depthPerComponent = 8;
}
+#endif // !defined(EWK_BRINGUP)
RenderWidgetHostViewEfl::RenderWidgetHostViewEfl(RenderWidgetHost* widget,
- WebContents& web_contents)
- : host_(RenderWidgetHostImpl::From(widget)),
- im_context_(NULL),
- evas_(NULL),
- parent_view_(NULL),
- smart_parent_(NULL),
- content_image_(NULL),
- content_image_elm_host_(NULL),
- evas_gl_initialized_(false),
- device_scale_factor_(1.0f),
- magnifier_(false),
- is_loading_(false),
- gesture_recognizer_(ui::GestureRecognizer::Create()),
- current_orientation_(0),
- evas_gl_(NULL),
- evas_gl_api_(NULL),
- evas_gl_context_(NULL),
- evas_gl_surface_(NULL),
- evas_gl_config_(NULL),
- egl_image_(NULL),
- current_pixmap_id_(0),
- next_pixmap_id_(0),
- texture_id_(0),
- surface_id_(0),
- is_modifier_key_(false),
- touch_events_enabled_(false),
- handling_disambiguation_popup_gesture_(false),
- web_contents_(web_contents),
- compositor_(NULL),
- root_layer_(new ui::Layer(ui::LAYER_SOLID_COLOR)),
- delegated_frame_host_(new DelegatedFrameHost(this)),
- weak_factory_(this) {
+ WebContents& web_contents)
+ : host_(RenderWidgetHostImpl::From(widget)),
+ im_context_(NULL),
+ evas_(NULL),
+ parent_view_(NULL),
+ smart_parent_(NULL),
+ content_image_(NULL),
+ content_image_elm_host_(NULL),
+ evas_gl_initialized_(false),
+ device_scale_factor_(1.0f),
+ magnifier_(false),
+ is_loading_(false),
+ gesture_recognizer_(ui::GestureRecognizer::Create()),
+ current_orientation_(0),
+ evas_gl_(NULL),
+ evas_gl_api_(NULL),
+ evas_gl_context_(NULL),
+ evas_gl_surface_(NULL),
+ evas_gl_config_(NULL),
+ egl_image_(NULL),
+ current_pixmap_id_(0),
+ next_pixmap_id_(0),
+ texture_id_(0),
+ surface_id_(0),
+ is_modifier_key_(false),
+ touch_events_enabled_(false),
+ handling_disambiguation_popup_gesture_(false),
+ web_contents_(web_contents),
+ compositor_(NULL),
+ root_layer_(new ui::Layer(ui::LAYER_SOLID_COLOR)),
+#if !defined(EWK_BRINGUP) // FIXME: m67 bringup
+ // FIXME: EWK_BRINGUP definition should be removed.
+ // DelegatedFrameHost was changed. we need to fix it.
+ delegated_frame_host_(new DelegatedFrameHost(this)),
+#endif // !defined(EWK_BRINGUP)
+ weak_factory_(this) {
EnsureDeviceDisplayInfoInitialized();
SetDoubleTapSupportEnabled(touch_events_enabled_);
- device_scale_factor_ = display::Screen::GetScreen()->
- GetPrimaryDisplay().device_scale_factor();
+ device_scale_factor_ =
+ display::Screen::GetScreen()->GetPrimaryDisplay().device_scale_factor();
host_->SetView(this);
+#if !defined(EWK_BRINGUP) // FIXME: m67 bringup
+ // FIXME: EWK_BRINGUP definition should be removed.
+ // DelegatedFrameHost was changed. we need to fix it.
set_layer_owner_delegate(delegated_frame_host_.get());
+#endif // !defined(EWK_BRINGUP)
static bool scale_factor_initialized = false;
if (!scale_factor_initialized) {
evas_ = evas_object_evas_get(parent_view_);
// Update rotation degrees in device display info.
- UpdateRotationDegrees(ecore_evas_rotation_get(ecore_evas_ecore_evas_get(evas_)));
+ UpdateRotationDegrees(
+ ecore_evas_rotation_get(ecore_evas_ecore_evas_get(evas_)));
content_image_elm_host_ = elm_bg_add(parent_view_);
content_image_ = evas_object_image_filled_add(evas_);
- elm_object_part_content_set(content_image_elm_host_,
- "overlay", content_image_);
+ elm_object_part_content_set(content_image_elm_host_, "overlay",
+ content_image_);
elm_object_focus_allow_set(content_image_elm_host_, EINA_TRUE);
Evas_Object* smart_parent = evas_object_smart_parent_get(parent_view_);
evas_object_geometry_set(content_image_elm_host_, x, y, width, height);
evas_object_event_callback_add(parent_view_, EVAS_CALLBACK_RESIZE,
- OnParentViewResize, this);
+ OnParentViewResize, this);
evas_object_event_callback_add(content_image_, EVAS_CALLBACK_FOCUS_IN,
- OnFocusIn, this);
+ OnFocusIn, this);
evas_object_event_callback_add(content_image_, EVAS_CALLBACK_FOCUS_OUT,
- OnFocusOut, this);
- evas_object_smart_callback_add(content_image_elm_host_,
- "focused", OnHostFocusIn, this);
- evas_object_smart_callback_add(content_image_elm_host_,
- "unfocused", OnHostFocusOut, this);
+ OnFocusOut, this);
+ evas_object_smart_callback_add(content_image_elm_host_, "focused",
+ OnHostFocusIn, this);
+ evas_object_smart_callback_add(content_image_elm_host_, "unfocused",
+ OnHostFocusOut, this);
evas_object_event_callback_add(content_image_, EVAS_CALLBACK_MOUSE_DOWN,
- OnMouseDown, this);
+ OnMouseDown, this);
evas_object_event_callback_add(content_image_, EVAS_CALLBACK_MOUSE_UP,
- OnMouseUp, this);
+ OnMouseUp, this);
evas_object_event_callback_add(content_image_, EVAS_CALLBACK_MOUSE_MOVE,
- OnMouseMove, this);
+ OnMouseMove, this);
evas_object_event_callback_add(content_image_, EVAS_CALLBACK_MOUSE_WHEEL,
- OnMouseWheel, this);
+ OnMouseWheel, this);
evas_object_event_callback_add(content_image_, EVAS_CALLBACK_KEY_DOWN,
- OnKeyDown, this);
- evas_object_event_callback_add(content_image_, EVAS_CALLBACK_KEY_UP,
- OnKeyUp, this);
+ OnKeyDown, this);
+ evas_object_event_callback_add(content_image_, EVAS_CALLBACK_KEY_UP, OnKeyUp,
+ this);
evas_object_event_callback_add(content_image_, EVAS_CALLBACK_MULTI_DOWN,
- OnMultiTouchDownEvent, this);
+ OnMultiTouchDownEvent, this);
evas_object_event_callback_add(content_image_, EVAS_CALLBACK_MULTI_MOVE,
- OnMultiTouchMoveEvent, this);
+ OnMultiTouchMoveEvent, this);
evas_object_event_callback_add(content_image_, EVAS_CALLBACK_MULTI_UP,
- OnMultiTouchUpEvent, this);
+ OnMultiTouchUpEvent, this);
#if defined(OS_TIZEN_MOBILE)
eext_object_event_callback_add(content_image_, EEXT_CALLBACK_BACK,
- OnHWBackEvent, this);
+ OnHWBackEvent, this);
#endif
// IMContext calls evas() getter on 'this' so it needs to be
}
#if defined(NDEBUG)
-#define GL_CHECK_HELPER(code, msg) \
- ((code), false)
+#define GL_CHECK_HELPER(code, msg) ((code), false)
#else
static GLenum g_gl_err;
-#define GL_CHECK_HELPER(code, msg) \
- (((void)(code), ((g_gl_err = evas_gl_api_->glGetError()) == GL_NO_ERROR)) ? false : \
- ((LOG(ERROR) << "GL Error: " << g_gl_err << " " << msg), true))
+#define GL_CHECK_HELPER(code, msg) \
+ (((void)(code), ((g_gl_err = evas_gl_api_->glGetError()) == GL_NO_ERROR)) \
+ ? false \
+ : ((LOG(ERROR) << "GL Error: " << g_gl_err << " " << msg), true))
#endif
#define GL_CHECK(code) GL_CHECK_HELPER(code, "")
delete im_context_;
evas_object_event_callback_del_full(parent_view_, EVAS_CALLBACK_RESIZE,
- OnParentViewResize, this);
+ OnParentViewResize, this);
evas_object_event_callback_del(content_image_, EVAS_CALLBACK_FOCUS_IN,
- OnFocusIn);
+ OnFocusIn);
evas_object_event_callback_del(content_image_, EVAS_CALLBACK_FOCUS_OUT,
- OnFocusOut);
- evas_object_smart_callback_del(content_image_elm_host_,
- "focused", OnHostFocusIn);
- evas_object_smart_callback_del(content_image_elm_host_,
- "unfocused", OnHostFocusOut);
+ OnFocusOut);
+ evas_object_smart_callback_del(content_image_elm_host_, "focused",
+ OnHostFocusIn);
+ evas_object_smart_callback_del(content_image_elm_host_, "unfocused",
+ OnHostFocusOut);
evas_object_event_callback_del(content_image_, EVAS_CALLBACK_MOUSE_DOWN,
- OnMouseDown);
+ OnMouseDown);
evas_object_event_callback_del(content_image_, EVAS_CALLBACK_MOUSE_UP,
- OnMouseUp);
+ OnMouseUp);
evas_object_event_callback_del(content_image_, EVAS_CALLBACK_MOUSE_MOVE,
- OnMouseMove);
+ OnMouseMove);
evas_object_event_callback_del(content_image_, EVAS_CALLBACK_MOUSE_WHEEL,
- OnMouseWheel);
+ OnMouseWheel);
evas_object_event_callback_del(content_image_, EVAS_CALLBACK_KEY_DOWN,
- OnKeyDown);
- evas_object_event_callback_del(content_image_, EVAS_CALLBACK_KEY_UP,
- OnKeyUp);
+ OnKeyDown);
+ evas_object_event_callback_del(content_image_, EVAS_CALLBACK_KEY_UP, OnKeyUp);
evas_object_event_callback_del(content_image_, EVAS_CALLBACK_MULTI_DOWN,
- OnMultiTouchDownEvent);
+ OnMultiTouchDownEvent);
evas_object_event_callback_del(content_image_, EVAS_CALLBACK_MULTI_MOVE,
- OnMultiTouchMoveEvent);
+ OnMultiTouchMoveEvent);
evas_object_event_callback_del(content_image_, EVAS_CALLBACK_MULTI_UP,
- OnMultiTouchUpEvent);
+ OnMultiTouchUpEvent);
evas_object_del(content_image_elm_host_);
content_image_elm_host_ = NULL;
}
gfx::Point RenderWidgetHostViewEfl::ConvertPointInViewPix(gfx::Point point) {
- return gfx::ToFlooredPoint(gfx::ScalePoint(gfx::PointF(point), device_scale_factor_));
+ return gfx::ToFlooredPoint(
+ gfx::ScalePoint(gfx::PointF(point), device_scale_factor_));
}
gfx::Rect RenderWidgetHostViewEfl::GetViewBoundsInPix() const {
}
static const char kVertexShaderSourceSimple[] =
- "attribute vec4 a_position; \n"
- "attribute vec2 a_texCoord; \n"
- "varying vec2 v_texCoord; \n"
- "void main() { \n"
- " gl_Position = a_position; \n"
- " v_texCoord = a_texCoord; \n"
- "} \n";
+ "attribute vec4 a_position; \n"
+ "attribute vec2 a_texCoord; \n"
+ "varying vec2 v_texCoord; \n"
+ "void main() { \n"
+ " gl_Position = a_position; \n"
+ " v_texCoord = a_texCoord; \n"
+ "} \n";
static const char kFragmentShaderSourceSimple[] =
- "precision mediump float; \n"
- "varying vec2 v_texCoord; \n"
- "uniform sampler2D s_texture; \n"
- "void main() { \n"
- " gl_FragColor = texture2D( s_texture, v_texCoord );\n"
- "} \n";
-
-static void GLCheckProgramHelper(Evas_GL_API* api, GLuint program,
- const char* file, int line) {
+ "precision mediump float; \n"
+ "varying vec2 v_texCoord; \n"
+ "uniform sampler2D s_texture; \n"
+ "void main() { \n"
+ " gl_FragColor = texture2D( s_texture, v_texCoord );\n"
+ "} \n";
+
+static void GLCheckProgramHelper(Evas_GL_API* api,
+ GLuint program,
+ const char* file,
+ int line) {
GLint status;
api->glGetProgramiv(program, GL_LINK_STATUS, &status);
if (!status) {
std::unique_ptr<GLchar[]> log(new GLchar[buf_length]);
GLsizei length = 0;
api->glGetProgramInfoLog(program, buf_length, &length, log.get());
- LOG(ERROR) << "GL program link failed in: " << file << ":" << line
- << ": " << log.get();
+ LOG(ERROR) << "GL program link failed in: " << file << ":" << line << ": "
+ << log.get();
api->glDeleteProgram(program);
}
}
#define GLCheckProgram(api, program) \
- GLCheckProgramHelper(api, program, __FILE__, __LINE__)
+ GLCheckProgramHelper(api, program, __FILE__, __LINE__)
-static void GLCheckShaderHelper(
- Evas_GL_API* api, GLuint shader, const char* file, int line) {
+static void GLCheckShaderHelper(Evas_GL_API* api,
+ GLuint shader,
+ const char* file,
+ int line) {
GLint status;
api->glGetShaderiv(shader, GL_COMPILE_STATUS, &status);
if (!status) {
std::unique_ptr<GLchar[]> log(new GLchar[buf_length]);
GLsizei length = 0;
api->glGetShaderInfoLog(shader, buf_length, &length, log.get());
- LOG(ERROR) << "GL shader compile failed in " << file << ":" << line
- << ": " << log.get();
+ LOG(ERROR) << "GL shader compile failed in " << file << ":" << line << ": "
+ << log.get();
api->glDeleteShader(shader);
}
}
#define GLCheckShader(api, shader) \
- GLCheckShaderHelper((api), (shader), __FILE__, __LINE__)
+ GLCheckShaderHelper((api), (shader), __FILE__, __LINE__)
void RenderWidgetHostViewEfl::initializeProgram() {
evas_gl_make_current(evas_gl_, evas_gl_surface_, evas_gl_context_);
GL_CHECK_STATUS("fragment shader");
const GLfloat vertex_attributes[] = {
- -1.0f, -1.0f, 0.0f, 0.0f, 0.0f,
- -1.0f, 1.0f, 0.0f, 0.0f, 1.0f,
- 1.0f, 1.0f, 0.0f, 1.0f, 1.0f,
- 1.0f, -1.0f, 0.0f, 1.0f, 0.0f};
+ -1.0f, -1.0f, 0.0f, 0.0f, 0.0f, -1.0f, 1.0f, 0.0f, 0.0f, 1.0f,
+ 1.0f, 1.0f, 0.0f, 1.0f, 1.0f, 1.0f, -1.0f, 0.0f, 1.0f, 0.0f};
GL_CHECK(evas_gl_api_->glGenBuffers(1, &vertex_buffer_obj_));
GL_CHECK(evas_gl_api_->glBindBuffer(GL_ARRAY_BUFFER, vertex_buffer_obj_));
sizeof(index_attributes),
index_attributes, GL_STATIC_DRAW));
- GL_CHECK(evas_gl_api_->glShaderSource(vertexShader, 1, &vertexShaderSourceProgram, 0));
- GL_CHECK(evas_gl_api_->glShaderSource(fragmentShader, 1, &fragmentShaderSourceProgram, 0));
+ GL_CHECK(evas_gl_api_->glShaderSource(vertexShader, 1,
+ &vertexShaderSourceProgram, 0));
+ GL_CHECK(evas_gl_api_->glShaderSource(fragmentShader, 1,
+ &fragmentShaderSourceProgram, 0));
GL_CHECK(program_id_ = evas_gl_api_->glCreateProgram());
GL_CHECK(evas_gl_api_->glCompileShader(vertexShader));
GLCheckShader(evas_gl_api_, vertexShader);
GL_CHECK(evas_gl_api_->glDeleteShader(vertexShader));
GL_CHECK(evas_gl_api_->glDeleteShader(fragmentShader));
- GL_CHECK(position_attrib_ = evas_gl_api_->glGetAttribLocation(program_id_, "a_position"));
- GL_CHECK(texcoord_attrib_ = evas_gl_api_->glGetAttribLocation(program_id_, "a_texCoord"));
- GL_CHECK(source_texture_location_ = evas_gl_api_->glGetUniformLocation (program_id_, "s_texture" ));
+ GL_CHECK(position_attrib_ =
+ evas_gl_api_->glGetAttribLocation(program_id_, "a_position"));
+ GL_CHECK(texcoord_attrib_ =
+ evas_gl_api_->glGetAttribLocation(program_id_, "a_texCoord"));
+ GL_CHECK(source_texture_location_ =
+ evas_gl_api_->glGetUniformLocation(program_id_, "s_texture"));
}
+viz::LocalSurfaceId RenderWidgetHostViewEfl::GetLocalSurfaceId() const {
+
+}
+void RenderWidgetHostViewEfl::OnBeginFrame() {
+}
bool RenderWidgetHostViewEfl::MakeCurrent() {
return evas_gl_make_current(evas_gl_, evas_gl_surface_, evas_gl_context_);
}
#if defined(USE_WAYLAND)
ecore_wl_screen_size_get(&display_width, &display_height);
dpi = static_cast<double>(ecore_wl_dpi_get());
-#else // X11
- ecore_x_screen_size_get(ecore_x_default_screen_get(),
- &display_width, &display_height);
+#else // X11
+ ecore_x_screen_size_get(ecore_x_default_screen_get(), &display_width,
+ &display_height);
dpi = static_cast<double>(ecore_x_dpi_get());
#endif
gfx::Rect bounds = GetViewBoundsInPix();
gfx::Size surface = surface_size_;
- GL_CHECK(gl_api->glViewport(0, bounds.height() - surface.height(), surface.width(), surface.height()));
+ GL_CHECK(gl_api->glViewport(0, bounds.height() - surface.height(),
+ surface.width(), surface.height()));
GL_CHECK(gl_api->glClearColor(1.0, 1.0, 1.0, 1.0));
GL_CHECK(gl_api->glClear(GL_COLOR_BUFFER_BIT));
GL_CHECK(gl_api->glUseProgram(program_id_));
- current_orientation_ = ecore_evas_rotation_get(ecore_evas_ecore_evas_get(evas_));
+ current_orientation_ =
+ ecore_evas_rotation_get(ecore_evas_ecore_evas_get(evas_));
GL_CHECK(gl_api->glBindBuffer(GL_ARRAY_BUFFER, vertex_buffer_obj_));
evas_gl_make_current(evas_gl_, 0, 0);
}
-void RenderWidgetHostViewEfl::EvasObjectImagePixelsGetCallback(void* data, Evas_Object* obj) {
- RenderWidgetHostViewEfl* rwhv_efl = reinterpret_cast<RenderWidgetHostViewEfl*>(data);
+void RenderWidgetHostViewEfl::EvasObjectImagePixelsGetCallback(
+ void* data,
+ Evas_Object* obj) {
+ RenderWidgetHostViewEfl* rwhv_efl =
+ reinterpret_cast<RenderWidgetHostViewEfl*>(data);
if (rwhv_efl->texture_id_)
rwhv_efl->PaintTextureToSurface(rwhv_efl->texture_id_);
}
evas_gl_ = evas_gl_new(evas_);
evas_gl_api_ = evas_gl_api_get(evas_gl_);
- evas_gl_context_ = evas_gl_context_create(
- evas_gl_, GLSharedContextEfl::GetEvasGLContext());
+ evas_gl_context_ =
+ evas_gl_context_create(evas_gl_, GLSharedContextEfl::GetEvasGLContext());
if (!evas_gl_context_)
LOG(FATAL) << "Failed to create evas gl context";
evas_gl_initialized_ = true;
+#if !defined(EWK_BRINGUP) // FIXME: m67 bringup
+ // FIXME: EWK_BRINGUP definition should be removed.
+ // DelegatedFrameHost was changed. we need to fix it.
compositor_ = new ui::Compositor(GetContextFactory(),
base::ThreadTaskRunnerHandle::Get());
compositor_->SetAcceleratedWidget(GetNativeViewId());
root_layer_->SetBounds(gfx::Rect(0, 0, size.width(), size.height()));
compositor_->SetScaleAndSize(device_scale_factor_, size);
compositor_->SetVisible(true);
+#endif // !defined(EWK_BRINGUP)
}
void RenderWidgetHostViewEfl::ResizeCompositorLayer(int width, int height) {
evas_gl_surface_destroy(evas_gl_, evas_gl_surface_);
}
- evas_gl_surface_ = evas_gl_surface_create(
- evas_gl_, evas_gl_config_, width, height);
+ evas_gl_surface_ =
+ evas_gl_surface_create(evas_gl_, evas_gl_config_, width, height);
if (!evas_gl_surface_)
LOG(FATAL) << "Failed to create evas gl surface";
Evas_Native_Surface nativeSurface;
if (evas_gl_native_surface_get(evas_gl_, evas_gl_surface_, &nativeSurface)) {
evas_object_image_native_surface_set(content_image_, &nativeSurface);
- evas_object_image_pixels_get_callback_set(content_image_,
- EvasObjectImagePixelsGetCallback, this);
+ evas_object_image_pixels_get_callback_set(
+ content_image_, EvasObjectImagePixelsGetCallback, this);
evas_object_image_pixels_dirty_set(content_image_, true);
} else {
LOG(FATAL) << "Failed to get natvie surface";
}
}
-void RenderWidgetHostViewEfl::SetEvasHandler(scoped_refptr<EvasEventHandler> evas_event_handler) {
+void RenderWidgetHostViewEfl::SetEvasHandler(
+ scoped_refptr<EvasEventHandler> evas_event_handler) {
evas_event_handler_ = evas_event_handler;
}
bool RenderWidgetHostViewEfl::OnMessageReceived(const IPC::Message& message) {
bool handled = true;
IPC_BEGIN_MESSAGE_MAP(RenderWidgetHostViewEfl, message)
- IPC_MESSAGE_HANDLER(ViewHostMsg_TextInputInFormStateChanged, OnTextInputInFormStateChanged)
- IPC_MESSAGE_HANDLER(ViewHostMsg_SnapshotDataReceived, OnSnapshotDataReceived)
- IPC_MESSAGE_UNHANDLED(handled = false)
+ IPC_MESSAGE_HANDLER(ViewHostMsg_TextInputInFormStateChanged,
+ OnTextInputInFormStateChanged)
+ IPC_MESSAGE_HANDLER(ViewHostMsg_SnapshotDataReceived, OnSnapshotDataReceived)
+ IPC_MESSAGE_UNHANDLED(handled = false)
IPC_END_MESSAGE_MAP()
return handled;
}
return host_->Send(message);
}
-void RenderWidgetHostViewEfl::OnSnapshotDataReceived(
- SkBitmap bitmap,
- int snapshotId) {
+void RenderWidgetHostViewEfl::OnSnapshotDataReceived(SkBitmap bitmap,
+ int snapshotId) {
Evas_Object* image = NULL;
if (!bitmap.empty()) {
image = evas_object_image_filled_add(evas_);
evas_object_image_data_copy_set(image, bitmap.getPixels());
}
- ScreenshotCapturedCallback* callback = screen_capture_cb_map_.Lookup(snapshotId);
+ ScreenshotCapturedCallback* callback =
+ screen_capture_cb_map_.Lookup(snapshotId);
if (!callback) {
return;
}
screen_capture_cb_map_.Remove(snapshotId);
}
-void RenderWidgetHostViewEfl::InitAsPopup(RenderWidgetHostView*, const gfx::Rect&) {
+void RenderWidgetHostViewEfl::InitAsPopup(RenderWidgetHostView*,
+ const gfx::Rect&) {
NOTIMPLEMENTED();
}
// This is a hack. See WebContentsView::SizeContents
int width = std::min(size.width(), EFL_MAX_WIDTH);
int height = std::min(size.height(), EFL_MAX_HEIGHT);
- if (popup_type_ != blink::WebPopupTypeNone) {
+ if (popup_type_ != blink::kWebPopupTypeNone) {
// We're a popup, honor the size request.
Ecore_Evas* ee = ecore_evas_ecore_evas_get(evas_);
ecore_evas_resize(ee, width, height);
}
// Update the size of the RWH.
- //if (requested_size_.width() != width ||
+ // if (requested_size_.width() != width ||
// requested_size_.height() != height) {
- // Disabled for now, will enable it while implementing InitAsPopUp (P1) API
- //equested_size_ = gfx::Size(width, height);
- host_->SendScreenRects();
- host_->WasResized();
+ // Disabled for now, will enable it while implementing InitAsPopUp (P1) API
+ // equested_size_ = gfx::Size(width, height);
+ host_->SendScreenRects();
+ host_->WasResized();
//}
- gfx::Size bounds = GetViewBoundsInPix().size();
- root_layer_->SetBounds(gfx::Rect(0, 0, bounds.width(), bounds.height()));
- compositor_->SetScaleAndSize(device_scale_factor_, bounds);
+ gfx::Size bounds = GetViewBoundsInPix().size();
+ root_layer_->SetBounds(gfx::Rect(0, 0, bounds.width(), bounds.height()));
+ compositor_->SetScaleAndSize(device_scale_factor_, bounds);
}
void RenderWidgetHostViewEfl::SetBounds(const gfx::Rect& rect) {
host_->WasResized();
+#if !defined(EWK_BRINGUP) // FIXME: m67 bringup
+ // FIXME: EWK_BRINGUP definition should be removed.
+ // DelegatedFrameHost was changed. we need to fix it
delegated_frame_host_->WasResized();
+#endif // !defined(EWK_BRINGUP)
}
gfx::Vector2dF RenderWidgetHostViewEfl::GetLastScrollOffset() const {
}
bool RenderWidgetHostViewEfl::IsSurfaceAvailableForCopy() const {
+#if !defined(EWK_BRINGUP) // FIXME: m67 bringup
+ // FIXME: EWK_BRINGUP definition should be removed.
+ // DelegatedFrameHost was changed. we need to fix it
return delegated_frame_host_->CanCopyToBitmap();
+#endif // !defined(EWK_BRINGUP)
}
void RenderWidgetHostViewEfl::Show() {
evas_object_show(content_image_elm_host_);
host_->WasShown(ui::LatencyInfo());
+#if !defined(EWK_BRINGUP) // FIXME: m67 bringup
+ // FIXME: EWK_BRINGUP definition should be removed.
+ // DelegatedFrameHost was changed. we need to fix it
delegated_frame_host_->WasShown(ui::LatencyInfo());
+#endif // !defined(EWK_BRINGUP)
}
void RenderWidgetHostViewEfl::Hide() {
}
void RenderWidgetHostViewEfl::OnDidHandleKeyEvent(
- const blink::WebInputEvent* input_event, bool processed) {
+ const blink::WebInputEvent* input_event,
+ bool processed) {
if (!im_context_)
return;
- if (input_event->type == blink::WebInputEvent::KeyDown)
+ if (input_event->GetType() == blink::WebInputEvent::kKeyDown)
im_context_->HandleKeyEvent(processed);
}
void RenderWidgetHostViewEfl::UpdateCursor(const WebCursor& webcursor) {
if (is_loading_) {
- // Setting native Loading cursor
+// Setting native Loading cursor
#if defined(USE_WAYLAND)
ecore_wl_window_cursor_from_name_set(GetEcoreWlWindow(), "watch");
#else
- ecore_x_window_cursor_set(GetEcoreXWindow(), ecore_x_cursor_shape_get(ECORE_X_CURSOR_CLOCK));
+ ecore_x_window_cursor_set(GetEcoreXWindow(),
+ ecore_x_cursor_shape_get(ECORE_X_CURSOR_CLOCK));
#endif
} else {
- WebCursor::CursorInfo cursor_info;
+ CursorInfo cursor_info;
webcursor.GetCursorInfo(&cursor_info);
#if defined(USE_WAYLAND)
- ecore_wl_window_cursor_from_name_set(
- GetEcoreWlWindow(), GetCursorName(cursor_info.type));
+ ecore_wl_window_cursor_from_name_set(GetEcoreWlWindow(),
+ GetCursorName(cursor_info.type));
#else
int cursor_type = GetCursorType(cursor_info.type);
- ecore_x_window_cursor_set(GetEcoreXWindow(), ecore_x_cursor_shape_get(cursor_type));
+ ecore_x_window_cursor_set(GetEcoreXWindow(),
+ ecore_x_cursor_shape_get(cursor_type));
#endif
}
// Need to check for cursor visibility
- //ecore_x_window_cursor_show(GetEcoreXWindow(), true);
-
+ // ecore_x_window_cursor_show(GetEcoreXWindow(), true);
}
void RenderWidgetHostViewEfl::SetIsLoading(bool is_loading) {
if (disambiguation_popup_)
disambiguation_popup_->Dismiss();
}
+void RenderWidgetHostViewEfl::SetBackgroundColor(SkColor color) {
+ // The renderer will feed its color back to us with the first CompositorFrame.
+ // We short-cut here to show a sensible color before that happens.
+ UpdateBackgroundColorFromRenderer(color);
+
+ DCHECK(SkColorGetA(color) == SK_AlphaOPAQUE ||
+ SkColorGetA(color) == SK_AlphaTRANSPARENT);
+ host_->SetBackgroundOpaque(SkColorGetA(color) == SK_AlphaOPAQUE);
+}
+SkColor RenderWidgetHostViewEfl::background_color() const {
+ return background_color_;
+}
+
+void RenderWidgetHostViewEfl::UpdateBackgroundColorFromRenderer(
+ SkColor color) {
+ if (color == background_color())
+ return;
+ background_color_ = color;
+}
+
+std::unique_ptr<ui::CompositorLock> RenderWidgetHostViewEfl::GetCompositorLock(
+ ui::CompositorLockClient* client) {
+ return compositor_->GetCompositorLock(client);
+}
+
+void RenderWidgetHostViewEfl::CompositorResizeLockEnded() {
+ // FIXME: M63 Bring-up
+ // auto* window_host = render_widget_host_view_->window_->GetHost();
+ // window_host->dispatcher()->ReleasePointerMoves();
+ host_->WasResized();
+}
void RenderWidgetHostViewEfl::TextInputStateChanged(
const TextInputState& params) {
WebContentsViewEfl* wcve = static_cast<WebContentsViewEfl*>(wci->GetView());
if (!wcve->UseKeyPadWithoutUserAction())
return;
- } else { // Prevent scroll and zoom for autofocus'ed elements.
+ } else { // Prevent scroll and zoom for autofocus'ed elements.
ScrollFocusedEditableNode();
}
params.show_ime_if_needed);
}
-void RenderWidgetHostViewEfl::OnTextInputInFormStateChanged(bool is_in_form_tag) {
+void RenderWidgetHostViewEfl::OnTextInputInFormStateChanged(
+ bool is_in_form_tag) {
if (im_context_)
im_context_->SetIsInFormTag(is_in_form_tag);
}
}
void RenderWidgetHostViewEfl::ImeCompositionRangeChanged(
- const gfx::Range& range,
- const std::vector<gfx::Rect>& character_bounds) {
+ const gfx::Range& range,
+ const std::vector<gfx::Rect>& character_bounds) {
NOTIMPLEMENTED();
}
-void RenderWidgetHostViewEfl::FocusedNodeChanged(bool is_editable_node) {
+void RenderWidgetHostViewEfl::FocusedNodeChanged(
+ bool is_editable_node,
+ const gfx::Rect& node_bounds_in_screen) {
if (GetSelectionController())
GetSelectionController()->HideHandleAndContextMenu();
if (im_context_ && im_context_->IsShow() &&
- ClipboardHelperEfl::GetInstance()->IsClipboardWindowOpened()) {
+ ClipboardHelperEfl::GetInstance()->IsClipboardWindowOpened()) {
ClipboardHelperEfl::GetInstance()->CloseClipboardWindow();
}
}
delete this;
}
-void RenderWidgetHostViewEfl::SetTooltipText(const base::string16& text) {
-}
+void RenderWidgetHostViewEfl::SetTooltipText(const base::string16& text) {}
void RenderWidgetHostViewEfl::SelectionChanged(const base::string16& text,
- size_t offset,
- const gfx::Range& range) {
+ size_t offset,
+ const gfx::Range& range) {
RenderWidgetHostViewBase::SelectionChanged(text, offset, range);
if (!GetSelectionController())
}
void RenderWidgetHostViewEfl::SelectionBoundsChanged(
- const ViewHostMsg_SelectionBounds_Params& params) {
+ const ViewHostMsg_SelectionBounds_Params& params) {
ViewHostMsg_SelectionBounds_Params guest_params(params);
- guest_params.anchor_rect = ConvertRectToPixel(device_scale_factor_, params.anchor_rect);
- guest_params.focus_rect = ConvertRectToPixel(device_scale_factor_, params.focus_rect);
+ guest_params.anchor_rect =
+ ConvertRectToPixel(device_scale_factor_, params.anchor_rect);
+ guest_params.focus_rect =
+ ConvertRectToPixel(device_scale_factor_, params.focus_rect);
if (im_context_)
- im_context_->UpdateCaretBounds(gfx::UnionRects(guest_params.anchor_rect, guest_params.focus_rect));
+ im_context_->UpdateCaretBounds(
+ gfx::UnionRects(guest_params.anchor_rect, guest_params.focus_rect));
if (GetSelectionController())
GetSelectionController()->SetIsAnchorFirst(guest_params.is_anchor_first);
controller->SetControlsTemporarilyHidden(false);
}
-uint32_t RenderWidgetHostViewEfl::GetSurfaceIdNamespace() {
- return delegated_frame_host_->GetSurfaceIdNamespace();
-}
-
-void RenderWidgetHostViewEfl::EvasToBlinkCords(int x, int y, int* view_x, int* view_y) {
+void RenderWidgetHostViewEfl::EvasToBlinkCords(int x,
+ int y,
+ int* view_x,
+ int* view_y) {
Evas_Coord tmpX, tmpY;
evas_object_geometry_get(smart_parent(), &tmpX, &tmpY, NULL, NULL);
int view_x, view_y;
EvasToBlinkCords(touch_point.x(), touch_point.y(), &view_x, &view_y);
-#if !defined(EWK_BRINGUP)
-// [M53_2785] The SelectClosestWord function was removed by
-// commit 9720a4494c8bcd24d1f496feec5cfac7582103d2 in s-chromium
-// It will be fixed by webview team.
-// FIXME: http://suprem.sec.samsung.net/jira/browse/TWF-2122
- Send(new ViewMsg_SelectClosestWord(
- host_->GetRoutingID(), view_x, view_y));
-#endif // EWK_BRINGUP
+#if !defined(EWK_BRINGUP) // FIXME: m67 bringup
+ // FIXME: The SelectClosestWord function was removed by
+ // commit 9720a4494c8bcd24d1f496feec5cfac7582103d2 in s-chromium
+ // It will be fixed by webview team.
+ // FIXME: http://suprem.sec.samsung.net/jira/browse/TWF-2122
+ Send(new ViewMsg_SelectClosestWord(host_->GetRoutingID(), view_x, view_y));
+#endif // EWK_BRINGUP
}
-void RenderWidgetHostViewEfl::ShowDisambiguationPopup(const gfx::Rect& rect_pixels, const SkBitmap& zoomed_bitmap) {
+void RenderWidgetHostViewEfl::ShowDisambiguationPopup(
+ const gfx::Rect& rect_pixels,
+ const SkBitmap& zoomed_bitmap) {
handling_disambiguation_popup_gesture_ = true;
if (!disambiguation_popup_)
- disambiguation_popup_.reset(new DisambiguationPopupEfl(content_image_, this));
+ disambiguation_popup_.reset(
+ new DisambiguationPopupEfl(content_image_, this));
disambiguation_popup_->Show(rect_pixels, zoomed_bitmap);
}
void RenderWidgetHostViewEfl::HandleDisambiguationPopupMouseDownEvent(
Evas_Event_Mouse_Down* evas_event) {
blink::WebGestureEvent tap_down_event = MakeGestureEvent(
- blink::WebInputEvent::GestureTapDown,
- content_image_,
- evas_event);
+ blink::WebInputEvent::kGestureTapDown, content_image_, evas_event);
tap_down_event.data.tap.width = 0;
- tap_down_event.data.tap.tapCount = 1;
+ tap_down_event.data.tap.tap_count = 1;
SendGestureEvent(tap_down_event);
}
void RenderWidgetHostViewEfl::HandleDisambiguationPopupMouseUpEvent(
Evas_Event_Mouse_Up* evas_event) {
blink::WebGestureEvent tap_event = MakeGestureEvent(
- blink::WebInputEvent::GestureTap,
- content_image_,
- evas_event);
+ blink::WebInputEvent::kGestureTap, content_image_, evas_event);
tap_event.data.tap.width = 0;
- tap_event.data.tap.tapCount = 1;
+ tap_event.data.tap.tap_count = 1;
SendGestureEvent(tap_event);
}
+#if !defined(EWK_BRINGUP) // FIXME: m67 bringup
void RenderWidgetHostViewEfl::LockCompositingSurface() {
NOTIMPLEMENTED();
}
void RenderWidgetHostViewEfl::UnlockCompositingSurface() {
NOTIMPLEMENTED();
}
+#endif // !defined(EWK_BRINGUP)
-bool RenderWidgetHostViewEfl::CanDispatchToConsumer(ui::GestureConsumer* consumer) {
+bool RenderWidgetHostViewEfl::CanDispatchToConsumer(
+ ui::GestureConsumer* consumer) {
return this == consumer;
}
-void RenderWidgetHostViewEfl::DispatchSyntheticTouchEvent(ui::TouchEvent* event) {
-}
+void RenderWidgetHostViewEfl::DispatchSyntheticTouchEvent(
+ ui::TouchEvent* event) {}
void RenderWidgetHostViewEfl::DispatchGestureEvent(
GestureConsumer* raw_input_consumer,
HandleGesture(event);
}
+#if !defined(EWK_BRINGUP) // FIXME: m67 bringup
void RenderWidgetHostViewEfl::CopyFromCompositingSurface(
const gfx::Rect& src_subrect,
const gfx::Size& output_size,
const ReadbackRequestCallback& callback,
const SkColorType color_type) {
+ // FIXME: EWK_BRINGUP definition should be removed.
+ // DelegatedFrameHost was changed. we need to fix it
// FIXME(venu.musham): should find a way to do it effectively.
delegated_frame_host_->CopyFromCompositingSurface(src_subrect, output_size,
callback, color_type);
}
+#endif // !defined(EWK_BRINGUP)
void RenderWidgetHostViewEfl::CopyOutputCallback(
int request_id,
- std::unique_ptr<cc::CopyOutputResult> result) {
- if (!result->HasBitmap())
- return;
-
+ std::unique_ptr<viz::CopyOutputResult> result) {
+#if !defined(EWK_BRINGUP) // FIXME: m67 bringup
std::unique_ptr<SkBitmap> snapshot = std::move(result->TakeBitmap());
Evas_Object* image = NULL;
if (!snapshot.get()->empty()) {
image = evas_object_image_filled_add(evas_);
- evas_object_image_size_set(image,
- snapshot.get()->width(),
+ evas_object_image_size_set(image, snapshot.get()->width(),
snapshot.get()->height());
evas_object_image_data_copy_set(image, snapshot.get()->getPixels());
}
- ScreenshotCapturedCallback* callback = screen_capture_cb_map_.Lookup(request_id);
+ ScreenshotCapturedCallback* callback =
+ screen_capture_cb_map_->Lookup(request_id);
if (!callback)
return;
callback->Run(image);
- screen_capture_cb_map_.Remove(request_id);
+ screen_capture_cb_map_->Remove(request_id);
+#endif // !defined(EWK_BRINGUP)
}
-void RenderWidgetHostViewEfl::GetSnapshotAsync(const gfx::Rect& snapshot_area, int request_id) {
+void RenderWidgetHostViewEfl::GetSnapshotAsync(const gfx::Rect& snapshot_area,
+ int request_id) {
if (!compositor_)
return;
- std::unique_ptr<cc::CopyOutputRequest> request = cc::CopyOutputRequest::CreateBitmapRequest(
- base::Bind(&RenderWidgetHostViewEfl::CopyOutputCallback, weak_factory_.GetWeakPtr(), request_id));
+#if !defined(EWK_BRINGUP) // FIXME: m67 bringup
+ std::unique_ptr<viz::CopyOutputRequest> request =
+ viz::CopyOutputRequest::CreateBitmapRequest(
+ base::Bind(&RenderWidgetHostViewEfl::CopyOutputCallback,
+ weak_factory_.GetWeakPtr(), request_id));
request->set_area(snapshot_area);
compositor_->root_layer()->RequestCopyOfOutput(std::move(request));
+#endif // !defined(EWK_BRINGUP)
}
-bool RenderWidgetHostViewEfl::RequestSnapshotAsync(const Eina_Rectangle rect,
+bool RenderWidgetHostViewEfl::RequestSnapshotAsync(
+ const Eina_Rectangle rect,
Screenshot_Captured_Callback callback,
void* user_data) {
int width = rect.w;
int device_x, device_y;
int view_x, view_y;
- evas_object_geometry_get(smart_parent(),
- &device_x,
- &device_y,
- NULL,
- NULL);
+ evas_object_geometry_get(smart_parent(), &device_x, &device_y, NULL, NULL);
if (width > device_x + GetViewBoundsInPix().width() - rect.x)
width = device_x + GetViewBoundsInPix().width() - rect.x;
ScreenshotCapturedCallback* cb =
new ScreenshotCapturedCallback(callback, user_data);
- int cbId = screen_capture_cb_map_.Add(cb);
+ int cbId = screen_capture_cb_map_.Add(base::WrapUnique(cb));
GetSnapshotAsync(gfx::Rect(view_x, view_y, width, height), cbId);
return true;
}
-void RenderWidgetHostViewEfl::BeginFrameSubscription(
- std::unique_ptr<RenderWidgetHostViewFrameSubscriber> subscriber) {
- delegated_frame_host_->BeginFrameSubscription(std::move(subscriber));
-}
-
-void RenderWidgetHostViewEfl::EndFrameSubscription() {
- delegated_frame_host_->EndFrameSubscription();
-}
+void RenderWidgetHostViewEfl::SetNeedsBeginFrames(bool needs_begin_frames) {}
-void RenderWidgetHostViewEfl::DidOverscroll(const DidOverscrollParams& params) {
+void RenderWidgetHostViewEfl::DidOverscroll(
+ const ui::DidOverscrollParams& params) {
const gfx::Vector2dF& accumulated_overscroll = params.accumulated_overscroll;
- const gfx::Vector2dF& latest_overscroll_delta = params.latest_overscroll_delta;
+ const gfx::Vector2dF& latest_overscroll_delta =
+ params.latest_overscroll_delta;
if (!touch_events_enabled_)
return;
return;
if (!rwhvefl)
return;
- DCHECK_NE(
- rwhvefl->active_frame_subscriber_textures_.count(subscriber_texture.get()),
- 0u);
+ DCHECK_NE(rwhvefl->active_frame_subscriber_textures_.count(
+ subscriber_texture.get()),
+ 0u);
+#if !defined(EWK_BRINGUP) // FIXME: m67 bringup
+ // FIXME: EWK_BRINGUP definition should be removed.
subscriber_texture->UpdateSyncToken(sync_token);
+#endif // !defined(EWK_BRINGUP)
rwhvefl->active_frame_subscriber_textures_.erase(subscriber_texture.get());
if (rwhvefl->frame_subscriber_ && subscriber_texture->texture_id())
base::WeakPtr<RenderWidgetHostViewEfl> rwhvefl,
const base::Callback<void(bool)>& callback,
scoped_refptr<OwnedMailbox> subscriber_texture,
- std::unique_ptr<cc::SingleReleaseCallback> release_callback,
+ std::unique_ptr<viz::SingleReleaseCallback> release_callback,
bool result) {
callback.Run(result);
- display_compositor::GLHelper* gl_helper = ImageTransportFactory::GetInstance()->GetGLHelper();
+#if !defined(EWK_BRINGUP) // FIXME: m67 bringup
+ // FIXME: EWK_BRINGUP definition should be removed.
+ display_compositor::GLHelper* gl_helper =
+ ImageTransportFactory::GetInstance()->GetGLHelper();
gpu::SyncToken sync_token;
if (gl_helper)
gl_helper->GenerateSyncToken(&sync_token);
release_callback->Run(sync_token, false);
}
ReturnSubscriberTexture(rwhvefl, subscriber_texture, sync_token);
+#endif // !defined(EWK_BRINGUP)
}
void RenderWidgetHostViewEfl::CopyFromCompositingSurfaceHasResultForVideo(
scoped_refptr<OwnedMailbox> subscriber_texture,
scoped_refptr<media::VideoFrame> video_frame,
const base::Callback<void(const gfx::Rect&, bool)>& callback,
- std::unique_ptr<cc::CopyOutputResult> result) {
+ std::unique_ptr<viz::CopyOutputResult> result) {
base::ScopedClosureRunner scoped_callback_runner(
base::Bind(callback, gfx::Rect(), false));
- base::ScopedClosureRunner scoped_return_subscriber_texture(
- base::Bind(&ReturnSubscriberTexture, rwhvefl, subscriber_texture,
- gpu::SyncToken()));
+ base::ScopedClosureRunner scoped_return_subscriber_texture(base::Bind(
+ &ReturnSubscriberTexture, rwhvefl, subscriber_texture, gpu::SyncToken()));
if (!rwhvefl)
return;
// line up correctly.
// The video frame's coded_size() and the result's size() are both physical
// pixels.
- gfx::Rect region_in_frame =
- media::ComputeLetterboxRegion(gfx::Rect(video_frame->coded_size()),
- result->size());
- region_in_frame = gfx::Rect(region_in_frame.x() & ~1,
- region_in_frame.y() & ~1,
- region_in_frame.width() & ~1,
- region_in_frame.height() & ~1);
+ gfx::Rect region_in_frame = media::ComputeLetterboxRegion(
+ gfx::Rect(video_frame->coded_size()), result->size());
+ region_in_frame =
+ gfx::Rect(region_in_frame.x() & ~1, region_in_frame.y() & ~1,
+ region_in_frame.width() & ~1, region_in_frame.height() & ~1);
if (region_in_frame.IsEmpty())
return;
+#if !defined(EWK_BRINGUP) // FIXME: m67 bringup
if (!result->HasTexture()) {
DCHECK(result->HasBitmap());
std::unique_ptr<SkBitmap> bitmap = result->TakeBitmap();
media::CopyRGBToVideoFrame(
reinterpret_cast<uint8_t*>(scaled_bitmap.getPixels()),
- scaled_bitmap.rowBytes(),
- region_in_frame,
- video_frame.get());
+ scaled_bitmap.rowBytes(), region_in_frame, video_frame.get());
}
ignore_result(scoped_callback_runner.Release());
callback.Run(gfx::Rect(), false);
return;
}
+ // FIXME: EWK_BRINGUP definition should be removed.
ImageTransportFactory* factory = ImageTransportFactory::GetInstance();
display_compositor::GLHelper* gl_helper = factory->GetGLHelper();
if (!gl_helper)
return;
cc::TextureMailbox texture_mailbox;
- std::unique_ptr<cc::SingleReleaseCallback> release_callback;
+ std::unique_ptr<viz::SingleReleaseCallback> release_callback;
result->TakeTexture(&texture_mailbox, &release_callback);
DCHECK(texture_mailbox.IsTexture());
if (!texture_mailbox.IsTexture())
gfx::Rect result_rect(result->size());
- display_compositor::ReadbackYUVInterface* yuv_readback_pipeline =
+ viz::ReadbackYUVInterface* yuv_readback_pipeline =
rwhvefl->yuv_readback_pipeline_.get();
if (yuv_readback_pipeline == NULL ||
yuv_readback_pipeline->scaler()->SrcSize() != result_rect.size() ||
yuv_readback_pipeline->scaler()->SrcSubrect() != result_rect ||
yuv_readback_pipeline->scaler()->DstSize() != region_in_frame.size()) {
- display_compositor::GLHelper::ScalerQuality quality = display_compositor::GLHelper::SCALER_QUALITY_FAST;
+ display_compositor::GLHelper::ScalerQuality quality =
+ display_compositor::GLHelper::SCALER_QUALITY_FAST;
// If we're scaling up, we can use the "best" quality.
if (result_rect.size().width() < region_in_frame.size().width() &&
result_rect.size().height() < region_in_frame.size().height())
quality = display_compositor::GLHelper::SCALER_QUALITY_BEST;
- rwhvefl->yuv_readback_pipeline_.reset(
- gl_helper->CreateReadbackPipelineYUV(quality,
- result_rect.size(),
- result_rect,
- video_frame->coded_size(),
- true,
- true));
+ rwhvefl->yuv_readback_pipeline_.reset(gl_helper->CreateReadbackPipelineYUV(
+ quality, result_rect.size(), result_rect, video_frame->coded_size(),
+ true, true));
yuv_readback_pipeline = rwhvefl->yuv_readback_pipeline_.get();
}
ignore_result(scoped_return_subscriber_texture.Release());
base::Callback<void(bool result)> finished_callback = base::Bind(
&RenderWidgetHostViewEfl::CopyFromCompositingSurfaceFinishedForVideo,
- rwhvefl->AsWeakPtr(),
- base::Bind(callback, video_frame->visible_rect()),
- subscriber_texture,
- base::Passed(&release_callback));
+ rwhvefl->AsWeakPtr(), base::Bind(callback, video_frame->visible_rect()),
+ subscriber_texture, base::Passed(&release_callback));
yuv_readback_pipeline->ReadbackYUV(
texture_mailbox.mailbox(), texture_mailbox.sync_token(),
video_frame->visible_rect(),
video_frame->stride(media::VideoFrame::kVPlane),
video_frame->data(media::VideoFrame::kVPlane), region_in_frame.origin(),
finished_callback);
+#endif // !defined(EWK_BRINGUP)
}
-// Efl port - Implementation done, will enable this function after getting video test site to verify
+#if !defined(EWK_BRINGUP) // FIXME: m67 bringup
+// Efl port - Implementation done, will enable this function after getting video
+// test site to verify
void RenderWidgetHostViewEfl::CopyFromCompositingSurfaceToVideoFrame(
- const gfx::Rect& src_subrect,
- const scoped_refptr<media::VideoFrame>& target,
- const base::Callback<void(const gfx::Rect&, bool)>& callback) {
+ const gfx::Rect& src_subrect,
+ const scoped_refptr<media::VideoFrame>& target,
+ const base::Callback<void(const gfx::Rect&, bool)>& callback) {
NOTIMPLEMENTED();
callback.Run(gfx::Rect(), false);
}
+#endif // !defined(EWK_BRINGUP)
+#if !defined(EWK_BRINGUP) // FIXME: m67 bringup
bool RenderWidgetHostViewEfl::CanCopyToVideoFrame() const {
+ // FIXME: EWK_BRINGUP definition should be removed.
+ // DelegatedFrameHost was changed. we need to fix it
return delegated_frame_host_->CanCopyToVideoFrame();
}
+#endif // !defined(EWK_BRINGUP)
bool RenderWidgetHostViewEfl::HasAcceleratedSurface(const gfx::Size&) {
return false;
}
-void RenderWidgetHostViewEfl::GetScreenInfo(
- blink::WebScreenInfo* results) {
- RenderWidgetHostViewBase::GetDefaultScreenInfo(results);
-}
-
gfx::Rect RenderWidgetHostViewEfl::GetBoundsInRootWindow() {
Ecore_Evas* ee = ecore_evas_ecore_evas_get(evas_);
int x, y, w, h;
return gfx::ConvertRectToDIP(device_scale_factor_, gfx::Rect(x, y, w, h));
}
-void RenderWidgetHostViewEfl::RenderProcessGone(base::TerminationStatus, int error_code) {
+void RenderWidgetHostViewEfl::RenderProcessGone(base::TerminationStatus,
+ int error_code) {
Destroy();
}
-void RenderWidgetHostViewEfl::OnParentViewResize(
- void* data, Evas*, Evas_Object* obj, void*) {
+void RenderWidgetHostViewEfl::OnParentViewResize(void* data,
+ Evas*,
+ Evas_Object* obj,
+ void*) {
RenderWidgetHostViewEfl* thiz = static_cast<RenderWidgetHostViewEfl*>(data);
int x, y, width, height;
evas_object_geometry_get(obj, &x, &y, &width, &height);
thiz->host_->WasResized();
}
-void RenderWidgetHostViewEfl::OnFocusIn(
- void* data, Evas*, Evas_Object*, void*) {
+void RenderWidgetHostViewEfl::OnFocusIn(void* data,
+ Evas*,
+ Evas_Object*,
+ void*) {
RenderWidgetHostViewEfl* thiz = static_cast<RenderWidgetHostViewEfl*>(data);
if (thiz->evas_event_handler_.get())
if (thiz->evas_event_handler_->HandleEvent_FocusIn())
DCHECK(r) << "Failed to grab arrow keys!";
}
-void RenderWidgetHostViewEfl::OnFocusOut(
- void* data, Evas*, Evas_Object*, void*) {
+void RenderWidgetHostViewEfl::OnFocusOut(void* data,
+ Evas*,
+ Evas_Object*,
+ void*) {
RenderWidgetHostViewEfl* thiz = static_cast<RenderWidgetHostViewEfl*>(data);
if (thiz->evas_event_handler_.get())
if (thiz->evas_event_handler_->HandleEvent_FocusOut())
evas_object_key_ungrab(thiz->content_image_, "Down", 0, 0);
}
-void RenderWidgetHostViewEfl::OnHostFocusIn(
- void* data, Evas_Object*, void*) {
+void RenderWidgetHostViewEfl::OnHostFocusIn(void* data, Evas_Object*, void*) {
RenderWidgetHostViewEfl* thiz = static_cast<RenderWidgetHostViewEfl*>(data);
thiz->Focus();
}
-void RenderWidgetHostViewEfl::OnHostFocusOut(
- void* data, Evas_Object*, void*) {
+void RenderWidgetHostViewEfl::OnHostFocusOut(void* data, Evas_Object*, void*) {
RenderWidgetHostViewEfl* thiz = static_cast<RenderWidgetHostViewEfl*>(data);
thiz->host_->Blur();
}
-void RenderWidgetHostViewEfl::OnMouseDown(
- void* data, Evas* evas, Evas_Object* obj, void* event_info) {
+void RenderWidgetHostViewEfl::OnMouseDown(void* data,
+ Evas* evas,
+ Evas_Object* obj,
+ void* event_info) {
RenderWidgetHostViewEfl* rwhv = static_cast<RenderWidgetHostViewEfl*>(data);
if (rwhv->evas_event_handler_.get())
- if (rwhv->evas_event_handler_->HandleEvent_MouseDown(static_cast<Evas_Event_Mouse_Down*>(event_info)))
+ if (rwhv->evas_event_handler_->HandleEvent_MouseDown(
+ static_cast<Evas_Event_Mouse_Down*>(event_info)))
return;
rwhv->Focus();
if (!rwhv->touch_events_enabled_) {
- blink::WebMouseEvent event = MakeWebMouseEvent(
- blink::WebInputEvent::MouseDown, obj,
- static_cast<Evas_Event_Mouse_Down*>(event_info));
+ blink::WebMouseEvent event =
+ MakeWebMouseEvent(blink::WebInputEvent::kMouseDown, obj,
+ static_cast<Evas_Event_Mouse_Down*>(event_info));
rwhv->host_->ForwardMouseEvent(event);
} else {
rwhv->ProcessTouchEvents(
}
}
-void RenderWidgetHostViewEfl::OnMouseUp(
- void* data, Evas* evas, Evas_Object* obj, void* event_info) {
+void RenderWidgetHostViewEfl::OnMouseUp(void* data,
+ Evas* evas,
+ Evas_Object* obj,
+ void* event_info) {
RenderWidgetHostViewEfl* rwhv = static_cast<RenderWidgetHostViewEfl*>(data);
if (rwhv->evas_event_handler_.get())
- if (rwhv->evas_event_handler_->HandleEvent_MouseUp(static_cast<Evas_Event_Mouse_Up*>(event_info)))
+ if (rwhv->evas_event_handler_->HandleEvent_MouseUp(
+ static_cast<Evas_Event_Mouse_Up*>(event_info)))
return;
if (!rwhv->touch_events_enabled_) {
- blink::WebMouseEvent event = MakeWebMouseEvent(
- blink::WebInputEvent::MouseUp, obj,
- static_cast<Evas_Event_Mouse_Up*>(event_info));
+ blink::WebMouseEvent event =
+ MakeWebMouseEvent(blink::WebInputEvent::kMouseUp, obj,
+ static_cast<Evas_Event_Mouse_Up*>(event_info));
rwhv->host_->ForwardMouseEvent(event);
} else {
rwhv->ProcessTouchEvents(
}
}
-void RenderWidgetHostViewEfl::OnMouseMove(
- void* data, Evas* evas, Evas_Object* obj, void* event_info) {
+void RenderWidgetHostViewEfl::OnMouseMove(void* data,
+ Evas* evas,
+ Evas_Object* obj,
+ void* event_info) {
RenderWidgetHostViewEfl* rwhv = static_cast<RenderWidgetHostViewEfl*>(data);
if (rwhv->evas_event_handler_.get())
- if (rwhv->evas_event_handler_->HandleEvent_MouseMove(static_cast<Evas_Event_Mouse_Move*>(event_info)))
+ if (rwhv->evas_event_handler_->HandleEvent_MouseMove(
+ static_cast<Evas_Event_Mouse_Move*>(event_info)))
return;
if (!rwhv->touch_events_enabled_) {
- blink::WebMouseEvent event = MakeWebMouseEvent(obj,
- static_cast<Evas_Event_Mouse_Move*>(event_info));
+ blink::WebMouseEvent event =
+ MakeWebMouseEvent(obj, static_cast<Evas_Event_Mouse_Move*>(event_info));
rwhv->host_->ForwardMouseEvent(event);
} else {
rwhv->ProcessTouchEvents(
}
}
-void RenderWidgetHostViewEfl::OnMultiTouchDownEvent(
- void* data, Evas* evas, Evas_Object* obj, void* event_info) {
+void RenderWidgetHostViewEfl::OnMultiTouchDownEvent(void* data,
+ Evas* evas,
+ Evas_Object* obj,
+ void* event_info) {
RenderWidgetHostViewEfl* rwhv = static_cast<RenderWidgetHostViewEfl*>(data);
CHECK(rwhv->touch_events_enabled_);
rwhv->ProcessTouchEvents(
static_cast<Evas_Event_Multi_Down*>(event_info)->timestamp);
}
-void RenderWidgetHostViewEfl::OnMultiTouchMoveEvent(
- void* data, Evas* evas, Evas_Object* obj, void* event_info) {
+void RenderWidgetHostViewEfl::OnMultiTouchMoveEvent(void* data,
+ Evas* evas,
+ Evas_Object* obj,
+ void* event_info) {
RenderWidgetHostViewEfl* rwhv = static_cast<RenderWidgetHostViewEfl*>(data);
CHECK(rwhv->touch_events_enabled_);
rwhv->ProcessTouchEvents(
static_cast<Evas_Event_Multi_Move*>(event_info)->timestamp);
}
-void RenderWidgetHostViewEfl::OnMultiTouchUpEvent(
- void* data, Evas* evas, Evas_Object* obj, void* event_info) {
+void RenderWidgetHostViewEfl::OnMultiTouchUpEvent(void* data,
+ Evas* evas,
+ Evas_Object* obj,
+ void* event_info) {
RenderWidgetHostViewEfl* rwhv = static_cast<RenderWidgetHostViewEfl*>(data);
CHECK(rwhv->touch_events_enabled_);
rwhv->ProcessTouchEvents(
static_cast<Evas_Event_Multi_Up*>(event_info)->timestamp);
}
-void RenderWidgetHostViewEfl::OnKeyDown(
- void* data, Evas* evas, Evas_Object* obj, void* event_info) {
-
+void RenderWidgetHostViewEfl::OnKeyDown(void* data,
+ Evas* evas,
+ Evas_Object* obj,
+ void* event_info) {
if (!event_info)
return;
RenderWidgetHostViewEfl* rwhv = static_cast<RenderWidgetHostViewEfl*>(data);
if (rwhv->evas_event_handler_.get())
- if (rwhv->evas_event_handler_->HandleEvent_KeyDown(static_cast<Evas_Event_Key_Down*>(event_info)))
+ if (rwhv->evas_event_handler_->HandleEvent_KeyDown(
+ static_cast<Evas_Event_Key_Down*>(event_info)))
return;
// When upper case letter is entered there are two events
if (IsShiftKey(static_cast<Evas_Event_Key_Down*>(event_info)->key))
return;
- NativeWebKeyboardEvent n_event = MakeWebKeyboardEvent(
- true, static_cast<Evas_Event_Key_Down*>(event_info));
+ NativeWebKeyboardEvent n_event =
+ MakeWebKeyboardEvent(true, static_cast<Evas_Event_Key_Down*>(event_info));
if (!rwhv->im_context_) {
rwhv->host_->ForwardKeyboardEvent(n_event);
// Do not forward keyevent now if there is fake key event
// handling at the moment to preserve orders of events as in Webkit
if (rwhv->im_context_->IsPreeditQueueEmpty() ||
- rwhv->im_context_->IsKeyUpQueueEmpty() ) {
+ rwhv->im_context_->IsKeyUpQueueEmpty()) {
rwhv->host_->ForwardKeyboardEvent(n_event);
- rwhv->im_context_->PushToKeyUpEventQueue(n_event.windowsKeyCode);
+ rwhv->im_context_->PushToKeyUpEventQueue(n_event.windows_key_code);
return;
}
rwhv->im_context_->PushToKeyDownEventQueue(n_event);
- rwhv->im_context_->PushToKeyUpEventQueue(n_event.windowsKeyCode);
+ rwhv->im_context_->PushToKeyUpEventQueue(n_event.windows_key_code);
}
-void RenderWidgetHostViewEfl::OnKeyUp(
- void* data, Evas* evas, Evas_Object* obj, void* event_info) {
-
+void RenderWidgetHostViewEfl::OnKeyUp(void* data,
+ Evas* evas,
+ Evas_Object* obj,
+ void* event_info) {
if (!event_info)
return;
RenderWidgetHostViewEfl* rwhv = static_cast<RenderWidgetHostViewEfl*>(data);
if (rwhv->evas_event_handler_.get())
- if (rwhv->evas_event_handler_->HandleEvent_KeyUp(static_cast<Evas_Event_Key_Up*>(event_info)))
+ if (rwhv->evas_event_handler_->HandleEvent_KeyUp(
+ static_cast<Evas_Event_Key_Up*>(event_info)))
return;
// When upper case letter is entered there are two events
if (IsShiftKey(static_cast<Evas_Event_Key_Up*>(event_info)->key))
return;
- rwhv->host_->ForwardKeyboardEvent(MakeWebKeyboardEvent(
- false, static_cast<Evas_Event_Key_Up*>(event_info)));
+ rwhv->host_->ForwardKeyboardEvent(
+ MakeWebKeyboardEvent(false, static_cast<Evas_Event_Key_Up*>(event_info)));
}
#if defined(OS_TIZEN_MOBILE)
-void RenderWidgetHostViewEfl::OnHWBackEvent(void* data, Evas_Object* obj,
- void* event_info) {
+void RenderWidgetHostViewEfl::OnHWBackEvent(void* data,
+ Evas_Object* obj,
+ void* event_info) {
RenderWidgetHostViewEfl* rwhv = static_cast<RenderWidgetHostViewEfl*>(data);
rwhv->evas_event_handler_->HandleEvent_HWBack();
}
#endif
-void RenderWidgetHostViewEfl::OnMouseWheel(
- void* data, Evas* evas, Evas_Object* obj, void* event_info) {
+void RenderWidgetHostViewEfl::OnMouseWheel(void* data,
+ Evas* evas,
+ Evas_Object* obj,
+ void* event_info) {
RenderWidgetHostViewEfl* rwhv = static_cast<RenderWidgetHostViewEfl*>(data);
if (rwhv->evas_event_handler_.get())
- if (rwhv->evas_event_handler_->HandleEvent_MouseWheel(static_cast<Evas_Event_Mouse_Wheel*>(event_info)))
+ if (rwhv->evas_event_handler_->HandleEvent_MouseWheel(
+ static_cast<Evas_Event_Mouse_Wheel*>(event_info)))
return;
if (!rwhv->touch_events_enabled_) {
// The poorly-written Tizen API document says:
// "0 for Mouse Event and device id for Multi Event."
// "The point which comes from Mouse Event has id 0 and"
- // "The point which comes from Multi Event has id that is same as Multi Event's device id."
+ // "The point which comes from Multi Event has id that is same as Multi
+ // Event's device id."
// This constant is to map touch id 0 to 0, or [0] -> [0]
static const int kMultiTouchIDMapPart0SingleIndex = 0;
// This constant is to map [13, 23] -> [1, 11]
id -= kMultiTouchIDMapPart1DiffValue;
} else if (id > kMultiTouchIDMapPart1EndIndex) {
LOG(WARNING) << "evas_touch_point_list_nth_id_get() returned a value "
- "greater than (" << kMultiTouchIDMapPart1EndIndex << ").";
+ "greater than ("
+ << kMultiTouchIDMapPart1EndIndex << ").";
}
evas_touch_point_list_nth_xy_get(evas_, i, &pt.x, &pt.y);
state = evas_touch_point_list_nth_state_get(evas_, i);
DCHECK(gesture_recognizer_efl);
ui::GestureProviderAura* gesture_provider_aura =
gesture_recognizer_efl->GetGestureProviderForConsumer(this);
- gesture_provider_aura->filtered_gesture_provider_.SetDoubleTapSupportForPlatformEnabled(enabled);
+ gesture_provider_aura->filtered_gesture_provider_
+ .SetDoubleTapSupportForPlatformEnabled(enabled);
}
void RenderWidgetHostViewEfl::SetTouchEventsEnabled(bool enabled) {
SetDoubleTapSupportEnabled(enabled);
if (enabled) {
- selection_controller_.reset(new SelectionControllerEfl(
- smart_parent_, web_contents_));
+ selection_controller_.reset(
+ new SelectionControllerEfl(smart_parent_, web_contents_));
} else {
selection_controller_.reset();
}
}
void RenderWidgetHostViewEfl::set_magnifier(bool status) {
- magnifier_ = status;
+ magnifier_ = status;
}
ui::LatencyInfo CreateLatencyInfo(const blink::WebInputEvent& event) {
ui::LatencyInfo latency_info;
// The latency number should only be added if the timestamp is valid.
- if (event.timeStampSeconds) {
+ if (event.TimeStampSeconds()) {
const int64_t time_micros = static_cast<int64_t>(
- event.timeStampSeconds * base::Time::kMicrosecondsPerSecond);
+ event.TimeStampSeconds() * base::Time::kMicrosecondsPerSecond);
latency_info.AddLatencyNumberWithTimestamp(
- ui::INPUT_EVENT_LATENCY_ORIGINAL_COMPONENT,
- 0,
- 0,
- base::TimeTicks() + base::TimeDelta::FromMicroseconds(time_micros),
- 1);
+ ui::INPUT_EVENT_LATENCY_ORIGINAL_COMPONENT, 0, 0,
+ base::TimeTicks() + base::TimeDelta::FromMicroseconds(time_micros), 1);
}
return latency_info;
}
-void RenderWidgetHostViewEfl::SendGestureEvent(
- blink::WebGestureEvent& event) {
+void RenderWidgetHostViewEfl::SendGestureEvent(blink::WebGestureEvent& event) {
HandleGesture(event);
- if (magnifier_ && event.type == blink::WebInputEvent::GestureScrollUpdate)
+ blink::WebInputEvent::Type event_type = event.GetType();
+ if (magnifier_ && event_type == blink::WebInputEvent::kGestureScrollUpdate)
return;
- if (host_ && event.type != blink::WebInputEvent::Undefined)
+ if (host_ && event_type != blink::WebInputEvent::kUndefined)
host_->ForwardGestureEventWithLatencyInfo(event, CreateLatencyInfo(event));
}
EnsureEdgeEffect().Disable();
}
-void RenderWidgetHostViewEfl::HandleGesture(
- blink::WebGestureEvent& event) {
+void RenderWidgetHostViewEfl::HandleGesture(blink::WebGestureEvent& event) {
SelectionControllerEfl* controller = GetSelectionController();
if (controller)
controller->HandleGesture(event);
- if (event.type == blink::WebInputEvent::GestureDoubleTap ||
- event.type == blink::WebInputEvent::GesturePinchBegin ||
- event.type == blink::WebInputEvent::GesturePinchEnd) {
+ blink::WebInputEvent::Type event_type = event.GetType();
+ if (event_type == blink::WebInputEvent::kGestureDoubleTap ||
+ event_type == blink::WebInputEvent::kGesturePinchBegin ||
+ event_type == blink::WebInputEvent::kGesturePinchEnd) {
WebContentsImpl* wci = static_cast<WebContentsImpl*>(&web_contents_);
WebContentsViewEfl* wcve = static_cast<WebContentsViewEfl*>(wci->GetView());
wcve->HandleZoomGesture(event);
}
- if ((event.type == blink::WebInputEvent::GestureTap ||
- event.type == blink::WebInputEvent::GestureTapCancel) &&
+ if ((event_type == blink::WebInputEvent::kGestureTap ||
+ event_type == blink::WebInputEvent::kGestureTapCancel) &&
!handling_disambiguation_popup_gesture_) {
- float size = 32.0f; // Default value
+ float size = 32.0f; // Default value
#if defined(OS_TIZEN_MOBILE)
size = elm_config_finger_size_get() / device_scale_factor_;
#endif
event.data.tap.height = size;
}
- if (event.type == blink::WebInputEvent::GestureTapDown) {
+ if (event_type == blink::WebInputEvent::kGestureTapDown) {
// Webkit does not stop a fling-scroll on tap-down. So explicitly send an
// event to stop any in-progress flings.
blink::WebGestureEvent fling_cancel = event;
- fling_cancel.type = blink::WebInputEvent::GestureFlingCancel;
- fling_cancel.sourceDevice = blink::WebGestureDeviceTouchscreen;
+ fling_cancel.SetType(blink::WebInputEvent::kGestureFlingCancel);
+ fling_cancel.source_device = blink::kWebGestureDeviceTouchscreen;
SendGestureEvent(fling_cancel);
- } else if (event.type == blink::WebInputEvent::GestureScrollUpdate) {
- if (event.data.scrollUpdate.deltaX < 0)
+ } else if (event_type == blink::WebInputEvent::kGestureScrollUpdate) {
+ if (event.data.scroll_update.delta_x < 0)
EnsureEdgeEffect().Hide("edge,left");
- else if (event.data.scrollUpdate.deltaX > 0)
+ else if (event.data.scroll_update.delta_x > 0)
EnsureEdgeEffect().Hide("edge,right");
- if (event.data.scrollUpdate.deltaY < 0)
+ if (event.data.scroll_update.delta_y < 0)
EnsureEdgeEffect().Hide("edge,top");
- else if (event.data.scrollUpdate.deltaY > 0)
+ else if (event.data.scroll_update.delta_y > 0)
EnsureEdgeEffect().Hide("edge,bottom");
- } else if (event.type == blink::WebInputEvent::GesturePinchBegin) {
+ } else if (event_type == blink::WebInputEvent::kGesturePinchBegin) {
EnsureEdgeEffect().Disable();
- } else if (event.type == blink::WebInputEvent::GesturePinchEnd) {
+ } else if (event_type == blink::WebInputEvent::kGesturePinchEnd) {
EnsureEdgeEffect().Enable();
}
}
void RenderWidgetHostViewEfl::HandleGesture(ui::GestureEvent* event) {
- blink::WebGestureEvent gesture =
- MakeWebGestureEventFromUIEvent(*event);
+ blink::WebGestureEvent gesture = MakeWebGestureEventFromUIEvent(*event);
gesture.x = event->x();
gesture.y = event->y();
const gfx::Point root_point = event->root_location();
- gesture.globalX = root_point.x();
- gesture.globalY = root_point.y();
+ gesture.global_x = root_point.x();
+ gesture.global_y = root_point.y();
if (event->type() == ui::ET_GESTURE_BEGIN)
HandleGestureBegin();
void RenderWidgetHostViewEfl::ProcessAckedTouchEvent(
const TouchEventWithLatencyInfo& touch,
InputEventAckState ack_result) {
- ui::EventResult result = (ack_result == INPUT_EVENT_ACK_STATE_CONSUMED) ?
- ui::ER_HANDLED : ui::ER_UNHANDLED;
+ ui::EventResult result = (ack_result == INPUT_EVENT_ACK_STATE_CONSUMED)
+ ? ui::ER_HANDLED
+ : ui::ER_UNHANDLED;
+#if !defined(EWK_BRINGUP) // FIXME: m67 bringup
std::unique_ptr<ui::GestureRecognizer::Gestures> gestures;
gestures.reset(gesture_recognizer_->AckTouchEvent(
- touch.event.uniqueTouchEventId, result, this));
+ touch.event.unique_touch_event_id, result, this));
if (gestures) {
for (size_t j = 0; j < gestures->size(); ++j) {
- ui::GestureEvent* event = gestures->get().at(j);
+ ui::GestureEvent* event = gestures.at(j);
HandleGesture(event);
}
}
+#endif // !defined(EWK_BRINGUP)
}
EdgeEffect& RenderWidgetHostViewEfl::EnsureEdgeEffect() {
}
void RenderWidgetHostViewEfl::MoveCaret(const gfx::Point& point) {
- host_->MoveCaret(gfx::Point(point.x() / device_scale_factor_, point.y() / device_scale_factor_));
+#if !defined(EWK_BRINGUP) // FIXME: m67 bringup
+ host_->MoveCaret(gfx::Point(point.x() / device_scale_factor_,
+ point.y() / device_scale_factor_));
+#endif // !defined(EWK_BRINGUP)
}
-void RenderWidgetHostViewEfl::SetComposition(const ui::CompositionText& composition_text) {
+void RenderWidgetHostViewEfl::SetComposition(
+ const ui::CompositionText& composition_text) {
+#if !defined(EWK_BRINGUP) // FIXME: m67 bringup
const std::vector<blink::WebCompositionUnderline>& underlines =
reinterpret_cast<const std::vector<blink::WebCompositionUnderline>&>(
- composition_text.underlines);
+ composition_text.underlines);
host_->ImeSetComposition(
composition_text.text, underlines, gfx::Range::InvalidRange(),
composition_text.selection.start(), composition_text.selection.end());
+#endif // !defined(EWK_BRINGUP)
}
void RenderWidgetHostViewEfl::ConfirmComposition(base::string16& text) {
+#if !defined(EWK_BRINGUP) // FIXME: m67 bringup
+ // FIXME: EWK_BRINGUP definition should be removed.
+ // ImeConfirmComposition was removed
host_->ImeConfirmComposition(text, gfx::Range::InvalidRange(), false);
+#endif // !defined(EWK_BRINGUP)
}
+#if !defined(EWK_BRINGUP) // FIXME: m67 bringup
+// FIXME: EWK_BRINGUP definition should be removed.
// Defined in gl_current_context_efl.cc because of conflicts of
// texture_manager.h with efl GL API wrappers.
extern GLuint GetTextureIdFromTexture(gpu::gles2::Texture* texture);
-
-void RenderWidgetHostViewEfl::GetTextureFromMailbox(gpu::Mailbox* mailbox,
- gfx::Size surface_size) {
- gpu::gles2::MailboxManager* manager = SharedMailboxManager::GetMailboxManager();
- gpu::gles2::Texture* texture = manager->ConsumeTexture(*mailbox);
- if (texture != NULL) {
- surface_size_ = surface_size;
- texture_id_ = GetTextureIdFromTexture(texture);
- evas_object_image_pixels_dirty_set(content_image_, true);
- evas_render(evas_);
+#endif // !defined(EWK_BRINGUP)
+void RenderWidgetHostViewEfl::DidCreateNewRendererCompositorFrameSink(
+ viz::mojom::CompositorFrameSinkClient* renderer_compositor_frame_sink) {
+#if !defined(EWK_BRINGUP) // FIXME: m67 bringup
+ renderer_compositor_frame_sink_ = renderer_compositor_frame_sink;
+ if (delegated_frame_host_) {
+ delegated_frame_host_->DidCreateNewRendererCompositorFrameSink(
+ renderer_compositor_frame_sink_);
}
+#endif // !defined(EWK_BRINGUP)
}
-
-void RenderWidgetHostViewEfl::OnSwapCompositorFrame(
- uint32_t output_surface_id, cc::CompositorFrame frame) {
+void RenderWidgetHostViewEfl::SubmitCompositorFrame(
+ const viz::LocalSurfaceId& local_surface_id,
+ viz::CompositorFrame frame) {
+#if !defined(EWK_BRINGUP) // FIXME: m67 bringup
last_scroll_offset_ = frame.metadata.root_scroll_offset;
if (GetSelectionController()) {
GetSelectionController()->SetSelectionEmpty(
frame.metadata.selection.is_empty_text_form_control);
- GetSelectionController()->OnSelectionChanged(
- frame.metadata.selection.start, frame.metadata.selection.end);
+ GetSelectionController()->OnSelectionChanged(frame.metadata.selection.start,
+ frame.metadata.selection.end);
}
if (frame.delegated_frame_data) {
+ // FIXME: EWK_BRINGUP definition should be removed.
// ack is sent by delegated frame host
delegated_frame_host_->SwapDelegatedFrame(output_surface_id,
std::move(frame));
LOG(ERROR) << "Non-delegated renderer path (software or gl) is no longer "
<< "supported. With this black screen will occur.";
}
+#endif // !defined(EWK_BRINGUP)
}
-void RenderWidgetHostViewEfl::ClearCompositorFrame () {
+void RenderWidgetHostViewEfl::ClearCompositorFrame() {
+#if !defined(EWK_BRINGUP) // FIXME: m67 bringup
+ // FIXME: EWK_BRINGUP definition should be removed.
+ // DelegatedFrameHost was changed. we need to fix it
delegated_frame_host_->ClearDelegatedFrame();
+#endif // !defined(EWK_BRINGUP)
}
void RenderWidgetHostViewEfl::ScrollFocusedEditableNode() {
// If long-pressing, do not perform zoom to focused element.
if (GetSelectionController() && !GetSelectionController()->GetLongPressed()) {
- // The empty rect is ignored by WebViewImpl::scrollFocusedNodeIntoRect().
+// The empty rect is ignored by WebViewImpl::scrollFocusedNodeIntoRect().
+#if !defined(EWK_BRINGUP) // FIXME: m67 bringup
host_->ScrollFocusedEditableNodeIntoRect(gfx::Rect());
+#endif // !defined(EWK_BRINGUP)
}
}
bool RenderWidgetHostViewEfl::IsLastAvailableTextEmpty() const {
+#if !defined(EWK_BRINGUP) // FIXME: m67 bringup
return RenderWidgetHostViewBase::selection_text_.empty();
+#else
+ return false;
+#endif
}
bool RenderWidgetHostViewEfl::IsIMEShow() const {
///////////////////////////////////////////////////////////////////////////
// DelegatedFrameHost, public:
-int RenderWidgetHostViewEfl::DelegatedFrameHostGetGpuMemoryBufferClientId() const {
- return host_->GetProcess()->GetID();
-}
-
ui::Layer* RenderWidgetHostViewEfl::DelegatedFrameHostGetLayer() const {
return root_layer_.get();
}
return !host_->is_hidden();
}
-SkColor RenderWidgetHostViewEfl::DelegatedFrameHostGetGutterColor(SkColor color) const {
+SkColor RenderWidgetHostViewEfl::DelegatedFrameHostGetGutterColor(
+ SkColor color) const {
// When making an element on the page fullscreen the element's background
// may not match the page's, so use black as the gutter color to avoid
// flashes of brighter colors during the transition.
return color;
}
-gfx::Size RenderWidgetHostViewEfl::DelegatedFrameHostDesiredSizeInDIP() const{
+gfx::Size RenderWidgetHostViewEfl::DelegatedFrameHostDesiredSizeInDIP() const {
gfx::Rect bounds = GetViewBoundsInPix();
return bounds.size();
}
return false;
}
-std::unique_ptr<ResizeLock>
-RenderWidgetHostViewEfl::DelegatedFrameHostCreateResizeLock(
- bool defer_compositor_lock) {
- ResizeLock* lock = NULL;
- return std::unique_ptr<ResizeLock>(lock);
+std::unique_ptr<CompositorResizeLock>
+RenderWidgetHostViewEfl::DelegatedFrameHostCreateResizeLock() {
+ // auto* host = host_->window_->GetHost();
+ // host->dispatcher()->HoldPointerMoves();
+
+ // FIXME: M63 Bring-up.
+ gfx::Rect desired_rect = GetBoundsInRootWindow();
+ return std::make_unique<CompositorResizeLock>(this, desired_rect.size());
}
+#if !defined(EWK_BRINGUP) // FIXME: m67 bringup
void RenderWidgetHostViewEfl::DelegatedFrameHostResizeLockWasReleased() {
host_->WasResized();
}
-void RenderWidgetHostViewEfl::DelegatedFrameHostSendCompositorSwapAck(
- int output_surface_id,
- const cc::CompositorFrameAck& ack) {
- host_->Send(new ViewMsg_SwapCompositorFrameAck(host_->GetRoutingID(),
- output_surface_id, ack));
-}
-
void RenderWidgetHostViewEfl::DelegatedFrameHostSendReclaimCompositorResources(
- int output_surface_id,
- const cc::CompositorFrameAck& ack) {
- host_->Send(new ViewMsg_ReclaimCompositorResources(host_->GetRoutingID(),
- output_surface_id, ack));
-}
-
-void RenderWidgetHostViewEfl::DelegatedFrameHostOnLostCompositorResources() {
- host_->ScheduleComposite();
-}
-
-void RenderWidgetHostViewEfl::DelegatedFrameHostUpdateVSyncParameters(
- const base::TimeTicks& timebase,
- const base::TimeDelta& interval) {
- host_->UpdateVSyncParameters(timebase, interval);
+ int compositor_frame_sink_id,
+ bool is_swap_ack,
+ const viz::ReturnedResourceArray& resources) {
+ host_->Send(new ViewMsg_ReclaimCompositorResources(
+ host_->GetRoutingID(), compositor_frame_sink_id, is_swap_ack, resources));
}
+#endif
+#if 0
+void RenderWidgetHostViewEfl::SetBeginFrameSource(
+ viz::BeginFrameSource* source) {}
+#endif
+bool RenderWidgetHostViewEfl::IsAutoResizeEnabled() const {}
-void RenderWidgetHostViewEfl::SetBeginFrameSource(cc::BeginFrameSource* source) {
-}
} // namespace content
#ifndef RENDER_WIDGET_HOST_VIEW_EFL
#define RENDER_WIDGET_HOST_VIEW_EFL
-#include <Evas.h>
#include <Ecore_Evas.h>
-#include <Evas_GL.h>
#include <Ecore_IMF_Evas.h>
+#include <Evas.h>
+#include <Evas_GL.h>
#include "base/format_macros.h"
-#include "base/id_map.h"
-#include "content/browser/renderer_host/render_widget_host_view_base.h"
+#include "base/containers/id_map.h"
#include "content/browser/renderer_host/evas_event_handler.h"
+#include "content/browser/renderer_host/render_widget_host_view_base.h"
#include "content/browser/web_contents/web_contents_impl.h"
#include "content/browser/web_contents/web_contents_view_efl.h"
#include "content/common/content_export.h"
-#include "cc/output/compositor_frame.h"
-#include "cc/output/compositor_frame_ack.h"
-#include "cc/output/copy_output_request.h"
-#include "cc/output/copy_output_result.h"
-#include "cc/resources/single_release_callback.h"
-#include "cc/resources/texture_mailbox.h"
+#include "components/viz/common/quads/compositor_frame.h"
+#include "components/viz/common/frame_sinks/copy_output_request.h"
+#include "components/viz/common/frame_sinks/copy_output_result.h"
+#include "components/viz/common/resources/single_release_callback.h"
+#include "components/viz/common/quads/texture_mailbox.h"
#include "content/browser/accessibility/browser_accessibility_manager.h"
#include "content/browser/compositor/image_transport_factory.h"
#include "content/browser/compositor/owned_mailbox.h"
+#include "content/browser/renderer_host/compositor_resize_lock.h"
#include "content/browser/renderer_host/delegated_frame_host.h"
#include "content/browser/renderer_host/render_widget_host_view_base.h"
+#include "content/browser/renderer_host/render_widget_host_view_frame_subscriber.h"
#include "content/browser/selection/selection_controller_efl.h"
#include "gpu/command_buffer/common/mailbox.h"
+#include "ipc/ipc_sender.h"
#include "ui/base/ime/composition_text.h"
#include "ui/base/ime/text_input_client.h"
#include "ui/compositor/layer_owner.h"
-#include "ui/events/gestures/gesture_types.h"
#include "ui/events/gestures/gesture_recognizer.h"
+#include "ui/events/gestures/gesture_types.h"
#include "ui/events/gestures/motion_event_aura.h"
-#include "ipc/ipc_sender.h"
#if (EVAS_GL_API_VERSION == 1)
// For desktop build using efl-1.9.x ~ efl-1.11.x
// GLsync, GL*64, EvasGL*64 are not defined by Evas_GL.h
-typedef struct __GLsync* GLsync;
-typedef signed long long GLint64;
-typedef unsigned long long GLuint64;
+typedef struct __GLsync* GLsync;
+typedef signed long long GLint64;
+typedef unsigned long long GLuint64;
#else
-typedef EvasGLint64 GLint64;
-typedef EvasGLuint64 GLuint64;
+#if !defined(EWK_BRINGUP) // FIXME: m67 bringup
+typedef EvasGLint64 GLint64;
+typedef EvasGLuint64 GLuint64;
+#endif
#endif
struct TextInputState;
class Compositor;
class GestureEvent;
class TouchEvent;
-}
+struct DidOverscrollParams;
+} // namespace ui
namespace blink {
struct WebScreenInfo;
namespace content {
-typedef void (*Screenshot_Captured_Callback)(Evas_Object* image, void* user_data);
+typedef void (*Screenshot_Captured_Callback)(Evas_Object* image,
+ void* user_data);
class DisambiguationPopupEfl;
class EdgeEffect;
class CONTENT_EXPORT RenderWidgetHostViewEfl
: public RenderWidgetHostViewBase,
public DelegatedFrameHostClient,
+ public CompositorResizeLockClient,
public ui::LayerOwner,
public ui::GestureConsumer,
public ui::GestureEventHelper,
public base::SupportsWeakPtr<RenderWidgetHostViewEfl>,
public IPC::Sender {
public:
- explicit RenderWidgetHostViewEfl(RenderWidgetHost*, WebContents& web_contents);
+ explicit RenderWidgetHostViewEfl(RenderWidgetHost*,
+ WebContents& web_contents);
// RenderWidgetHostViewBase implementation.
void InitAsChild(gfx::NativeView) override;
bool HasFocus() const override;
void UpdateCursor(const WebCursor&) override;
void SetIsLoading(bool) override;
+ void SetBackgroundColor(SkColor color) override;
+ SkColor background_color() const override;
+ void UpdateBackgroundColorFromRenderer(SkColor color);
+
+ // CompositorResizeLockClient implementation.
+ std::unique_ptr<ui::CompositorLock> GetCompositorLock(
+ ui::CompositorLockClient* client) override;
+ void CompositorResizeLockEnded() override;
#if defined(EWK_BRINGUP)
// [M51_2704] TextInputStateChanged() should be removed and its functionality
void OnTextInputInFormStateChanged(bool is_in_form_tag);
void ImeCancelComposition() override;
- void ImeCompositionRangeChanged(const gfx::Range&, const std::vector<gfx::Rect>&) override;
- void FocusedNodeChanged(bool is_editable_node) override;
+ void ImeCompositionRangeChanged(const gfx::Range&,
+ const std::vector<gfx::Rect>&) override;
+ void FocusedNodeChanged(bool is_editable_node,
+ const gfx::Rect& node_bounds_in_screen) override;
void Destroy() override;
void SetTooltipText(const base::string16&) override;
- void SelectionChanged(const base::string16&, size_t, const gfx::Range&) override;
- void SelectionBoundsChanged(const ViewHostMsg_SelectionBounds_Params&) override;
- void CopyFromCompositingSurface(
- const gfx::Rect&,
- const gfx::Size& /* dst_size */,
- const ReadbackRequestCallback&,
- const SkColorType) override;
-
+ void SelectionChanged(const base::string16&,
+ size_t,
+ const gfx::Range&) override;
+ void SelectionBoundsChanged(
+ const ViewHostMsg_SelectionBounds_Params&) override;
+#if !defined(EWK_BRINGUP) // FIXME: m67 bringup
+ void CopyFromCompositingSurface(const gfx::Rect&,
+ const gfx::Size& /* dst_size */,
+ const ReadbackRequestCallback&,
+ const SkColorType) override;
void CopyFromCompositingSurfaceToVideoFrame(
- const gfx::Rect&,
- const scoped_refptr<media::VideoFrame>&,
- const base::Callback<void(const gfx::Rect&, bool)>&) override;
-
- bool CanCopyToVideoFrame() const override;
- void BeginFrameSubscription(
- std::unique_ptr<RenderWidgetHostViewFrameSubscriber> subscriber) override;
- void EndFrameSubscription() override;
- void DidOverscroll(const DidOverscrollParams& params) override;
+ const gfx::Rect&,
+ const scoped_refptr<media::VideoFrame>&,
+ const base::Callback<void(const gfx::Rect&, bool)>&) override;
+#endif
+ void SetNeedsBeginFrames(bool needs_begin_frames) override;
+ void DidOverscroll(const ui::DidOverscrollParams& params) override;
bool HasAcceleratedSurface(const gfx::Size&) override;
- void GetScreenInfo(blink::WebScreenInfo*) override;
gfx::Rect GetBoundsInRootWindow() override;
void RenderProcessGone(base::TerminationStatus, int) override;
bool OnMessageReceived(const IPC::Message&) override;
void OnFilteredMessageReceived(const IPC::Message&);
- void ProcessAckedTouchEvent(const TouchEventWithLatencyInfo&, InputEventAckState) override;
+ void ProcessAckedTouchEvent(const TouchEventWithLatencyInfo&,
+ InputEventAckState) override;
void DidStopFlinging() override;
- uint32_t GetSurfaceIdNamespace() override;
void ShowDisambiguationPopup(const gfx::Rect& rect_pixels,
const SkBitmap& zoomed_bitmap) override;
void DisambiguationPopupDismissed();
void HandleDisambiguationPopupMouseDownEvent(Evas_Event_Mouse_Down*);
void HandleDisambiguationPopupMouseUpEvent(Evas_Event_Mouse_Up*);
- void LockCompositingSurface() override;
- void UnlockCompositingSurface() override;
- void OnSwapCompositorFrame(
- uint32_t output_surface_id, cc::CompositorFrame frame) override;
+ void DidCreateNewRendererCompositorFrameSink(
+ viz::mojom::CompositorFrameSinkClient*
+ renderer_compositor_frame_sink) override;
+ void SubmitCompositorFrame(const viz::LocalSurfaceId& local_surface_id,
+ viz::CompositorFrame frame) override;
- void ClearCompositorFrame () override;
+ void ClearCompositorFrame() override;
// ui::GestureEventHelper implementation.
bool CanDispatchToConsumer(ui::GestureConsumer* consumer) override;
gfx::Rect GetIMERect() const;
void GetSnapshotAsync(const gfx::Rect& snapshot_area, int request_id);
bool RequestSnapshotAsync(const Eina_Rectangle rect,
- Screenshot_Captured_Callback callback,
- void* user_data);
+ Screenshot_Captured_Callback callback,
+ void* user_data);
void OnSnapshotDataReceived(SkBitmap bitmap, int snapshotId);
void CopyOutputCallback(int request_id,
- std::unique_ptr<cc::CopyOutputResult> result);
+ std::unique_ptr<viz::CopyOutputResult> result);
// DelegatedFrameHostClient implementation.
- int DelegatedFrameHostGetGpuMemoryBufferClientId() const override;
ui::Layer* DelegatedFrameHostGetLayer() const override;
bool DelegatedFrameHostIsVisible() const override;
SkColor DelegatedFrameHostGetGutterColor(SkColor color) const override;
- std::unique_ptr<ResizeLock> DelegatedFrameHostCreateResizeLock(
- bool defer_compositor_lock) override;
+ std::unique_ptr<CompositorResizeLock> DelegatedFrameHostCreateResizeLock()
+ override;
bool DelegatedFrameCanCreateResizeLock() const override;
gfx::Size DelegatedFrameHostDesiredSizeInDIP() const override;
+#if !defined(EWK_BRINGUP) // FIXME: m67 bringup
void DelegatedFrameHostResizeLockWasReleased() override;
- void DelegatedFrameHostSendCompositorSwapAck(
- int output_surface_id,
- const cc::CompositorFrameAck& ack) override;
void DelegatedFrameHostSendReclaimCompositorResources(
- int output_surface_id,
- const cc::CompositorFrameAck& ack) override;
- void DelegatedFrameHostOnLostCompositorResources() override;
- void DelegatedFrameHostUpdateVSyncParameters(
- const base::TimeTicks& timebase,
- const base::TimeDelta& interval) override;
- void SetBeginFrameSource(cc::BeginFrameSource* source) override;
+ int compositor_frame_sink_id,
+ bool is_swap_ack,
+ const viz::ReturnedResourceArray& resources) override;
+#endif
+ viz::LocalSurfaceId GetLocalSurfaceId() const override;
+ void OnBeginFrame() override;
+ bool IsAutoResizeEnabled() const override;
bool MakeCurrent();
SelectionControllerEfl* GetSelectionController() const {
void SetDoubleTapSupportEnabled(bool enabled);
void OnOrientationChangeEvent(int);
- void OnDidHandleKeyEvent(const blink::WebInputEvent* input_event, bool processed);
+ void OnDidHandleKeyEvent(const blink::WebInputEvent* input_event,
+ bool processed);
static void CopyFromCompositingSurfaceHasResultForVideo(
base::WeakPtr<RenderWidgetHostViewEfl> rwhvefl,
scoped_refptr<OwnedMailbox> subscriber_texture,
scoped_refptr<media::VideoFrame> video_frame,
const base::Callback<void(const gfx::Rect&, bool)>& callback,
- std::unique_ptr<cc::CopyOutputResult> result);
+ std::unique_ptr<viz::CopyOutputResult> result);
static void CopyFromCompositingSurfaceFinishedForVideo(
base::WeakPtr<RenderWidgetHostViewEfl> rwhvefl,
const base::Callback<void(bool)>& callback,
scoped_refptr<OwnedMailbox> subscriber_texture,
- std::unique_ptr<cc::SingleReleaseCallback> release_callback,
+ std::unique_ptr<viz::SingleReleaseCallback> release_callback,
bool result);
static void ReturnSubscriberTexture(
base::WeakPtr<RenderWidgetHostViewEfl> rwhvefl,
void PaintTextureToSurface(GLuint texture_id);
- // overrides CompositorClient
- void GetTextureFromMailbox(gpu::Mailbox* mailbox,
- gfx::Size surface_size) override;
-
RenderWidgetHostImpl* host_;
IMContextEfl* im_context_;
Evas* evas_;
scoped_refptr<EvasEventHandler> evas_event_handler_;
// YUV readback pipeline.
- std::unique_ptr<display_compositor::ReadbackYUVInterface>
- yuv_readback_pipeline_;
+ // std::unique_ptr<viz::ReadbackYUVInterface>
+ // yuv_readback_pipeline_;
// Subscriber that listens to frame presentation events.
std::unique_ptr<RenderWidgetHostViewFrameSubscriber> frame_subscriber_;
- std::vector<scoped_refptr<OwnedMailbox> > idle_frame_subscriber_textures_;
+ std::vector<scoped_refptr<OwnedMailbox>> idle_frame_subscriber_textures_;
std::set<OwnedMailbox*> active_frame_subscriber_textures_;
// Stores the current state of the active pointers targeting this
bool touch_events_enabled_;
bool handling_disambiguation_popup_gesture_;
+ // The background color of the web content.
+ SkColor background_color_;
// The last scroll offset of the view.
gfx::Vector2dF last_scroll_offset_;
WebContents& web_contents_;
- IDMap<ScreenshotCapturedCallback, IDMapOwnPointer> screen_capture_cb_map_;
+ base::IDMap<std::unique_ptr<ScreenshotCapturedCallback>>
+ screen_capture_cb_map_;
ui::Compositor* compositor_;
std::unique_ptr<ui::Layer> root_layer_;
std::unique_ptr<DelegatedFrameHost> delegated_frame_host_;
DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewEfl);
};
-} // namespace content
+} // namespace content
#endif
#include <Ecore.h>
-#include "base/time/time.h"
#include "base/strings/utf_string_conversions.h"
+#include "base/time/time.h"
#include "ui/display/screen.h"
#include "ui/events/event_utils.h"
-#include "ui/events/keycodes/keyboard_codes.h"
#include "ui/events/keycodes/keyboard_code_conversion_x.h"
+#include "ui/events/keycodes/keyboard_codes.h"
using namespace blink;
static const float kDefaultScrollStep = 20;
-static void TranslateEvasCoordToWebKitCoord(Evas_Object *web_view, int& x, int& y) {
+static void TranslateEvasCoordToWebKitCoord(Evas_Object* web_view,
+ blink::WebPoint* point) {
Evas_Coord tmpX, tmpY;
evas_object_geometry_get(web_view, &tmpX, &tmpY, 0, 0);
- x -= tmpX;
- y -= tmpY;
+ point->x -= tmpX;
+ point->y -= tmpY;
}
float GetDeviceScaleFactor() {
static float device_scale_factor = 0.0f;
if (!device_scale_factor) {
- device_scale_factor = display::Screen::GetScreen()->
- GetPrimaryDisplay().device_scale_factor();
+ device_scale_factor =
+ display::Screen::GetScreen()->GetPrimaryDisplay().device_scale_factor();
}
return device_scale_factor;
}
-inline bool string_ends_with(std::string const & value, std::string const & match) {
+inline bool string_ends_with(std::string const& value,
+ std::string const& match) {
if (match.size() > value.size()) {
return false;
}
return std::equal(match.rbegin(), match.rend(), value.rbegin());
}
-inline bool string_starts_with(std::string const & value, std::string const & match) {
+inline bool string_starts_with(std::string const& value,
+ std::string const& match) {
if (match.size() > value.size()) {
return false;
}
return std::equal(match.begin(), match.end(), value.begin());
}
-static ui::KeyboardCode WindowsKeyCodeFromEflKey(const char* key) {
- static std::unordered_map<std::string,ui::KeyboardCode> code_from_key_map ({
- {"Shift_L", ui::VKEY_LSHIFT},
- {"Shift_R", ui::VKEY_RSHIFT},
- {"Control_L", ui::VKEY_LCONTROL},
- {"Control_R", ui::VKEY_RCONTROL},
- {"Alt_L", ui::VKEY_LMENU},
- {"Alt_R", ui::VKEY_RMENU},
- {"Meta_L", ui::VKEY_LMENU},
- {"Meta_R", ui::VKEY_RMENU},
-
- // comes from KeyboardCodeFromXKeysym
- {"BackSpace", ui::VKEY_BACK},
- {"Delete", ui::VKEY_DELETE},
- {"Tab", ui::VKEY_TAB},
- {"Return", ui::VKEY_RETURN},
- {"KP_Enter", ui::VKEY_RETURN},
- {"Clear", ui::VKEY_CLEAR},
- {"space", ui::VKEY_SPACE},
- {"Home", ui::VKEY_HOME},
- {"KP_Home", ui::VKEY_HOME},
- {"End", ui::VKEY_END},
- {"KP_End", ui::VKEY_END},
- {"Prior", ui::VKEY_PRIOR},
- {"KP_Prior", ui::VKEY_PRIOR},
- {"Next", ui::VKEY_NEXT},
- {"KP_Next", ui::VKEY_NEXT},
- {"Left", ui::VKEY_LEFT},
- {"KP_Left", ui::VKEY_LEFT},
- {"Right", ui::VKEY_RIGHT},
- {"KP_Right", ui::VKEY_RIGHT},
- {"Down", ui::VKEY_DOWN},
- {"KP_Down", ui::VKEY_DOWN},
- {"Up", ui::VKEY_UP},
- {"KP_Up", ui::VKEY_UP},
- {"Escape", ui::VKEY_ESCAPE},
- {"Kana_Lock", ui::VKEY_KANA},
- {"Kana_Shift", ui::VKEY_KANA},
- {"Hangul", ui::VKEY_HANGUL},
- {"Hangul_Hanja", ui::VKEY_HANJA},
- {"Kanji", ui::VKEY_KANJI},
- {"Henkan", ui::VKEY_CONVERT},
- {"Muhenkan", ui::VKEY_NONCONVERT},
- {"Zenkaku_Hankaku", ui::VKEY_DBE_DBCSCHAR},
- {"KP_0", ui::VKEY_NUMPAD0},
- {"KP_1", ui::VKEY_NUMPAD1},
- {"KP_2", ui::VKEY_NUMPAD2},
- {"KP_3", ui::VKEY_NUMPAD3},
- {"KP_4", ui::VKEY_NUMPAD4},
- {"KP_5", ui::VKEY_NUMPAD5},
- {"KP_6", ui::VKEY_NUMPAD6},
- {"KP_7", ui::VKEY_NUMPAD7},
- {"KP_8", ui::VKEY_NUMPAD8},
- {"KP_9", ui::VKEY_NUMPAD9},
- {"KP_Multiply", ui::VKEY_MULTIPLY},
- {"KP_Add", ui::VKEY_ADD},
- {"KP_Separator", ui::VKEY_SEPARATOR},
- {"KP_Subtract", ui::VKEY_SUBTRACT},
- {"KP_Decimal", ui::VKEY_DECIMAL},
- {"KP_Divide", ui::VKEY_DIVIDE},
-
- {"ISO_Level5_Shift", ui::VKEY_OEM_8},
- {"ISO_Level3_Shift", ui::VKEY_ALTGR},
- {"Mode_switch", ui::VKEY_ALTGR},
- {"Multi_key", ui::VKEY_COMPOSE},
- {"Pause", ui::VKEY_PAUSE},
- {"Caps_Lock", ui::VKEY_CAPITAL},
- {"Num_Lock", ui::VKEY_NUMLOCK},
- {"Scroll_Lock", ui::VKEY_SCROLL},
- {"Select", ui::VKEY_SELECT},
- {"Print", ui::VKEY_PRINT},
- {"Execute", ui::VKEY_EXECUTE},
- {"Insert", ui::VKEY_INSERT},
- {"KP_Insert", ui::VKEY_INSERT},
- {"Help", ui::VKEY_HELP},
- {"Super_L", ui::VKEY_LWIN},
- {"Super_R", ui::VKEY_RWIN},
- {"Menu", ui::VKEY_APPS},
- {"F1", ui::VKEY_F1},
- {"KP_F1", ui::VKEY_F1},
- {"F2", ui::VKEY_F2},
- {"KP_F2", ui::VKEY_F2},
- {"F3", ui::VKEY_F3},
- {"KP_F3", ui::VKEY_F3},
- {"F4", ui::VKEY_F4},
- {"KP_F4", ui::VKEY_F4},
- {"F5", ui::VKEY_F5},
- {"F6", ui::VKEY_F6},
- {"F7", ui::VKEY_F7},
- {"F8", ui::VKEY_F8},
- {"F9", ui::VKEY_F9},
- {"F10", ui::VKEY_F10},
- {"F11", ui::VKEY_F11},
- {"F12", ui::VKEY_F12},
- {"F13", ui::VKEY_F13},
- {"F14", ui::VKEY_F14},
- {"F15", ui::VKEY_F15},
- {"F16", ui::VKEY_F16},
- {"F17", ui::VKEY_F17},
- {"F18", ui::VKEY_F18},
- {"F19", ui::VKEY_F19},
- {"F20", ui::VKEY_F20},
- {"F21", ui::VKEY_F21},
- {"F22", ui::VKEY_F22},
- {"F23", ui::VKEY_F23},
- {"F24", ui::VKEY_F24},
- {"guillemotleft", ui::VKEY_OEM_102},
- {"guillemotright", ui::VKEY_OEM_102},
- {"degree", ui::VKEY_OEM_102},
- {"ugrave", ui::VKEY_OEM_102},
- {"Ugrave", ui::VKEY_OEM_102},
- {"brokenbar", ui::VKEY_OEM_102},
- {"XF86Back", ui::VKEY_BROWSER_BACK},
- {"XF86Forward", ui::VKEY_BROWSER_FORWARD},
- {"XF86Reload", ui::VKEY_BROWSER_REFRESH},
- {"XF86Stop", ui::VKEY_BROWSER_STOP},
- {"XF86Search", ui::VKEY_BROWSER_SEARCH},
- {"XF86Favorites", ui::VKEY_BROWSER_FAVORITES},
- {"XF86HomePage", ui::VKEY_BROWSER_HOME},
- {"XF86AudioMute", ui::VKEY_VOLUME_MUTE},
- {"XF86AudioLowerVolume", ui::VKEY_VOLUME_DOWN},
- {"XF86AudioRaiseVolume", ui::VKEY_VOLUME_UP},
- {"XF86AudioNext", ui::VKEY_MEDIA_NEXT_TRACK},
- {"XF86AudioPrev", ui::VKEY_MEDIA_PREV_TRACK},
- {"XF86AudioStop", ui::VKEY_MEDIA_STOP},
- {"XF86AudioPlay", ui::VKEY_MEDIA_PLAY_PAUSE},
- {"XF86Mail", ui::VKEY_MEDIA_LAUNCH_MAIL},
- {"XF86LaunchA", ui::VKEY_MEDIA_LAUNCH_APP1},
- {"XF86LaunchB", ui::VKEY_MEDIA_LAUNCH_APP2},
- {"XF86Calculator", ui::VKEY_MEDIA_LAUNCH_APP2},
- {"XF86WLAN", ui::VKEY_WLAN},
- {"XF86PowerOff", ui::VKEY_POWER},
- {"XF86Sleep", ui::VKEY_SLEEP},
- {"XF86MonBrightnessDown", ui::VKEY_BRIGHTNESS_DOWN},
- {"XF86MonBrightnessUp", ui::VKEY_BRIGHTNESS_UP},
- {"XF86KbdBrightnessDown", ui::VKEY_KBD_BRIGHTNESS_DOWN},
- {"XF86KbdBrightnessUp", ui::VKEY_KBD_BRIGHTNESS_UP},
-
- //XXX: it won't work on all keyboard layouts
- {"comma", ui::VKEY_OEM_COMMA},
- {"less", ui::VKEY_OEM_COMMA},
- {"minus", ui::VKEY_OEM_MINUS},
- {"underscore", ui::VKEY_OEM_MINUS},
- {"greater", ui::VKEY_OEM_PERIOD},
- {"period", ui::VKEY_OEM_PERIOD},
- {"semicolon", ui::VKEY_OEM_1},
- {"colon", ui::VKEY_OEM_1},
- {"question", ui::VKEY_OEM_2},
- {"slash", ui::VKEY_OEM_2},
- {"asciitilde", ui::VKEY_OEM_3},
- {"quoteleft", ui::VKEY_OEM_3},
- {"bracketleft", ui::VKEY_OEM_4},
- {"braceleft", ui::VKEY_OEM_4},
- {"backslash", ui::VKEY_OEM_5},
- {"bar", ui::VKEY_OEM_5},
- {"bracketright", ui::VKEY_OEM_6},
- {"braceright", ui::VKEY_OEM_6},
- {"quoteright", ui::VKEY_OEM_7},
- {"quotedbl", ui::VKEY_OEM_7},
-
- //XXX: handle accents and other characters
- {"a", ui::VKEY_A},
- {"A", ui::VKEY_A},
- {"b", ui::VKEY_B},
- {"B", ui::VKEY_B},
- {"c", ui::VKEY_C},
- {"C", ui::VKEY_C},
- {"d", ui::VKEY_D},
- {"D", ui::VKEY_D},
- {"e", ui::VKEY_E},
- {"E", ui::VKEY_E},
- {"f", ui::VKEY_F},
- {"F", ui::VKEY_F},
- {"g", ui::VKEY_G},
- {"G", ui::VKEY_G},
- {"h", ui::VKEY_H},
- {"H", ui::VKEY_H},
- {"i", ui::VKEY_I},
- {"I", ui::VKEY_I},
- {"j", ui::VKEY_J},
- {"J", ui::VKEY_J},
- {"k", ui::VKEY_K},
- {"K", ui::VKEY_K},
- {"l", ui::VKEY_L},
- {"L", ui::VKEY_L},
- {"m", ui::VKEY_M},
- {"M", ui::VKEY_M},
- {"n", ui::VKEY_N},
- {"N", ui::VKEY_N},
- {"o", ui::VKEY_O},
- {"O", ui::VKEY_O},
- {"p", ui::VKEY_P},
- {"P", ui::VKEY_P},
- {"q", ui::VKEY_Q},
- {"Q", ui::VKEY_Q},
- {"r", ui::VKEY_R},
- {"R", ui::VKEY_R},
- {"s", ui::VKEY_S},
- {"S", ui::VKEY_S},
- {"t", ui::VKEY_T},
- {"T", ui::VKEY_T},
- {"u", ui::VKEY_U},
- {"U", ui::VKEY_U},
- {"v", ui::VKEY_V},
- {"V", ui::VKEY_V},
- {"w", ui::VKEY_W},
- {"W", ui::VKEY_W},
- {"x", ui::VKEY_X},
- {"X", ui::VKEY_X},
- {"y", ui::VKEY_Y},
- {"Y", ui::VKEY_Y},
- {"z", ui::VKEY_Z},
- {"Z", ui::VKEY_Z},
+static ui::KeyboardCode windows_key_codeFromEflKey(const char* key) {
+ static std::unordered_map<std::string, ui::KeyboardCode> code_from_key_map({
+ {"Shift_L", ui::VKEY_LSHIFT},
+ {"Shift_R", ui::VKEY_RSHIFT},
+ {"Control_L", ui::VKEY_LCONTROL},
+ {"Control_R", ui::VKEY_RCONTROL},
+ {"Alt_L", ui::VKEY_LMENU},
+ {"Alt_R", ui::VKEY_RMENU},
+ {"Meta_L", ui::VKEY_LMENU},
+ {"Meta_R", ui::VKEY_RMENU},
+
+ // comes from KeyboardCodeFromXKeysym
+ {"BackSpace", ui::VKEY_BACK},
+ {"Delete", ui::VKEY_DELETE},
+ {"Tab", ui::VKEY_TAB},
+ {"Return", ui::VKEY_RETURN},
+ {"KP_Enter", ui::VKEY_RETURN},
+ {"Clear", ui::VKEY_CLEAR},
+ {"space", ui::VKEY_SPACE},
+ {"Home", ui::VKEY_HOME},
+ {"KP_Home", ui::VKEY_HOME},
+ {"End", ui::VKEY_END},
+ {"KP_End", ui::VKEY_END},
+ {"Prior", ui::VKEY_PRIOR},
+ {"KP_Prior", ui::VKEY_PRIOR},
+ {"Next", ui::VKEY_NEXT},
+ {"KP_Next", ui::VKEY_NEXT},
+ {"Left", ui::VKEY_LEFT},
+ {"KP_Left", ui::VKEY_LEFT},
+ {"Right", ui::VKEY_RIGHT},
+ {"KP_Right", ui::VKEY_RIGHT},
+ {"Down", ui::VKEY_DOWN},
+ {"KP_Down", ui::VKEY_DOWN},
+ {"Up", ui::VKEY_UP},
+ {"KP_Up", ui::VKEY_UP},
+ {"Escape", ui::VKEY_ESCAPE},
+ {"Kana_Lock", ui::VKEY_KANA},
+ {"Kana_Shift", ui::VKEY_KANA},
+ {"Hangul", ui::VKEY_HANGUL},
+ {"Hangul_Hanja", ui::VKEY_HANJA},
+ {"Kanji", ui::VKEY_KANJI},
+ {"Henkan", ui::VKEY_CONVERT},
+ {"Muhenkan", ui::VKEY_NONCONVERT},
+ {"Zenkaku_Hankaku", ui::VKEY_DBE_DBCSCHAR},
+ {"KP_0", ui::VKEY_NUMPAD0},
+ {"KP_1", ui::VKEY_NUMPAD1},
+ {"KP_2", ui::VKEY_NUMPAD2},
+ {"KP_3", ui::VKEY_NUMPAD3},
+ {"KP_4", ui::VKEY_NUMPAD4},
+ {"KP_5", ui::VKEY_NUMPAD5},
+ {"KP_6", ui::VKEY_NUMPAD6},
+ {"KP_7", ui::VKEY_NUMPAD7},
+ {"KP_8", ui::VKEY_NUMPAD8},
+ {"KP_9", ui::VKEY_NUMPAD9},
+ {"KP_Multiply", ui::VKEY_MULTIPLY},
+ {"KP_Add", ui::VKEY_ADD},
+ {"KP_Separator", ui::VKEY_SEPARATOR},
+ {"KP_Subtract", ui::VKEY_SUBTRACT},
+ {"KP_Decimal", ui::VKEY_DECIMAL},
+ {"KP_Divide", ui::VKEY_DIVIDE},
+
+ {"ISO_Level5_Shift", ui::VKEY_OEM_8},
+ {"ISO_Level3_Shift", ui::VKEY_ALTGR},
+ {"Mode_switch", ui::VKEY_ALTGR},
+ {"Multi_key", ui::VKEY_COMPOSE},
+ {"Pause", ui::VKEY_PAUSE},
+ {"Caps_Lock", ui::VKEY_CAPITAL},
+ {"Num_Lock", ui::VKEY_NUMLOCK},
+ {"Scroll_Lock", ui::VKEY_SCROLL},
+ {"Select", ui::VKEY_SELECT},
+ {"Print", ui::VKEY_PRINT},
+ {"Execute", ui::VKEY_EXECUTE},
+ {"Insert", ui::VKEY_INSERT},
+ {"KP_Insert", ui::VKEY_INSERT},
+ {"Help", ui::VKEY_HELP},
+ {"Super_L", ui::VKEY_LWIN},
+ {"Super_R", ui::VKEY_RWIN},
+ {"Menu", ui::VKEY_APPS},
+ {"F1", ui::VKEY_F1},
+ {"KP_F1", ui::VKEY_F1},
+ {"F2", ui::VKEY_F2},
+ {"KP_F2", ui::VKEY_F2},
+ {"F3", ui::VKEY_F3},
+ {"KP_F3", ui::VKEY_F3},
+ {"F4", ui::VKEY_F4},
+ {"KP_F4", ui::VKEY_F4},
+ {"F5", ui::VKEY_F5},
+ {"F6", ui::VKEY_F6},
+ {"F7", ui::VKEY_F7},
+ {"F8", ui::VKEY_F8},
+ {"F9", ui::VKEY_F9},
+ {"F10", ui::VKEY_F10},
+ {"F11", ui::VKEY_F11},
+ {"F12", ui::VKEY_F12},
+ {"F13", ui::VKEY_F13},
+ {"F14", ui::VKEY_F14},
+ {"F15", ui::VKEY_F15},
+ {"F16", ui::VKEY_F16},
+ {"F17", ui::VKEY_F17},
+ {"F18", ui::VKEY_F18},
+ {"F19", ui::VKEY_F19},
+ {"F20", ui::VKEY_F20},
+ {"F21", ui::VKEY_F21},
+ {"F22", ui::VKEY_F22},
+ {"F23", ui::VKEY_F23},
+ {"F24", ui::VKEY_F24},
+ {"guillemotleft", ui::VKEY_OEM_102},
+ {"guillemotright", ui::VKEY_OEM_102},
+ {"degree", ui::VKEY_OEM_102},
+ {"ugrave", ui::VKEY_OEM_102},
+ {"Ugrave", ui::VKEY_OEM_102},
+ {"brokenbar", ui::VKEY_OEM_102},
+ {"XF86Back", ui::VKEY_BROWSER_BACK},
+ {"XF86Forward", ui::VKEY_BROWSER_FORWARD},
+ {"XF86Reload", ui::VKEY_BROWSER_REFRESH},
+ {"XF86Stop", ui::VKEY_BROWSER_STOP},
+ {"XF86Search", ui::VKEY_BROWSER_SEARCH},
+ {"XF86Favorites", ui::VKEY_BROWSER_FAVORITES},
+ {"XF86HomePage", ui::VKEY_BROWSER_HOME},
+ {"XF86AudioMute", ui::VKEY_VOLUME_MUTE},
+ {"XF86AudioLowerVolume", ui::VKEY_VOLUME_DOWN},
+ {"XF86AudioRaiseVolume", ui::VKEY_VOLUME_UP},
+ {"XF86AudioNext", ui::VKEY_MEDIA_NEXT_TRACK},
+ {"XF86AudioPrev", ui::VKEY_MEDIA_PREV_TRACK},
+ {"XF86AudioStop", ui::VKEY_MEDIA_STOP},
+ {"XF86AudioPlay", ui::VKEY_MEDIA_PLAY_PAUSE},
+ {"XF86Mail", ui::VKEY_MEDIA_LAUNCH_MAIL},
+ {"XF86LaunchA", ui::VKEY_MEDIA_LAUNCH_APP1},
+ {"XF86LaunchB", ui::VKEY_MEDIA_LAUNCH_APP2},
+ {"XF86Calculator", ui::VKEY_MEDIA_LAUNCH_APP2},
+ {"XF86WLAN", ui::VKEY_WLAN},
+ {"XF86PowerOff", ui::VKEY_POWER},
+ {"XF86Sleep", ui::VKEY_SLEEP},
+ {"XF86MonBrightnessDown", ui::VKEY_BRIGHTNESS_DOWN},
+ {"XF86MonBrightnessUp", ui::VKEY_BRIGHTNESS_UP},
+ {"XF86KbdBrightnessDown", ui::VKEY_KBD_BRIGHTNESS_DOWN},
+ {"XF86KbdBrightnessUp", ui::VKEY_KBD_BRIGHTNESS_UP},
+
+ // XXX: it won't work on all keyboard layouts
+ {"comma", ui::VKEY_OEM_COMMA},
+ {"less", ui::VKEY_OEM_COMMA},
+ {"minus", ui::VKEY_OEM_MINUS},
+ {"underscore", ui::VKEY_OEM_MINUS},
+ {"greater", ui::VKEY_OEM_PERIOD},
+ {"period", ui::VKEY_OEM_PERIOD},
+ {"semicolon", ui::VKEY_OEM_1},
+ {"colon", ui::VKEY_OEM_1},
+ {"question", ui::VKEY_OEM_2},
+ {"slash", ui::VKEY_OEM_2},
+ {"asciitilde", ui::VKEY_OEM_3},
+ {"quoteleft", ui::VKEY_OEM_3},
+ {"bracketleft", ui::VKEY_OEM_4},
+ {"braceleft", ui::VKEY_OEM_4},
+ {"backslash", ui::VKEY_OEM_5},
+ {"bar", ui::VKEY_OEM_5},
+ {"bracketright", ui::VKEY_OEM_6},
+ {"braceright", ui::VKEY_OEM_6},
+ {"quoteright", ui::VKEY_OEM_7},
+ {"quotedbl", ui::VKEY_OEM_7},
+
+ // XXX: handle accents and other characters
+ {"a", ui::VKEY_A},
+ {"A", ui::VKEY_A},
+ {"b", ui::VKEY_B},
+ {"B", ui::VKEY_B},
+ {"c", ui::VKEY_C},
+ {"C", ui::VKEY_C},
+ {"d", ui::VKEY_D},
+ {"D", ui::VKEY_D},
+ {"e", ui::VKEY_E},
+ {"E", ui::VKEY_E},
+ {"f", ui::VKEY_F},
+ {"F", ui::VKEY_F},
+ {"g", ui::VKEY_G},
+ {"G", ui::VKEY_G},
+ {"h", ui::VKEY_H},
+ {"H", ui::VKEY_H},
+ {"i", ui::VKEY_I},
+ {"I", ui::VKEY_I},
+ {"j", ui::VKEY_J},
+ {"J", ui::VKEY_J},
+ {"k", ui::VKEY_K},
+ {"K", ui::VKEY_K},
+ {"l", ui::VKEY_L},
+ {"L", ui::VKEY_L},
+ {"m", ui::VKEY_M},
+ {"M", ui::VKEY_M},
+ {"n", ui::VKEY_N},
+ {"N", ui::VKEY_N},
+ {"o", ui::VKEY_O},
+ {"O", ui::VKEY_O},
+ {"p", ui::VKEY_P},
+ {"P", ui::VKEY_P},
+ {"q", ui::VKEY_Q},
+ {"Q", ui::VKEY_Q},
+ {"r", ui::VKEY_R},
+ {"R", ui::VKEY_R},
+ {"s", ui::VKEY_S},
+ {"S", ui::VKEY_S},
+ {"t", ui::VKEY_T},
+ {"T", ui::VKEY_T},
+ {"u", ui::VKEY_U},
+ {"U", ui::VKEY_U},
+ {"v", ui::VKEY_V},
+ {"V", ui::VKEY_V},
+ {"w", ui::VKEY_W},
+ {"W", ui::VKEY_W},
+ {"x", ui::VKEY_X},
+ {"X", ui::VKEY_X},
+ {"y", ui::VKEY_Y},
+ {"Y", ui::VKEY_Y},
+ {"z", ui::VKEY_Z},
+ {"Z", ui::VKEY_Z},
});
auto uicode = code_from_key_map.find(key);
static int ModifiersFromEflKey(const char* key) {
if (string_ends_with(key, "_L")) {
- return WebInputEvent::IsLeft;
+ return WebInputEvent::kIsLeft;
} else if (string_ends_with(key, "_R")) {
- return WebInputEvent::IsRight;
+ return WebInputEvent::kIsRight;
} else if (string_starts_with(key, "KP_")) {
- return WebInputEvent::IsKeyPad;
+ return WebInputEvent::kIsKeyPad;
}
return 0;
}
// From
// third_party/blink/Source/blink/chromium/src/gtk/WebInputEventFactory.cpp:
static blink::WebUChar GetControlCharacter(int windows_key_code, bool shift) {
- if (windows_key_code >= ui::VKEY_A &&
- windows_key_code <= ui::VKEY_Z) {
+ if (windows_key_code >= ui::VKEY_A && windows_key_code <= ui::VKEY_Z) {
// ctrl-A ~ ctrl-Z map to \x01 ~ \x1A
return windows_key_code - ui::VKEY_A + 1;
}
return 0;
}
-enum {
- LeftButton = 1,
- MiddleButton = 2,
- RightButton = 3
-};
+enum { LeftButton = 1, MiddleButton = 2, RightButton = 3 };
-static WebMouseEvent::Button EvasToWebMouseButton(int button) {
+static WebMouseEvent::Button EvasToWebMouseButton(int button) {
if (button == LeftButton)
- return WebMouseEvent::ButtonLeft;
+ return WebMouseEvent::Button::kLeft;
if (button == MiddleButton)
- return WebMouseEvent::ButtonMiddle;
+ return WebMouseEvent::Button::kMiddle;
if (button == RightButton)
- return WebMouseEvent::ButtonRight;
+ return WebMouseEvent::Button::kRight;
- return WebMouseEvent::ButtonNone;
+ return WebMouseEvent::Button::kNoButton;
}
-static WebInputEvent::Modifiers EvasToWebModifiers(const Evas_Modifier* modifiers) {
+static WebInputEvent::Modifiers EvasToWebModifiers(
+ const Evas_Modifier* modifiers) {
unsigned result = 0;
if (evas_key_modifier_is_set(modifiers, "Shift"))
- result |= WebInputEvent::ShiftKey;
+ result |= WebInputEvent::kShiftKey;
if (evas_key_modifier_is_set(modifiers, "Control"))
- result |= WebInputEvent::ControlKey;
+ result |= WebInputEvent::kControlKey;
if (evas_key_modifier_is_set(modifiers, "Alt"))
- result |= WebInputEvent::AltKey;
+ result |= WebInputEvent::kAltKey;
if (evas_key_modifier_is_set(modifiers, "Meta"))
- result |= WebInputEvent::MetaKey;
+ result |= WebInputEvent::kMetaKey;
return static_cast<WebInputEvent::Modifiers>(result);
}
-} // namespace
+} // namespace
template <class EVT>
blink::WebMouseEvent MakeWebMouseEvent(WebInputEvent::Type type,
- Evas_Object* view, const EVT* ev) {
-
- WebMouseEvent event;
- event.timeStampSeconds = (double)ev->timestamp / 1000;
- event.button = EvasToWebMouseButton(ev->button);
- event.modifiers = EvasToWebModifiers(ev->modifiers);
-
+ Evas_Object* view,
+ const EVT* ev) {
const float sf = GetDeviceScaleFactor();
- event.windowX = ev->canvas.x / sf;
- event.windowY = ev->canvas.y / sf;
-
- TranslateEvasCoordToWebKitCoord(view, event.windowX, event.windowY);
-
- event.x = event.windowX;
- event.y = event.windowY;
-
+ blink::WebPoint point(ev->canvas.x / sf, ev->canvas.y / sf);
+ TranslateEvasCoordToWebKitCoord(view, &point);
Evas* evas = evas_object_evas_get(view);
- event.globalX = evas_coord_world_x_to_screen(evas, ev->canvas.x) / sf;
- event.globalY = evas_coord_world_y_to_screen(evas, ev->canvas.y) / sf;
- event.type = type;
- event.clickCount = 1;
+ WebMouseEvent event(
+ type, WebFloatPoint(point.x, point.y),
+ WebFloatPoint(evas_coord_world_x_to_screen(evas, ev->canvas.x) / sf,
+ evas_coord_world_y_to_screen(evas, ev->canvas.y) / sf),
+ EvasToWebMouseButton(ev->button), 1, EvasToWebModifiers(ev->modifiers),
+ (double)ev->timestamp / 1000);
return event;
}
template blink::WebMouseEvent MakeWebMouseEvent<Evas_Event_Mouse_Down>(
- WebInputEvent::Type, Evas_Object*, const Evas_Event_Mouse_Down*);
+ WebInputEvent::Type,
+ Evas_Object*,
+ const Evas_Event_Mouse_Down*);
template blink::WebMouseEvent MakeWebMouseEvent<Evas_Event_Mouse_Up>(
- WebInputEvent::Type, Evas_Object*, const Evas_Event_Mouse_Up*);
+ WebInputEvent::Type,
+ Evas_Object*,
+ const Evas_Event_Mouse_Up*);
blink::WebMouseEvent MakeWebMouseEvent(Evas_Object* view,
- const Evas_Event_Mouse_Move* ev) {
- WebMouseEvent event;
- event.timeStampSeconds = (double)ev->timestamp / 1000;
- event.modifiers = EvasToWebModifiers(ev->modifiers);
+ const Evas_Event_Mouse_Move* ev) {
+ WebMouseEvent event(WebInputEvent::kMouseMove,
+ EvasToWebModifiers(ev->modifiers),
+ (double)ev->timestamp / 1000);
const float sf = GetDeviceScaleFactor();
- event.windowX = ev->cur.canvas.x / sf;
- event.windowY = ev->cur.canvas.y / sf;
-
- TranslateEvasCoordToWebKitCoord(view, event.windowX, event.windowY);
-
- event.x = event.windowX;
- event.y = event.windowY;
+ blink::WebPoint point(ev->cur.canvas.x / sf, ev->cur.canvas.y / sf);
+ TranslateEvasCoordToWebKitCoord(view, &point);
Evas* evas = evas_object_evas_get(view);
- event.globalX = evas_coord_world_x_to_screen(evas, ev->cur.canvas.x) / sf;
- event.globalY = evas_coord_world_y_to_screen(evas, ev->cur.canvas.y) / sf;
- event.type = WebInputEvent::MouseMove;
+ event.SetPositionInScreen(
+ evas_coord_world_x_to_screen(evas, ev->cur.canvas.x) / sf,
+ evas_coord_world_y_to_screen(evas, ev->cur.canvas.y) / sf);
+ event.SetPositionInWidget(point.x, point.y);
return event;
}
-blink::WebMouseWheelEvent MakeWebMouseEvent(
- Evas_Object* view, const Evas_Event_Mouse_Wheel* ev) {
- WebMouseWheelEvent event;
- event.timeStampSeconds = (double)ev->timestamp / 1000;
- event.modifiers = EvasToWebModifiers(ev->modifiers);
+blink::WebMouseWheelEvent MakeWebMouseEvent(Evas_Object* view,
+ const Evas_Event_Mouse_Wheel* ev) {
+ WebMouseWheelEvent event(WebInputEvent::kMouseWheel,
+ EvasToWebModifiers(ev->modifiers),
+ (double)ev->timestamp / 1000);
const float sf = GetDeviceScaleFactor();
- event.windowX = (ev->canvas.x) / sf;
- event.windowY = (ev->canvas.y) / sf;
-
- TranslateEvasCoordToWebKitCoord(view, event.windowX, event.windowY);
-
- event.x = event.windowX;
- event.y = event.windowY;
+ blink::WebPoint point((ev->canvas.x) / sf, (ev->canvas.y) / sf);
+ TranslateEvasCoordToWebKitCoord(view, &point);
Evas* evas = evas_object_evas_get(view);
- event.globalX = evas_coord_world_x_to_screen(evas, ev->canvas.x) / sf;
- event.globalY = evas_coord_world_y_to_screen(evas, ev->canvas.y) / sf;
- event.type = WebInputEvent::MouseWheel;
+ event.SetPositionInScreen(
+ evas_coord_world_x_to_screen(evas, ev->canvas.x) / sf,
+ evas_coord_world_y_to_screen(evas, ev->canvas.y) / sf);
if (ev->direction) {
- event.wheelTicksX = ev->z;
- event.deltaX = ev->z * kDefaultScrollStep;
+ event.wheel_ticks_x = ev->z;
+ event.delta_x = ev->z * kDefaultScrollStep;
} else {
- event.wheelTicksY = -(ev->z);
- event.deltaY = -(ev->z * kDefaultScrollStep);
+ event.wheel_ticks_y = -(ev->z);
+ event.delta_y = -(ev->z * kDefaultScrollStep);
}
return event;
template <class EVT>
NativeWebKeyboardEvent MakeWebKeyboardEvent(bool pressed, const EVT* evt) {
+ NativeWebKeyboardEvent event(
+ pressed ? WebInputEvent::kKeyDown : WebInputEvent::kKeyUp,
+ ModifiersFromEflKey(evt->key), (double)evt->timestamp / 1000);
- NativeWebKeyboardEvent event;
- event.timeStampSeconds = (double)evt->timestamp / 1000;
- event.modifiers = EvasToWebModifiers(evt->modifiers);
- event.type = pressed ? WebInputEvent::KeyDown : WebInputEvent::KeyUp;
+ event.native_key_code = evt->keycode;
+ event.windows_key_code = windows_key_codeFromEflKey(evt->key);
- event.nativeKeyCode = evt->keycode;
- event.windowsKeyCode = WindowsKeyCodeFromEflKey(evt->key);
- event.modifiers = ModifiersFromEflKey(evt->key);
-
- if (event.windowsKeyCode == ui::VKEY_RETURN) {
- event.unmodifiedText[0] = '\r';
+ if (event.windows_key_code == ui::VKEY_RETURN) {
+ event.unmodified_text[0] = '\r';
} else {
- event.unmodifiedText[0] = CharacterFromEflString(evt->string);
+ event.unmodified_text[0] = CharacterFromEflString(evt->string);
}
- if (event.modifiers & blink::WebInputEvent::ControlKey) {
- event.text[0] =
- GetControlCharacter(event.windowsKeyCode,
- event.modifiers & blink::WebInputEvent::ShiftKey);
+ if (event.GetModifiers() & blink::WebInputEvent::kControlKey) {
+ event.text[0] = GetControlCharacter(
+ event.windows_key_code,
+ event.GetModifiers() & blink::WebInputEvent::kShiftKey);
} else {
- event.text[0] = event.unmodifiedText[0];
+ event.text[0] = event.unmodified_text[0];
}
- event.setKeyIdentifierFromWindowsKeyCode();
-
return event;
}
template NativeWebKeyboardEvent MakeWebKeyboardEvent(
- bool, const Evas_Event_Key_Down*);
-template NativeWebKeyboardEvent MakeWebKeyboardEvent(
- bool, const Evas_Event_Key_Up*);
+ bool,
+ const Evas_Event_Key_Down*);
+template NativeWebKeyboardEvent MakeWebKeyboardEvent(bool,
+ const Evas_Event_Key_Up*);
static ui::EventType EvasTouchEventTypeToUI(Evas_Touch_Point_State evas_touch) {
- switch(evas_touch) {
+ switch (evas_touch) {
case EVAS_TOUCH_POINT_DOWN:
return ui::ET_TOUCH_PRESSED;
case EVAS_TOUCH_POINT_MOVE:
case EVAS_TOUCH_POINT_CANCEL:
return ui::ET_TOUCH_CANCELLED;
case EVAS_TOUCH_POINT_STILL:
- // Not handled by chromium, should not be passed here.
+ // Not handled by chromium, should not be passed here.
default:
NOTREACHED();
return ui::ET_UNKNOWN;
bool IsHardwareBackKey(const Evas_Event_Key_Down* event) {
#if defined(OS_TIZEN)
return (strcmp(event->key, "XF86Back") == 0 ||
- strcmp(event->key, "XF86Stop") == 0);
+ strcmp(event->key, "XF86Stop") == 0);
#endif
return (strcmp(event->key, "Escape") == 0);
}
ui::TouchEvent MakeTouchEvent(Evas_Coord_Point pt,
Evas_Touch_Point_State state,
- int id, Evas_Object* view,
+ int id,
+ Evas_Object* view,
unsigned int timestamp) {
- TranslateEvasCoordToWebKitCoord(view, pt.x, pt.y);
+ blink::WebPoint point(pt.x, pt.y);
+ TranslateEvasCoordToWebKitCoord(view, &point);
+ pt.x = point.x;
+ pt.y = point.y;
+
const float scale = GetDeviceScaleFactor();
- base::TimeTicks event_timestamp =
- base::TimeTicks::FromInternalValue(
- timestamp * base::Time::kMicrosecondsPerMillisecond);
+ base::TimeTicks event_timestamp = base::TimeTicks::FromInternalValue(
+ timestamp * base::Time::kMicrosecondsPerMillisecond);
if (timestamp == 0)
event_timestamp = ui::EventTimeForNow();
+
+ // FIXME: M63 bring up. Fill up pointer details
return ui::TouchEvent(EvasTouchEventTypeToUI(state),
- gfx::Point(pt.x / scale, pt.y / scale), id, event_timestamp);
+ gfx::Point(pt.x / scale, pt.y / scale), event_timestamp,
+ ui::PointerDetails());
}
template WebGestureEvent MakeGestureEvent<Evas_Event_Mouse_Down>(
- WebInputEvent::Type type, Evas_Object*, const Evas_Event_Mouse_Down* ev);
+ WebInputEvent::Type type,
+ Evas_Object*,
+ const Evas_Event_Mouse_Down* ev);
template WebGestureEvent MakeGestureEvent<Evas_Event_Mouse_Up>(
- WebInputEvent::Type type, Evas_Object*, const Evas_Event_Mouse_Up* ev);
+ WebInputEvent::Type type,
+ Evas_Object*,
+ const Evas_Event_Mouse_Up* ev);
template <class EVT>
WebGestureEvent MakeGestureEvent(WebInputEvent::Type type,
- Evas_Object* view, const EVT* ev) {
+ Evas_Object* view,
+ const EVT* ev) {
+ WebGestureEvent event(type, EvasToWebModifiers(ev->modifiers),
+ ev->timestamp / 1000);
- WebGestureEvent event;
- event.timeStampSeconds = ev->timestamp / 1000;
- event.type = type;
- event.sourceDevice = WebGestureDeviceTouchscreen;
+ event.source_device = kWebGestureDeviceTouchscreen;
const float sf = GetDeviceScaleFactor();
- event.x = ev->canvas.x / sf;
- event.y = ev->canvas.y / sf;
+ blink::WebPoint point(ev->canvas.x / sf, ev->canvas.y / sf);
+ TranslateEvasCoordToWebKitCoord(view, &point);
+
+ event.x = point.x;
+ event.y = point.y;
- TranslateEvasCoordToWebKitCoord(view, event.x, event.y);
return event;
}
-}
+} // namespace content
#include <Evas.h>
#include "content/browser/renderer_host/render_widget_host_impl.h"
-#include "content/public/browser/native_web_keyboard_event.h"
#include "content/common/content_export.h"
-#include "third_party/WebKit/public/web/WebInputEvent.h"
+#include "content/public/browser/native_web_keyboard_event.h"
+#include "third_party/blink/public/platform/web_input_event.h"
#include "ui/events/event.h"
namespace content {
#include "base/macros.h"
#include "content/public/browser/screen_orientation_delegate.h"
-#include "third_party/WebKit/public/platform/modules/screen_orientation/WebScreenOrientationLockType.h"
+#include "third_party/blink/public/platform/modules/screen_orientation/web_screen_orientation_lock_type.h"
namespace content {
return false;
}
- RenderWidgetHostImpl* rwhi = static_cast<RenderWidgetHostImpl*>(
- web_contents_.GetRenderViewHost()->GetWidget());
- rwhi->ExecuteEditCommand("Unselect", "");
- return true;
+ // RenderWidgetHostImpl* rwhi = static_cast<RenderWidgetHostImpl*>(
+ // web_contents_.GetRenderViewHost()->GetWidget());
+ // rwhi->ExecuteEditCommand("Unselect", "");
+
+ RenderWidgetHostDelegate* host_delegate =
+ RenderWidgetHostImpl::From(web_contents_.GetRenderViewHost()->GetWidget())
+ ->delegate();
+ if (host_delegate) {
+ host_delegate->ExecuteEditCommand("Unselect", base::nullopt);
+ return true;
+ }
+ return false;
}
void SelectionControllerEfl::SetSelectionMode(enum SelectionMode mode) {
}
void SelectionControllerEfl::HandleGesture(blink::WebGestureEvent& event) {
- if (event.type == blink::WebInputEvent::GestureTap) {
+ blink::WebInputEvent::Type event_type = event.GetType();
+ if (event_type == blink::WebInputEvent::kGestureTap) {
HandlePostponedGesture(event.x, event.y, ui::ET_GESTURE_TAP);
- } else if (event.type == blink::WebInputEvent::GestureShowPress) {
+ } else if (event_type == blink::WebInputEvent::kGestureShowPress) {
HandlePostponedGesture(
event.x, event.y, ui::ET_GESTURE_SHOW_PRESS);
- } else if (event.type == blink::WebInputEvent::GestureLongPress) {
+ } else if (event_type == blink::WebInputEvent::kGestureLongPress) {
HandlePostponedGesture(
event.x, event.y, ui::ET_GESTURE_LONG_PRESS);
long_mouse_press_ = true;
}
- if (event.type == blink::WebInputEvent::GestureScrollBegin ||
- event.type == blink::WebInputEvent::GesturePinchBegin) {
+ if (event_type == blink::WebInputEvent::kGestureScrollBegin ||
+ event_type == blink::WebInputEvent::kGesturePinchBegin) {
SetControlsTemporarilyHidden(true);
- } else if (event.type == blink::WebInputEvent::GestureScrollEnd ||
- event.type == blink::WebInputEvent::GesturePinchEnd) {
+ } else if (event_type == blink::WebInputEvent::kGestureScrollEnd ||
+ event_type == blink::WebInputEvent::kGesturePinchEnd) {
SetControlsTemporarilyHidden(false);
}
}
#include "content/browser/selection/selection_handle_efl.h"
#include "content/browser/selection/selection_magnifier_efl.h"
#include "content/common/content_export.h"
-#include "third_party/WebKit/public/web/WebInputEvent.h"
+#include "third_party/blink/public/platform/web_gesture_event.h"
+#include "third_party/blink/public/platform/web_input_event.h"
#include "ui/events/event_constants.h"
+#include "ui/gfx/geometry/rect.h"
#include "ui/gfx/range/range.h"
#include "ui/gfx/selection_bound.h"
-#include "ui/gfx/geometry/rect.h"
#if defined(OS_TIZEN)
#include "vconf/vconf.h"
#include "content/browser/tracing/tracing_controller_efl.h"
+#include "base/json/json_writer.h"
+#include "base/logging.h"
#include "base/path_service.h"
#include "base/trace_event/trace_event.h"
#include "base/trace_event/trace_event_impl.h"
-#include "base/json/json_writer.h"
-#include "base/logging.h"
#include "content/public/browser/tracing_controller.h"
using namespace content;
#endif
}
-} // namespace
+} // namespace
TracingControllerEfl::TracingControllerEfl()
- : is_tracing_(false), weak_factory_(this) {
-}
+ : is_tracing_(false), weak_factory_(this) {}
TracingControllerEfl& TracingControllerEfl::GetTraceController() {
static TracingControllerEfl tracing_controller_efl;
base::FilePath file_path(trace_file_name_);
if (!TracingController::GetInstance()->StopTracing(
- TracingController::CreateFileSink(
+ ::TracingController::CreateFileEndpoint(
file_path, base::Bind(&TracingControllerEfl::OnTracingStopped,
weak_factory_.GetWeakPtr())))) {
LOG(ERROR) << "Traces: Recording failed.";
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Ugly but effective hack to access WebContentsImpl internals.
-#define private protected
-#include "content/browser/web_contents/web_contents_impl.h"
-#undef private
-
#include "content/browser/web_contents/web_contents_impl_efl.h"
+#include "base/metrics/user_metrics.h"
#include "base/strings/utf_string_conversions.h"
-#include "content/public/common/content_client.h"
-#include "content/common/view_messages.h"
#include "content/browser/browser_plugin/browser_plugin_guest.h"
#include "content/browser/dom_storage/dom_storage_context_wrapper.h"
#include "content/browser/dom_storage/session_storage_namespace_impl.h"
#include "content/browser/loader/resource_dispatcher_host_impl.h"
#include "content/browser/renderer_host/render_view_host_impl.h"
#include "content/browser/web_contents/web_contents_view.h"
+#include "content/common/view_messages.h"
#include "content/public/browser/browser_context.h"
#include "content/public/browser/browser_plugin_guest_manager.h"
#include "content/public/browser/content_browser_client.h"
#include "content/public/browser/notification_service.h"
#include "content/public/browser/notification_types.h"
#include "content/public/browser/storage_partition.h"
-#include "content/public/browser/user_metrics.h"
#include "content/public/browser/web_contents_delegate.h"
#include "content/public/browser/web_contents_efl_delegate.h"
-#include "content/public/common/browser_plugin_guest_mode.h"
+#include "content/public/common/content_client.h"
#include "content/public/common/result_codes.h"
// Majority of the code in this file was taken directly from
//
// All functions are called in a single sequence.
//
-// In the oposite case, both ShouldCreateWebContentsAsync and WebContentsCreateAsyns
-// return true:
+// In the oposite case, both ShouldCreateWebContentsAsync and
+// WebContentsCreateAsyns return true:
//
// + WebContents::Impl::CreateNewWindow
// ...
WebContentsImplEfl::WebContentsImplEfl(BrowserContext* browser_context,
void* platform_data)
- : WebContentsImpl(browser_context)
- , platform_data_(platform_data) {
-}
+ : WebContentsImpl(browser_context), platform_data_(platform_data) {}
void WebContentsImplEfl::SetEflDelegate(WebContentsEflDelegate* delegate) {
efl_delegate_.reset(delegate);
}
void WebContentsImplEfl::SetUserAgentOverride(const std::string& override) {
- if (GetUserAgentOverride() == override)
- return;
-
- renderer_preferences_.user_agent_override = override;
-
- // Send the new override string to the renderer.
- RenderViewHost* host = GetRenderViewHost();
- if (host)
- host->SyncRendererPrefs();
-
- // In chromium upstream, page is reloaded if a load is currently in progress.
- // In chromium-efl port, the behaviour is different.
-
- FOR_EACH_OBSERVER(WebContentsObserver, observers_,
- UserAgentOverrideSet(override));
+ WebContentsImplEfl::SetUserAgentOverride(override);
}
+#if !defined(EWK_BRINGUP) // FIXME: m67 bringup
+// FIXME: EWK_BRINGUP definition should be removed.
void WebContentsImplEfl::CreateNewWindow(
SiteInstance* source_site_instance,
- int route_id,
- int main_frame_route_id,
- int main_frame_widget_route_id,
- const ViewHostMsg_CreateWindow_Params& params,
+ int32_t route_id,
+ int32_t main_frame_route_id,
+ int32_t main_frame_widget_route_id,
+ const mojom::CreateNewWindowParams& params,
SessionStorageNamespace* session_storage_namespace) {
// We usually create the new window in the same BrowsingInstance (group of
// script-related windows), by passing in the current SiteInstance. However,
int render_process_id = source_site_instance->GetProcess()->GetID();
bool did_match_process = false;
for (FrameTreeNode* node : frame_tree_.Nodes())
- base::Bind(&FindMatchingProcess, render_process_id, &did_match_process, node);
+ base::Bind(&FindMatchingProcess, render_process_id, &did_match_process,
+ node);
if (!did_match_process) {
RenderProcessHost* rph = source_site_instance->GetProcess();
//
// http://crbug.com/142685
const std::string& partition_id =
- GetContentClient()->browser()->
- GetStoragePartitionIdForSite(GetBrowserContext(),
- site_instance->GetSiteURL());
+ GetContentClient()->browser()->GetStoragePartitionIdForSite(
+ GetBrowserContext(), site_instance->GetSiteURL());
StoragePartition* partition = BrowserContext::GetStoragePartition(
GetBrowserContext(), site_instance.get());
DOMStorageContextWrapper* dom_storage_context =
// Added for EFL implementation
scoped_refptr<SessionStorageNamespace> ssn = session_storage_namespace;
base::Callback<void(bool)> callback = base::Bind(
- &WebContentsImplEfl::HandleNewWindowRequest,
- base::Unretained(this), render_process_id, route_id,
- main_frame_route_id, params, ssn);
+ &WebContentsImplEfl::HandleNewWindowRequest, base::Unretained(this),
+ render_process_id, route_id, main_frame_route_id, params, ssn);
if (efl_delegate_ &&
efl_delegate_->ShouldCreateWebContentsAsync(callback, params.target_url))
return;
// End of EFL port specific code.
if (delegate_ &&
- !delegate_->ShouldCreateWebContents(this,
- route_id,
- main_frame_route_id,
- main_frame_widget_route_id,
- params.window_container_type,
- params.frame_name,
- params.target_url,
- partition_id,
- session_storage_namespace)) {
+ !delegate_->ShouldCreateWebContents(
+ this, route_id, main_frame_route_id, main_frame_widget_route_id,
+ params.window_container_type, params.frame_name, params.target_url,
+ partition_id, session_storage_namespace)) {
CancelWindowRequest(render_process_id, route_id, main_frame_route_id);
return;
}
// contents of HandleNewWebContentsCreate would come here.
callback.Run(true);
}
+#endif // !defined(EWK_BRINGUP)
+
+void WebContentsImplEfl::CancelWindowRequest(int32_t render_process_id,
+ int32_t route_id,
+ int32_t main_frame_route_id) {
+ if (route_id != MSG_ROUTING_NONE) {
+ RenderViewHost* rvh = RenderViewHost::FromID(render_process_id, route_id);
-void WebContentsImplEfl::CancelWindowRequest(
- int render_process_id,
- int route_id,
- int main_frame_route_id) {
- if (route_id != MSG_ROUTING_NONE &&
- !RenderViewHost::FromID(render_process_id, route_id)) {
// If the embedder didn't create a WebContents for this route, we need to
// delete the RenderView that had already been created.
- Send(new ViewMsg_Close(route_id));
+ if (rvh)
+ rvh->Send(new ViewMsg_Close(route_id));
}
- ResourceDispatcherHostImpl::ResumeBlockedRequestsForRouteFromUI(
+
+ if (ResourceDispatcherHostImpl::Get()) {
+ ResourceDispatcherHostImpl::Get()->ResumeBlockedRequestsForRoute(
GlobalFrameRoutingId(render_process_id, route_id));
- ResourceDispatcherHostImpl::ResumeBlockedRequestsForRouteFromUI(
+ ResourceDispatcherHostImpl::Get()->ResumeBlockedRequestsForRoute(
GlobalFrameRoutingId(render_process_id, main_frame_route_id));
+ }
}
+#if !defined(EWK_BRINGUP) // FIXME: m67 bringup
+// FIXME: EWK_BRINGUP definition should be removed.
// This function does not exist in WebContentsImpl. The decision regarding
// new WebContents request is always made synchronously.
void WebContentsImplEfl::HandleNewWindowRequest(
- int render_process_id,
- int route_id,
- int main_frame_route_id,
- const ViewHostMsg_CreateWindow_Params& params,
+ int32_t render_process_id,
+ int32_t route_id,
+ int32_t main_frame_route_id,
+ const mojom::CreateNewWindowParams& params,
scoped_refptr<SessionStorageNamespace> session_storage_namespace,
bool create) {
if (create) {
scoped_refptr<SessionStorageNamespace> ssn = session_storage_namespace;
WebContentsEflDelegate::WebContentsCreateCallback callback = base::Bind(
- &WebContentsImplEfl::HandleNewWebContentsCreate,
- base::Unretained(this), render_process_id, route_id,
- main_frame_route_id, params, ssn);
+ &WebContentsImplEfl::HandleNewWebContentsCreate, base::Unretained(this),
+ render_process_id, route_id, main_frame_route_id, params, ssn);
if (efl_delegate_ && efl_delegate_->WebContentsCreateAsync(callback))
return;
}
WebContents* WebContentsImplEfl::HandleNewWebContentsCreate(
- int render_process_id,
- int route_id,
- int main_frame_route_id,
- const ViewHostMsg_CreateWindow_Params& params,
+ int32_t render_process_id,
+ int32_t route_id,
+ int32_t main_frame_route_id,
+ const mojom::CreateNewWindowParams& params,
scoped_refptr<SessionStorageNamespace> session_storage_namespace,
void* platform_data) {
bool is_guest = BrowserPluginGuest::IsGuest(this);
: GetSiteInstance();
const std::string& partition_id =
- GetContentClient()->browser()->
- GetStoragePartitionIdForSite(GetBrowserContext(),
- site_instance->GetSiteURL());
+ GetContentClient()->browser()->GetStoragePartitionIdForSite(
+ GetBrowserContext(), site_instance->GetSiteURL());
// Create the new web contents. This will automatically create the new
// WebContentsView. In the future, we may want to create the view separately.
create_params.context = view_->GetNativeView();
create_params.initial_size = GetContainerBounds().size();
// Added for EFL port
- new_contents = new WebContentsImplEfl(
- create_params.browser_context, platform_data);
+ new_contents =
+ new WebContentsImplEfl(create_params.browser_context, platform_data);
FrameTreeNode* opener = nullptr;
if (create_params.opener_render_frame_id != MSG_ROUTING_NONE) {
- RenderFrameHostImpl* opener_rfh = RenderFrameHostImpl::FromID(
- create_params.opener_render_process_id,
- create_params.opener_render_frame_id);
+ RenderFrameHostImpl* opener_rfh =
+ RenderFrameHostImpl::FromID(create_params.opener_render_process_id,
+ create_params.opener_render_frame_id);
if (opener_rfh)
opener = opener_rfh->frame_tree_node();
}
}
new_contents->Init(create_params);
// End of EFL port specific code.
- } else {
+ } else {
// TODO(t.czekala): WebContents and BrowserPluginGuest are integrated and
// it should be checked if we can create WebContentsImplEfl in this scenario
NOTREACHED();
// Added for EFL port
new_contents->platform_data_ = platform_data;
if (efl_delegate_)
- efl_delegate_->SetUpSmartObject(platform_data, new_contents->GetNativeView());
+ efl_delegate_->SetUpSmartObject(platform_data,
+ new_contents->GetNativeView());
// End of EFL port specific code.
// If the new frame has a name, make sure any SiteInstances that can find
// Save the created window associated with the route so we can show it
// later.
DCHECK_NE(MSG_ROUTING_NONE, route_id);
- pending_contents_[std::make_pair(render_process_id, route_id)] = new_contents;
+ pending_contents_[std::make_pair(render_process_id, route_id)] =
+ new_contents;
AddDestructionObserver(new_contents);
}
if (delegate_) {
- delegate_->WebContentsCreated(
- this, params.opener_render_frame_id, params.frame_name,
- params.target_url, new_contents);
+ delegate_->WebContentsCreated(this, params.opener_render_frame_id,
+ params.frame_name, params.target_url,
+ new_contents);
}
if (params.opener_suppressed) {
bool was_blocked = false;
if (delegate_) {
gfx::Rect initial_rect;
- delegate_->AddNewContents(
- this, new_contents, params.disposition, initial_rect,
- params.user_gesture, &was_blocked);
+ delegate_->AddNewContents(this, new_contents, params.disposition,
+ initial_rect, params.user_gesture,
+ &was_blocked);
}
if (!was_blocked) {
- OpenURLParams open_params(params.target_url,
- Referrer(),
- CURRENT_TAB,
+ OpenURLParams open_params(params.target_url, Referrer(), CURRENT_TAB,
ui::PAGE_TRANSITION_LINK,
true /* is_renderer_initiated */);
open_params.user_gesture = params.user_gesture;
return new_contents;
}
+#endif // !defined(EWK_BRINGUP)
-bool WebContentsImplEfl::UpdateTitleForEntry(NavigationEntryImpl* entry,
+void WebContentsImplEfl::UpdateTitleForEntry(NavigationEntry* entry,
const base::string16& title) {
+#if !defined(EWK_BRINGUP) // FIXME: m67 bringup
+ // FIXME: EWK_BRINGUP definition should be removed.
bool updated = WebContentsImpl::UpdateTitleForEntry(entry, title);
// inform view even if the title didn't change to keep EWK consistency
if (!updated) {
view_->SetPageTitle(final_title);
}
-
- return updated;
+#endif // !defined(EWK_BRINGUP)
}
-}
+} // namespace content
WebContentsImplEfl(BrowserContext* browser_context,
void* platform_data);
+#if !defined(EWK_BRINGUP) // FIXME: m67 bringup
+ // FIXME: EWK_BRINGUP definition should be removed.
void CreateNewWindow(
SiteInstance* source_site_instance,
- int route_id,
- int main_frame_route_id,
+ int32_t route_id,
+ int32_t main_frame_route_id,
int32_t main_frame_widget_route_id,
- const ViewHostMsg_CreateWindow_Params& params,
+ const mojom::CreateNewWindowParams& params,
SessionStorageNamespace* session_storage_namespace) override;
+#endif // !defined(EWK_BRINGUP)
void* GetPlatformData() const { return platform_data_; };
friend class WebContents;
void CancelWindowRequest(
- int render_process_id,
- int route_id,
- int main_frame_route_id);
+ int32_t render_process_id,
+ int32_t route_id,
+ int32_t main_frame_route_id);
+#if !defined(EWK_BRINGUP) // FIXME: m67 bringup
+ // FIXME: EWK_BRINGUP definition should be removed.
void HandleNewWindowRequest(
- int render_process_id,
- int route_id,
- int main_frame_route_id,
- const ViewHostMsg_CreateWindow_Params& params,
+ int32_t render_process_id,
+ int32_t route_id,
+ int32_t main_frame_route_id,
+ const mojom::CreateNewWindowParams& params,
scoped_refptr<SessionStorageNamespace> session_storage_namespace,
bool create);
WebContents* HandleNewWebContentsCreate(
- int render_process_id,
- int route_id,
- int main_frame_route_id,
- const ViewHostMsg_CreateWindow_Params& params,
+ int32_t render_process_id,
+ int32_t route_id,
+ int32_t main_frame_route_id,
+ const mojom::CreateNewWindowParams& params,
scoped_refptr<SessionStorageNamespace> session_storage_namespace,
void* platform_data);
+#endif // !defined(EWK_BRINGUP)
- bool UpdateTitleForEntry(NavigationEntryImpl* entry,
+ void UpdateTitleForEntry(NavigationEntry* entry,
const base::string16& title) override;
void* platform_data_;
#include <Elementary.h>
-#include "base/logging.h"
#include "base/command_line.h"
+#include "base/logging.h"
#include "base/strings/utf_string_conversions.h"
#include "content/browser/renderer_host/render_widget_host_view_efl.h"
#include "content/browser/web_contents/web_contents_impl.h"
#include "content/common/view_messages.h"
#include "content/public/browser/interstitial_page.h"
#include "content/public/browser/render_view_host.h"
-#include "content/public/browser/screen_orientation_dispatcher_host.h"
#include "content/public/browser/web_contents_view_delegate.h"
#include "content/public/browser/web_contents_view_efl_delegate.h"
#include "efl/window_factory.h"
}
WebContentsViewEfl::WebContentsViewEfl(WebContents* contents,
- WebContentsViewDelegate* delegate)
- : delegate_(delegate)
- , native_view_(NULL)
- , drag_dest_delegate_(NULL)
- , orientation_(0)
+ WebContentsViewDelegate* delegate)
+ : delegate_(delegate),
+ native_view_(NULL),
+ drag_dest_delegate_(NULL),
+ orientation_(0)
#if defined(OS_TIZEN_MOBILE)
- , touch_enabled_(true)
+ ,
+ touch_enabled_(true)
#else
- , touch_enabled_(false)
+ ,
+ touch_enabled_(false)
#endif
- , page_scale_factor_(1.0f)
- , web_contents_(contents) {
+ ,
+ page_scale_factor_(1.0f),
+ web_contents_(contents) {
base::CommandLine* cmdline = base::CommandLine::ForCurrentProcess();
if (cmdline->HasSwitch(switches::kTouchEvents)) {
- touch_enabled_ = cmdline->
- GetSwitchValueASCII(switches::kTouchEvents) ==
- switches::kTouchEventsEnabled;
+ touch_enabled_ = cmdline->GetSwitchValueASCII(switches::kTouchEvents) ==
+ switches::kTouchEventsEnabled;
}
}
-WebContentsViewEfl::~WebContentsViewEfl() {
-}
+WebContentsViewEfl::~WebContentsViewEfl() {}
void WebContentsViewEfl::SetEflDelegate(WebContentsViewEflDelegate* delegate) {
efl_delegate_.reset(delegate);
elm_naviframe_content_preserve_on_pop_set(native_view_, EINA_TRUE);
if (!initial_size.IsEmpty())
- evas_object_resize(native_view_,
- initial_size.width(), initial_size.height());
+ evas_object_resize(native_view_, initial_size.width(),
+ initial_size.height());
evas_object_show(native_view_);
GLSharedContextEfl::Initialize(root_window);
}
RenderWidgetHostViewBase* WebContentsViewEfl::CreateViewForWidget(
- RenderWidgetHost* render_widget_host, bool is_guest_view_hack) {
-
+ RenderWidgetHost* render_widget_host,
+ bool is_guest_view_hack) {
RenderWidgetHostViewEfl* view =
new RenderWidgetHostViewEfl(render_widget_host, *web_contents_);
view->InitAsChild(native_view_);
elm_naviframe_item_pop(native_view_);
Evas_Object* content_view = static_cast<Evas_Object*>(view->GetNativeView());
- Elm_Object_Item* item = elm_naviframe_item_push(native_view_,
- NULL, NULL, NULL, content_view, NULL);
+ Elm_Object_Item* item = elm_naviframe_item_push(native_view_, NULL, NULL,
+ NULL, content_view, NULL);
elm_naviframe_item_title_enabled_set(item, EINA_FALSE, EINA_FALSE);
view->SetTouchEventsEnabled(touch_enabled_);
}
RenderWidgetHostViewEfl* view = static_cast<RenderWidgetHostViewEfl*>(
- web_contents_->GetRenderWidgetHostView());
+ web_contents_->GetRenderWidgetHostView());
if (!view)
return;
UpdateDragDest(host);
}
-void WebContentsViewEfl::SetOverscrollControllerEnabled(bool enabled) {
-}
+void WebContentsViewEfl::SetOverscrollControllerEnabled(bool enabled) {}
gfx::NativeView WebContentsViewEfl::GetNativeView() const {
return native_view_;
return rwhv ? rwhv->GetNativeView() : NULL;
}
+void WebContentsViewEfl::GetScreenInfo(ScreenInfo* screen_info) const {
+ NOTIMPLEMENTED();
+}
+
gfx::NativeWindow WebContentsViewEfl::GetTopLevelNativeWindow() const {
NOTIMPLEMENTED();
return 0;
void WebContentsViewEfl::GetContainerBounds(gfx::Rect* out) const {
RenderWidgetHostViewEfl* view = static_cast<RenderWidgetHostViewEfl*>(
- web_contents_->GetRenderWidgetHostView());
+ web_contents_->GetRenderWidgetHostView());
if (view)
*out = view->GetBoundsInRootWindow();
}
}
void WebContentsViewEfl::ShowContextMenu(RenderFrameHost* render_frame_host,
- const ContextMenuParams& params) {
+ const ContextMenuParams& params) {
if (delegate_)
delegate_->ShowContextMenu(render_frame_host, params);
}
efl_delegate_->QuerySelectionStyle();
}
-void WebContentsViewEfl::ShowPopupMenu(
- RenderFrameHost* render_frame_host,
- const gfx::Rect& bounds,
- int item_height,
- double item_font_size,
- int selected_item,
- const std::vector<MenuItem>& items,
- bool right_aligned,
- bool allow_multiple_selection) {
+void WebContentsViewEfl::ShowPopupMenu(RenderFrameHost* render_frame_host,
+ const gfx::Rect& bounds,
+ int item_height,
+ double item_font_size,
+ int selected_item,
+ const std::vector<MenuItem>& items,
+ bool right_aligned,
+ bool allow_multiple_selection) {
if (efl_delegate_)
- efl_delegate_->ShowPopupMenu(render_frame_host, bounds,
- item_height, item_font_size, selected_item, items,
- right_aligned, allow_multiple_selection);
+ efl_delegate_->ShowPopupMenu(render_frame_host, bounds, item_height,
+ item_font_size, selected_item, items,
+ right_aligned, allow_multiple_selection);
}
void WebContentsViewEfl::HidePopupMenu() {
efl_delegate_->HidePopupMenu();
}
-void WebContentsViewEfl::StartDragging(
- const DropData& drop_data,
- blink::WebDragOperationsMask allowed_ops,
- const gfx::ImageSkia& image,
- const gfx::Vector2d& image_offset,
- const DragEventSourceInfo& event_info) {
+void WebContentsViewEfl::StartDragging(const DropData& drop_data,
+ blink::WebDragOperationsMask allowed_ops,
+ const gfx::ImageSkia& image,
+ const gfx::Vector2d& image_offset,
+ const DragEventSourceInfo& event_info,
+ RenderWidgetHostImpl* source_rwh) {
if (drag_dest_.get()) {
drag_dest_->SetDropData(drop_data);
drag_dest_->SetAction(allowed_ops);
drag_source_->SetPageScaleFactor(page_scale_factor_);
}
+#if !defined(EWK_BRINGUP) // FIXME: m67 bringup
if (!drag_source_->StartDragging(drop_data, allowed_ops,
- event_info.event_location, *image.bitmap(), image_offset)) {
+ event_info.event_location, *image.bitmap(),
+ image_offset)) {
web_contents_->SystemDragEnded();
}
+#endif // !defined(EWK_BRINGUP)
}
bool WebContentsViewEfl::IsDragging() const {
void WebContentsViewEfl::SetOrientation(int orientation) {
RenderWidgetHostViewEfl* rwhv = static_cast<RenderWidgetHostViewEfl*>(
- web_contents_->GetRenderWidgetHostView());
+ web_contents_->GetRenderWidgetHostView());
if (rwhv) {
RenderWidgetHost* rwh = rwhv->GetRenderWidgetHost();
+#if !defined(EWK_BRINGUP) // FIXME: m67 bringup
+ // FIXME: EWK_BRINGUP definition should be removed.
blink::WebScreenInfo screen_info;
rwh->GetWebScreenInfo(&screen_info);
screen_info.orientationAngle = orientation;
+#endif // !defined(EWK_BRINGUP)
gfx::Size new_size, backing_size;
gfx::Rect bounds_px = rwhv->GetViewBoundsInPix();
static_cast<WebContentsImpl&>(*web_contents_);
ResizeParams params;
+#if !defined(EWK_BRINGUP) // FIXME: m67 bringup
+ // FIXME: EWK_BRINGUP definition should be removed.
params.screen_info = screen_info;
+#endif // !defined(EWK_BRINGUP)
params.new_size = new_size;
params.physical_backing_size = backing_size;
- params.is_fullscreen_granted =
- contents_impl.IsFullscreenForCurrentTab();
+ params.is_fullscreen_granted = contents_impl.IsFullscreenForCurrentTab();
rwh->Send(new ViewMsg_Resize(rwh->GetRoutingID(), params));
rwhv->UpdateScreenInfo(rwhv->GetNativeView());
- contents_impl.screen_orientation_dispatcher_host()->OnOrientationChange();
+ contents_impl.OnScreenOrientationChange();
rwhv->UpdateRotationDegrees(orientation);
}
return false;
}
-} // namespace content
+} // namespace content
#include "content/browser/renderer_host/render_view_host_delegate_view.h"
#include "content/browser/web_contents/web_contents_view.h"
#include "content/common/content_export.h"
-#include "third_party/WebKit/public/web/WebInputEvent.h"
+#include "third_party/blink/public/platform/web_gesture_event.h"
+#include "third_party/blink/public/platform/web_input_event.h"
namespace content {
class WebDragDestEfl;
class WebDragSourceEfl;
class WebDragDestDelegate;
+struct ScreenInfo;
class CONTENT_EXPORT WebContentsViewEfl
: public content::WebContentsView
void SetOverscrollControllerEnabled(bool enabled) override;
gfx::NativeView GetNativeView() const override;
gfx::NativeView GetContentNativeView() const override;
+ void GetScreenInfo(ScreenInfo* screen_info) const override;
gfx::NativeWindow GetTopLevelNativeWindow() const override;
void GetContainerBounds(gfx::Rect* out) const override;
void SizeContents(const gfx::Size& size) override;
blink::WebDragOperationsMask allowed_ops,
const gfx::ImageSkia& image,
const gfx::Vector2d& image_offset,
- const DragEventSourceInfo& event_info) override;
+ const DragEventSourceInfo& event_info,
+ RenderWidgetHostImpl* source_rwh) override;
void CancelContextMenu(int request_id);
bool IsDragging() const;
}
void WebDragDestEfl::DragStateLeave() {
+#if !defined(EWK_BRINGUP) // FIXME: m67 bringup
+// FIXME: EWK_BRINGUP definition should be removed.
GetRenderViewHost()->DragTargetDragLeave();
+#endif // !defined(EWK_BRINGUP)
if (delegate_)
delegate_->OnDragLeave();
}
screen_pt.y() / page_scale_factor_);
if (!drag_initialized_) {
+#if !defined(EWK_BRINGUP) // FIXME: m67 bringup
+// FIXME: EWK_BRINGUP definition should be removed.
GetRenderViewHost()->DragTargetDragEnter(
*drop_data_,
client_pt,
screen_pt,
drag_action_,
modifier_flags_);
+#endif // !defined(EWK_BRINGUP)
if (delegate_)
delegate_->OnDragEnter();
drag_initialized_ = true;
}
+#if !defined(EWK_BRINGUP) // FIXME: m67 bringup
+ // FIXME: EWK_BRINGUP definition should be removed.
GetRenderViewHost()->DragTargetDragOver(
client_pt,
screen_pt,
drag_action_,
modifier_flags_);
+#endif // !defined(EWK_BRINGUP)
if (!delegate_)
return;
gfx::Point(last_pointer_pos_.x() / page_scale_factor_,
last_pointer_pos_.y() / page_scale_factor_);
+#if !defined(EWK_BRINGUP) // FIXME: m67 bringup
+ // FIXME: EWK_BRINGUP definition should be removed.
GetRenderViewHost()->FilterDropData(drop_data_.get());
GetRenderViewHost()->DragTargetDrop(
*drop_data_,
client_pt,
last_pointer_pos_,
modifier_flags_);
+#endif // !defined(EWK_BRINGUP)
if (delegate_)
delegate_->OnDrop();
drag_initialized_ = false;
+#if !defined(EWK_BRINGUP) // FIXME: m67 bringup
+ // FIXME: EWK_BRINGUP definition should be removed.
// Invoking via message loop to not mess around with target
// from within one of its callbacks.
base::MessageLoop::current()->PostTask(
FROM_HERE,
base::Bind(&WebDragDestEfl::ResetDragCallbacks, base::Unretained(this)));
+#endif // !defined(EWK_BRINGUP)
return EINA_TRUE;
}
void WebDragDestEfl::DragLeave() {
+#if !defined(EWK_BRINGUP) // FIXME: m67 bringup
+ // FIXME: EWK_BRINGUP definition should be removed.
GetRenderViewHost()->DragTargetDragLeave();
+#endif // !defined(EWK_BRINGUP)
if (delegate_)
delegate_->OnDragLeave();
#include <Elementary.h>
#include "content/public/common/drop_data.h"
-#include "third_party/WebKit/public/platform/WebDragOperation.h"
+#include "third_party/blink/public/platform/web_drag_operation.h"
#include "ui/gfx/geometry/point.h"
namespace content {
#include "content/browser/web_contents/web_drag_source_efl.h"
#include "content/browser/download/drag_download_util.h"
+#include "content/browser/renderer_host/render_widget_host_impl.h"
#include "content/browser/web_contents/web_contents_impl.h"
#include "content/public/common/drop_data.h"
#include "third_party/skia/include/core/SkPixelRef.h"
namespace {
blink::WebDragOperation GetWebOperationFromMask(
- blink::WebDragOperationsMask allowed_ops)
-{
- if (allowed_ops & blink::WebDragOperationCopy)
- return blink::WebDragOperationCopy;
- if (allowed_ops & blink::WebDragOperationLink)
- return blink::WebDragOperationLink;
- if (allowed_ops & blink::WebDragOperationMove)
- return blink::WebDragOperationMove;
- if (allowed_ops & blink::WebDragOperationGeneric)
- return blink::WebDragOperationGeneric;
- if (allowed_ops & blink::WebDragOperationPrivate)
- return blink::WebDragOperationPrivate;
- if (allowed_ops & blink::WebDragOperationDelete)
- return blink::WebDragOperationDelete;
- return blink::WebDragOperationNone;
+ blink::WebDragOperationsMask allowed_ops) {
+ if (allowed_ops & blink::kWebDragOperationCopy)
+ return blink::kWebDragOperationCopy;
+ if (allowed_ops & blink::kWebDragOperationLink)
+ return blink::kWebDragOperationLink;
+ if (allowed_ops & blink::kWebDragOperationMove)
+ return blink::kWebDragOperationMove;
+ if (allowed_ops & blink::kWebDragOperationGeneric)
+ return blink::kWebDragOperationGeneric;
+ if (allowed_ops & blink::kWebDragOperationPrivate)
+ return blink::kWebDragOperationPrivate;
+ if (allowed_ops & blink::kWebDragOperationDelete)
+ return blink::kWebDragOperationDelete;
+ return blink::kWebDragOperationNone;
}
-Evas_Object* DragIconCreateCb(void* data, Evas_Object* win,
- Evas_Coord* xoff, Evas_Coord* yoff) {
+Evas_Object* DragIconCreateCb(void* data,
+ Evas_Object* win,
+ Evas_Coord* xoff,
+ Evas_Coord* yoff) {
WebDragSourceEfl* web_drag_source_efl = static_cast<WebDragSourceEfl*>(data);
return web_drag_source_efl->DragIconCreate(win, xoff, yoff);
}
-void DragPosCb(void* data, Evas_Object* obj, Evas_Coord x, Evas_Coord y,
- Elm_Xdnd_Action action) {
- WebDragSourceEfl *web_drag_source_efl = static_cast<WebDragSourceEfl*>(data);
+void DragPosCb(void* data,
+ Evas_Object* obj,
+ Evas_Coord x,
+ Evas_Coord y,
+ Elm_Xdnd_Action action) {
+ WebDragSourceEfl* web_drag_source_efl = static_cast<WebDragSourceEfl*>(data);
web_drag_source_efl->DragPos(x, y, action);
}
-void DragAcceptCb(void* data, Evas_Object* obj, Eina_Bool doaccept) {
-}
+void DragAcceptCb(void* data, Evas_Object* obj, Eina_Bool doaccept) {}
void DragStateCb(void* data, Evas_Object* obj) {
WebDragSourceEfl* web_drag_source_efl = static_cast<WebDragSourceEfl*>(data);
web_drag_source_efl->DragState();
}
-} // namespace
+} // namespace
WebDragSourceEfl::WebDragSourceEfl(WebContents* web_contents)
: parent_view_(static_cast<Evas_Object*>(web_contents->GetNativeView())),
drag_failed_(false),
drag_started_(false),
page_scale_factor_(1.0f) {
- device_scale_factor_ = display::Screen::GetScreen()->
- GetPrimaryDisplay().device_scale_factor();
+ device_scale_factor_ =
+ display::Screen::GetScreen()->GetPrimaryDisplay().device_scale_factor();
}
-WebDragSourceEfl::~WebDragSourceEfl() {
-}
+WebDragSourceEfl::~WebDragSourceEfl() {}
bool WebDragSourceEfl::StartDragging(const DropData& drop_data,
blink::WebDragOperationsMask allowed_ops,
targets_mask |= ELM_SEL_FORMAT_IMAGE;
if (!drop_data.download_metadata.empty() &&
ParseDownloadMetadata(drop_data.download_metadata,
- &wide_download_mime_type_,
- &download_file_name_,
+ &wide_download_mime_type_, &download_file_name_,
&download_url_))
targets_mask |= ELM_SEL_FORMAT_IMAGE;
if (!drop_data.custom_data.empty())
int action = 0;
- if (allowed_ops & blink::WebDragOperationCopy)
+ if (allowed_ops & blink::kWebDragOperationCopy)
action |= ELM_XDND_ACTION_COPY;
- if (allowed_ops & blink::WebDragOperationLink)
- action |= ELM_XDND_ACTION_LINK ;
- if (allowed_ops & blink::WebDragOperationMove)
+ if (allowed_ops & blink::kWebDragOperationLink)
+ action |= ELM_XDND_ACTION_LINK;
+ if (allowed_ops & blink::kWebDragOperationMove)
action |= ELM_XDND_ACTION_MOVE;
- if(!action)
+ if (!action)
action = ELM_XDND_ACTION_UNKNOWN;
image_ = image;
drag_action_ = allowed_ops;
drag_failed_ = false;
- drag_started_ = elm_drag_start(parent_view_,
- static_cast<Elm_Sel_Format>(targets_mask),
- reinterpret_cast<char*>(drop_data_.get()),
- static_cast<Elm_Xdnd_Action>(action),
- DragIconCreateCb, this,
- DragPosCb, this,
- DragAcceptCb, this,
- DragStateCb, this);
-
- // Sometimes the drag fails to start; |drag_started_| will be false and we won't
- // get a drag-end signal.
+ drag_started_ = elm_drag_start(
+ parent_view_, static_cast<Elm_Sel_Format>(targets_mask),
+ reinterpret_cast<char*>(drop_data_.get()),
+ static_cast<Elm_Xdnd_Action>(action), DragIconCreateCb, this, DragPosCb,
+ this, DragAcceptCb, this, DragStateCb, this);
+
+ // Sometimes the drag fails to start; |drag_started_| will be false and we
+ // won't get a drag-end signal.
if (!drag_started_) {
LOG(WARNING) << "Failed to start drag and drop";
drag_failed_ = true;
return true;
}
-Evas_Object* WebDragSourceEfl::DragIconCreate(
- Evas_Object* win, Evas_Coord* xoff, Evas_Coord* yoff) const {
+Evas_Object* WebDragSourceEfl::DragIconCreate(Evas_Object* win,
+ Evas_Coord* xoff,
+ Evas_Coord* yoff) const {
int w = image_.width(), h = image_.height();
- if (xoff) *xoff = initial_position_.x();
- if (yoff) *yoff = initial_position_.y();
+ if (xoff)
+ *xoff = initial_position_.x();
+ if (yoff)
+ *yoff = initial_position_.y();
Evas* evas = evas_object_evas_get(win);
Evas_Object* icon = evas_object_image_add(evas);
evas_object_image_size_set(icon, w, h);
evas_object_image_alpha_set(icon, EINA_TRUE);
evas_object_image_data_copy_set(icon, image_.pixelRef()->pixels());
- evas_object_size_hint_align_set(icon,
- EVAS_HINT_FILL, EVAS_HINT_FILL);
- evas_object_size_hint_weight_set(icon,
- EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+ evas_object_size_hint_align_set(icon, EVAS_HINT_FILL, EVAS_HINT_FILL);
+ evas_object_size_hint_weight_set(icon, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
evas_object_move(icon, initial_position_.x(), initial_position_.y());
evas_object_image_fill_set(icon, 0, 0, w, h);
evas_object_resize(icon, w, h);
return icon;
}
-void WebDragSourceEfl::DragPos(Evas_Coord x, Evas_Coord y,
- Elm_Xdnd_Action action) {
- gfx::Point screen_pt = gfx::Point(x / device_scale_factor_,
- y / device_scale_factor_);
+void WebDragSourceEfl::DragPos(Evas_Coord x,
+ Evas_Coord y,
+ Elm_Xdnd_Action action) {
+ gfx::Point screen_pt =
+ gfx::Point(x / device_scale_factor_, y / device_scale_factor_);
last_pointer_pos_ = screen_pt;
}
gfx::Point client_pt = gfx::Point(last_pointer_pos_.x() / page_scale_factor_,
last_pointer_pos_.y() / page_scale_factor_);
- web_contents_->DragSourceEndedAt(
- client_pt.x(), client_pt.y(),
- last_pointer_pos_.x(), last_pointer_pos_.y(),
- GetWebOperationFromMask(drag_action_));
+ web_contents_->DragSourceEndedAt(client_pt.x(), client_pt.y(),
+ last_pointer_pos_.x(), last_pointer_pos_.y(),
+ GetWebOperationFromMask(drag_action_),
+ source_rwh_);
- web_contents_->SystemDragEnded();
+ web_contents_->SystemDragEnded(source_rwh_);
drag_started_ = false;
}
#include "base/files/file_path.h"
#include "base/strings/string16.h"
+#include "third_party/blink/public/platform/web_drag_operation.h"
#include "third_party/skia/include/core/SkBitmap.h"
-#include "third_party/WebKit/public/platform/WebDragOperation.h"
#include "ui/gfx/geometry/point.h"
#include "ui/gfx/geometry/vector2d.h"
#include "url/gurl.h"
namespace content {
+class RenderWidgetHostImpl;
class WebContents;
class WebContentsImpl;
bool IsDragging() { return drag_started_; }
// EFL callbacks
- Evas_Object* DragIconCreate(Evas_Object* win, Evas_Coord* xoff, Evas_Coord* yoff) const;
+ Evas_Object* DragIconCreate(Evas_Object* win,
+ Evas_Coord* xoff,
+ Evas_Coord* yoff) const;
void DragPos(Evas_Coord x, Evas_Coord y, Elm_Xdnd_Action action);
void DragState();
// The tab we're manging the drag for.
WebContentsImpl* web_contents_;
+ // Browser side IPC handler.
+ RenderWidgetHostImpl* source_rwh_;
+
// The drop data for the current drag (for drags that originate in the render
// view). Non-NULL iff there is a current drag.
std::unique_ptr<DropData> drop_data_;
#include "ecore_x_wayland_wrapper.h"
#include "base/logging.h"
-#include "third_party/WebKit/public/platform/WebCursorInfo.h"
+#include "third_party/blink/public/platform/web_cursor_info.h"
using namespace blink;
#if defined(USE_WAYLAND)
const char* GetCursorName(int type) {
switch (type) {
- case WebCursorInfo::TypePointer:
+ case WebCursorInfo::kTypePointer:
return "left_ptr";
- case WebCursorInfo::TypeCross:
+ case WebCursorInfo::kTypeCross:
return "left_ptr"; // ECORE_X_CURSOR_CROSS
- case WebCursorInfo::TypeHand:
+ case WebCursorInfo::kTypeHand:
return "hand1";
- case WebCursorInfo::TypeIBeam:
+ case WebCursorInfo::kTypeIBeam:
return "xterm";
- case WebCursorInfo::TypeWait:
+ case WebCursorInfo::kTypeWait:
return "watch";
- case WebCursorInfo::TypeHelp:
+ case WebCursorInfo::kTypeHelp:
return "left_ptr"; // ECORE_X_CURSOR_QUESTION_ARROW
- case WebCursorInfo::TypeEastResize:
+ case WebCursorInfo::kTypeEastResize:
return "right_side";
- case WebCursorInfo::TypeNorthResize:
+ case WebCursorInfo::kTypeNorthResize:
return "top_side";
- case WebCursorInfo::TypeNorthEastResize:
+ case WebCursorInfo::kTypeNorthEastResize:
return "top_right_corner";
- case WebCursorInfo::TypeNorthWestResize:
+ case WebCursorInfo::kTypeNorthWestResize:
return "top_left_corner";
- case WebCursorInfo::TypeSouthResize:
+ case WebCursorInfo::kTypeSouthResize:
return "bottom_side";
- case WebCursorInfo::TypeSouthEastResize:
+ case WebCursorInfo::kTypeSouthEastResize:
return "bottom_right_corner";
- case WebCursorInfo::TypeSouthWestResize:
+ case WebCursorInfo::kTypeSouthWestResize:
return "bottom_left_corner";
- case WebCursorInfo::TypeWestResize:
+ case WebCursorInfo::kTypeWestResize:
return "left_side";
- case WebCursorInfo::TypeNorthSouthResize:
+ case WebCursorInfo::kTypeNorthSouthResize:
return "top_side"; // ECORE_X_CURSOR_SB_V_DOUBLE_ARROW
- case WebCursorInfo::TypeEastWestResize:
+ case WebCursorInfo::kTypeEastWestResize:
return "left_side"; // ECORE_X_CURSOR_SB_H_DOUBLE_ARROW
- case WebCursorInfo::TypeNorthEastSouthWestResize:
+ case WebCursorInfo::kTypeNorthEastSouthWestResize:
return "top_right_corner";
- case WebCursorInfo::TypeNorthWestSouthEastResize:
+ case WebCursorInfo::kTypeNorthWestSouthEastResize:
return "top_left_corner";
- case WebCursorInfo::TypeColumnResize:
+ case WebCursorInfo::kTypeColumnResize:
return "left_side"; // ECORE_X_CURSOR_SB_H_DOUBLE_ARROW
- case WebCursorInfo::TypeRowResize:
+ case WebCursorInfo::kTypeRowResize:
return "top_side"; // ECORE_X_CURSOR_SB_V_DOUBLE_ARROW
- case WebCursorInfo::TypeMiddlePanning:
+ case WebCursorInfo::kTypeMiddlePanning:
return "left_ptr"; // ECORE_X_CURSOR_FLEUR
- case WebCursorInfo::TypeEastPanning:
+ case WebCursorInfo::kTypeEastPanning:
return "right_side"; // ECORE_X_CURSOR_SB_RIGHT_ARROW
- case WebCursorInfo::TypeNorthPanning:
+ case WebCursorInfo::kTypeNorthPanning:
return "top_side"; // ECORE_X_CURSOR_SB_UP_ARROW
- case WebCursorInfo::TypeNorthEastPanning:
+ case WebCursorInfo::kTypeNorthEastPanning:
return "top_right_corner"; // ECORE_X_CURSOR_TOP_RIGHT_CORNER
- case WebCursorInfo::TypeNorthWestPanning:
+ case WebCursorInfo::kTypeNorthWestPanning:
return "top_left_corner"; // ECORE_X_CURSOR_TOP_LEFT_CORNER
- case WebCursorInfo::TypeSouthPanning:
+ case WebCursorInfo::kTypeSouthPanning:
return "bottom_side"; // ECORE_X_CURSOR_SB_DOWN_ARROW
- case WebCursorInfo::TypeSouthEastPanning:
+ case WebCursorInfo::kTypeSouthEastPanning:
return "botton_right_corner"; // ECORE_X_CURSOR_BOTTOM_RIGHT_CORNER
- case WebCursorInfo::TypeSouthWestPanning:
+ case WebCursorInfo::kTypeSouthWestPanning:
return "botton_left_corner"; // ECORE_X_CURSOR_BOTTOM_LEFT_CORNER
- case WebCursorInfo::TypeWestPanning:
+ case WebCursorInfo::kTypeWestPanning:
return "left_side"; //ECORE_X_CURSOR_SB_LEFT_ARROW
- case WebCursorInfo::TypeMove:
+ case WebCursorInfo::kTypeMove:
return "left_ptr"; //ECORE_X_CURSOR_FLEUR
- case WebCursorInfo::TypeVerticalText:
+ case WebCursorInfo::kTypeVerticalText:
return "xterm";
- case WebCursorInfo::TypeCell:
+ case WebCursorInfo::kTypeCell:
return "xterm";
- case WebCursorInfo::TypeContextMenu:
+ case WebCursorInfo::kTypeContextMenu:
return "xterm";
- case WebCursorInfo::TypeAlias:
+ case WebCursorInfo::kTypeAlias:
return "xterm";
- case WebCursorInfo::TypeProgress:
+ case WebCursorInfo::kTypeProgress:
return "watch";
- case WebCursorInfo::TypeNoDrop:
+ case WebCursorInfo::kTypeNoDrop:
return "xterm";
- case WebCursorInfo::TypeCopy:
+ case WebCursorInfo::kTypeCopy:
return "xterm";
- case WebCursorInfo::TypeNone:
+ case WebCursorInfo::kTypeNone:
return "left_ptr";
- case WebCursorInfo::TypeNotAllowed:
+ case WebCursorInfo::kTypeNotAllowed:
return "left_ptr";
- case WebCursorInfo::TypeZoomIn:
+ case WebCursorInfo::kTypeZoomIn:
return "left_ptr";
- case WebCursorInfo::TypeZoomOut:
+ case WebCursorInfo::kTypeZoomOut:
return "left_ptr";
- case WebCursorInfo::TypeGrab:
- case WebCursorInfo::TypeGrabbing:
+ case WebCursorInfo::kTypeGrab:
+ case WebCursorInfo::kTypeGrabbing:
return "grabbing";
- case WebCursorInfo::TypeCustom:
+ case WebCursorInfo::kTypeCustom:
return "left_ptr";
}
NOTREACHED();
#else
int GetCursorType(int type) {
switch (type) {
- case WebCursorInfo::TypePointer:
+ case WebCursorInfo::kTypePointer:
return ECORE_X_CURSOR_ARROW;
- case WebCursorInfo::TypeCross:
+ case WebCursorInfo::kTypeCross:
return ECORE_X_CURSOR_CROSS;
- case WebCursorInfo::TypeHand:
+ case WebCursorInfo::kTypeHand:
return ECORE_X_CURSOR_HAND2;
- case WebCursorInfo::TypeIBeam:
+ case WebCursorInfo::kTypeIBeam:
return ECORE_X_CURSOR_XTERM;
- case WebCursorInfo::TypeWait:
+ case WebCursorInfo::kTypeWait:
return ECORE_X_CURSOR_WATCH;
- case WebCursorInfo::TypeHelp:
+ case WebCursorInfo::kTypeHelp:
return ECORE_X_CURSOR_QUESTION_ARROW;
- case WebCursorInfo::TypeEastResize:
+ case WebCursorInfo::kTypeEastResize:
return ECORE_X_CURSOR_RIGHT_SIDE;
- case WebCursorInfo::TypeNorthResize:
+ case WebCursorInfo::kTypeNorthResize:
return ECORE_X_CURSOR_TOP_SIDE;
- case WebCursorInfo::TypeNorthEastResize:
+ case WebCursorInfo::kTypeNorthEastResize:
return ECORE_X_CURSOR_TOP_RIGHT_CORNER;
- case WebCursorInfo::TypeNorthWestResize:
+ case WebCursorInfo::kTypeNorthWestResize:
return ECORE_X_CURSOR_TOP_LEFT_CORNER;
- case WebCursorInfo::TypeSouthResize:
+ case WebCursorInfo::kTypeSouthResize:
return ECORE_X_CURSOR_BOTTOM_SIDE;
- case WebCursorInfo::TypeSouthEastResize:
+ case WebCursorInfo::kTypeSouthEastResize:
return ECORE_X_CURSOR_BOTTOM_RIGHT_CORNER;
- case WebCursorInfo::TypeSouthWestResize:
+ case WebCursorInfo::kTypeSouthWestResize:
return ECORE_X_CURSOR_BOTTOM_LEFT_CORNER;
- case WebCursorInfo::TypeWestResize:
+ case WebCursorInfo::kTypeWestResize:
return ECORE_X_CURSOR_LEFT_SIDE;
- case WebCursorInfo::TypeNorthSouthResize:
+ case WebCursorInfo::kTypeNorthSouthResize:
return ECORE_X_CURSOR_SB_V_DOUBLE_ARROW;
- case WebCursorInfo::TypeEastWestResize:
+ case WebCursorInfo::kTypeEastWestResize:
return ECORE_X_CURSOR_SB_H_DOUBLE_ARROW;
- case WebCursorInfo::TypeNorthEastSouthWestResize:
- case WebCursorInfo::TypeNorthWestSouthEastResize:
+ case WebCursorInfo::kTypeNorthEastSouthWestResize:
+ case WebCursorInfo::kTypeNorthWestSouthEastResize:
// There isn't really a useful cursor available for these.
return ECORE_X_CURSOR_XTERM;
- case WebCursorInfo::TypeColumnResize:
+ case WebCursorInfo::kTypeColumnResize:
return ECORE_X_CURSOR_SB_H_DOUBLE_ARROW; // TODO(evanm): is this correct?
- case WebCursorInfo::TypeRowResize:
+ case WebCursorInfo::kTypeRowResize:
return ECORE_X_CURSOR_SB_V_DOUBLE_ARROW; // TODO(evanm): is this correct?
- case WebCursorInfo::TypeMiddlePanning:
+ case WebCursorInfo::kTypeMiddlePanning:
return ECORE_X_CURSOR_FLEUR;
- case WebCursorInfo::TypeEastPanning:
+ case WebCursorInfo::kTypeEastPanning:
return ECORE_X_CURSOR_SB_RIGHT_ARROW;
- case WebCursorInfo::TypeNorthPanning:
+ case WebCursorInfo::kTypeNorthPanning:
return ECORE_X_CURSOR_SB_UP_ARROW;
- case WebCursorInfo::TypeNorthEastPanning:
+ case WebCursorInfo::kTypeNorthEastPanning:
return ECORE_X_CURSOR_TOP_RIGHT_CORNER;
- case WebCursorInfo::TypeNorthWestPanning:
+ case WebCursorInfo::kTypeNorthWestPanning:
return ECORE_X_CURSOR_TOP_LEFT_CORNER;
- case WebCursorInfo::TypeSouthPanning:
+ case WebCursorInfo::kTypeSouthPanning:
return ECORE_X_CURSOR_SB_DOWN_ARROW;
- case WebCursorInfo::TypeSouthEastPanning:
+ case WebCursorInfo::kTypeSouthEastPanning:
return ECORE_X_CURSOR_BOTTOM_RIGHT_CORNER;
- case WebCursorInfo::TypeSouthWestPanning:
+ case WebCursorInfo::kTypeSouthWestPanning:
return ECORE_X_CURSOR_BOTTOM_LEFT_CORNER;
- case WebCursorInfo::TypeWestPanning:
+ case WebCursorInfo::kTypeWestPanning:
return ECORE_X_CURSOR_SB_LEFT_ARROW;
- case WebCursorInfo::TypeMove:
+ case WebCursorInfo::kTypeMove:
return ECORE_X_CURSOR_FLEUR;
- case WebCursorInfo::TypeVerticalText:
+ case WebCursorInfo::kTypeVerticalText:
return ECORE_X_CURSOR_XTERM;
- case WebCursorInfo::TypeCell:
+ case WebCursorInfo::kTypeCell:
return ECORE_X_CURSOR_XTERM;
- case WebCursorInfo::TypeContextMenu:
+ case WebCursorInfo::kTypeContextMenu:
return ECORE_X_CURSOR_XTERM;
- case WebCursorInfo::TypeAlias:
+ case WebCursorInfo::kTypeAlias:
return ECORE_X_CURSOR_XTERM;
- case WebCursorInfo::TypeProgress:
+ case WebCursorInfo::kTypeProgress:
return ECORE_X_CURSOR_WATCH;
- case WebCursorInfo::TypeNoDrop:
+ case WebCursorInfo::kTypeNoDrop:
return ECORE_X_CURSOR_XTERM;
- case WebCursorInfo::TypeCopy:
+ case WebCursorInfo::kTypeCopy:
return ECORE_X_CURSOR_XTERM;
- case WebCursorInfo::TypeNone:
+ case WebCursorInfo::kTypeNone:
return ECORE_X_CURSOR_XTERM;
- case WebCursorInfo::TypeNotAllowed:
+ case WebCursorInfo::kTypeNotAllowed:
return ECORE_X_CURSOR_XTERM;
- case WebCursorInfo::TypeZoomIn:
- case WebCursorInfo::TypeZoomOut:
- case WebCursorInfo::TypeGrab:
- case WebCursorInfo::TypeGrabbing:
- case WebCursorInfo::TypeCustom:
+ case WebCursorInfo::kTypeZoomIn:
+ case WebCursorInfo::kTypeZoomOut:
+ case WebCursorInfo::kTypeGrab:
+ case WebCursorInfo::kTypeGrabbing:
+ case WebCursorInfo::kTypeCustom:
return ECORE_X_CURSOR_XTERM; // Need to check the ECORE_X_CURSOR_XTERM
}
NOTREACHED();
#include "media/base/efl/demuxer_stream_player_params_efl.h"
#include "media/base/efl/media_player_manager_efl.h"
#include "media/base/media_keys.h"
-#include "third_party/WebKit/public/platform/WebMediaPlayer.h"
+#include "third_party/blink/public/platform/WebMediaPlayer.h"
#include "ui/gfx/geometry/rect_f.h"
#undef IPC_MESSAGE_EXPORT
#include "build/tizen_version.h"
#if defined(OS_TIZEN)
-#include <app.h>
+#include <appfw/app.h>
#if TIZEN_VERSION_AT_LEAST(3,0,0)
#include <tzplatform_config.h>
#endif
const base::FilePath::CharType kApplicationDataDir[] = FILE_PATH_LITERAL("data");
const base::FilePath::CharType kApplicationCacheDir[] = FILE_PATH_LITERAL("cache");
#endif
+#if !defined(EWK_BRINGUP) // FIXME: m67 bringup
+// FIXME: EWK_BRINGUP definition should be removed.
const base::FilePath::CharType kLocalePath[] = FILE_PATH_LITERAL(LOCALE_DIR);
const base::FilePath::CharType kEdjePath[] = FILE_PATH_LITERAL(EDJE_DIR);
+#endif // !defined(EWK_BRINGUP)
const base::FilePath::CharType kApplicationName[] = FILE_PATH_LITERAL("chromium-efl");
const base::FilePath::CharType kApplicationDataBaseDir[] = FILE_PATH_LITERAL("db");
return true;
#endif
case DIR_LOCALE:
+#if !defined(EWK_BRINGUP) // FIXME: m67 bringup
+ // FIXME: EWK_BRINGUP definition should be removed.
*result = base::FilePath(kLocalePath);
+#endif // !defined(EWK_BRINGUP)
return true;
case EDJE_RESOURCE_DIR:
+#if !defined(EWK_BRINGUP) // FIXME: m67 bringup
+ // FIXME: EWK_BRINGUP definition should be removed.
*result = base::FilePath(kEdjePath);
+#endif // !defined(EWK_BRINGUP)
return true;
case DIR_DOWNLOADS:
*result = GetDirDownloads();
'gpu/in_process_gpu_thread_efl.cc',
'gpu/shared_mailbox_manager.h',
'gpu/shared_mailbox_manager.cc',
+ '//gpu/command_buffer/service/mailbox_manager_impl.h',
+ '//gpu/command_buffer/service/mailbox_manager_impl.cc',
],
'sources/': [
[ 'exclude', 'gpu/in_process_gpu_thread.cc$' ],
"//tizen_src/chromium_impl/content/gpu/in_process_gpu_thread_efl.cc",
"//tizen_src/chromium_impl/content/gpu/shared_mailbox_manager.h",
"//tizen_src/chromium_impl/content/gpu/shared_mailbox_manager.cc",
+ "//gpu/command_buffer/service/mailbox_manager_impl.h",
+ "//gpu/command_buffer/service/mailbox_manager_impl.cc",
]
external_exclude_content_gpu_efl_sources = [ "in_process_gpu_thread.cc" ]
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "content/common/gpu_host_messages.h"
#include "content/gpu/gpu_process.h"
#include "content/gpu/shared_mailbox_manager.h"
-#include "ui/gl/gl_shared_context_efl.h"
+#include "content/public/common/content_client.h"
+#include "content/public/gpu/content_gpu_client.h"
#include "gpu/command_buffer/service/mailbox_manager.h"
+#include "gpu/config/gpu_info_collector.h"
+#include "gpu/ipc/service/gpu_init.h"
#include "ipc/ipc_channel.h"
#include "ipc/ipc_message_macros.h"
+#include "ui/gl/gl_shared_context_efl.h"
#define private public
#include "gpu/ipc/service/gpu_channel_manager.h"
namespace content {
struct GpuChildThreadEfl : public content::GpuChildThread {
- explicit GpuChildThreadEfl(const gpu::GpuPreferences& gpu_preferences,
- const content::InProcessChildThreadParams& params,
- gpu::GpuMemoryBufferFactory* gpu_memory_buffer_factory)
- : GpuChildThread(gpu_preferences,
- params,
- gpu_memory_buffer_factory) {}
-
- bool OnControlMessageReceived(const IPC::Message& msg) override {
- bool handled = true;
- IPC_BEGIN_MESSAGE_MAP(GpuChildThreadEfl, msg)
- IPC_MESSAGE_HANDLER(GpuMsg_Initialize, OnInitialize)
- IPC_MESSAGE_UNHANDLED(handled = false)
- IPC_END_MESSAGE_MAP()
+ explicit GpuChildThreadEfl(
+ const InProcessChildThreadParams& params,
+ std::unique_ptr<gpu::GpuInit> gpu_init)
+ : GpuChildThread(params, std::move(gpu_init)) {}
- if (handled)
- return true;
+ private:
+ bool Send(IPC::Message* msg) override {
+ // The GPU process must never send a synchronous IPC message to the browser
+ // process. This could result in deadlock.
+ DCHECK(!msg->is_sync());
- return GpuChildThread::OnControlMessageReceived(msg);
+ return ChildThreadImpl::Send(msg);
}
- void OnInitialize(const gpu::GpuPreferences& preferences) {
- GpuChildThread::OnInitialize(preferences);
+ // IPC::Listener implementation via ChildThreadImpl:
+ void OnAssociatedInterfaceRequest(
+ const std::string& name,
+ mojo::ScopedInterfaceEndpointHandle handle) override {
+ if (associated_interfaces_.CanBindRequest(name))
+ associated_interfaces_.BindRequest(name, std::move(handle));
+ else
+ ChildThreadImpl::OnAssociatedInterfaceRequest(name, std::move(handle));
+ }
- // Override GpuChannelManager's default shared group and mailbox instances.
- gpu_channel_manager_->share_group_ =
- GLSharedContextEfl::GetShareGroup();
- gpu_channel_manager_->mailbox_manager_ =
- SharedMailboxManager::GetMailboxManager();
- }
};
struct InProcessGpuThreadEfl : public content::InProcessGpuThread {
explicit InProcessGpuThreadEfl(
const content::InProcessChildThreadParams& params,
const gpu::GpuPreferences& gpu_preferences)
- : InProcessGpuThread(params,
- gpu_preferences) {}
+ : InProcessGpuThread(params) {}
void Init() override {
gpu_process_ = new content::GpuProcess(base::ThreadPriority::NORMAL);
+
+ gpu::GPUInfo gpu_info;
+ gpu::CollectContextGraphicsInfo(&gpu_info);
+
+ auto* client = GetContentClient()->gpu();
+ auto gpu_init = std::make_unique<gpu::GpuInit>();
+ gpu_init->InitializeInProcess(base::CommandLine::ForCurrentProcess(),
+ client ? client->GetGPUInfo() : nullptr,
+ client ? client->GetGpuFeatureInfo() : nullptr);
// The process object takes ownership of the thread object, so do not
// save and delete the pointer.
gpu_process_->set_main_thread(new GpuChildThreadEfl(
- gpu_preferences_, params_, gpu_memory_buffer_factory_.get()));
+ params_, std::move(gpu_init)));
}
};
namespace content {
+#if !defined(EWK_BRINGUP) // FIXME: m67 bringup
// static
gpu::gles2::MailboxManager* SharedMailboxManager::GetMailboxManager() {
- static scoped_refptr<gpu::gles2::MailboxManager> mailbox_manager_ =
+ static gpu::gles2::MailboxManager mailbox_manager_ =
new gpu::gles2::MailboxManagerImpl();
- return mailbox_manager_.get();
+ return mailbox_manager_;
}
-
+#endif // !defined(EWK_BRINGUP)
}
}
namespace content {
+#if !defined(EWK_BRINGUP) // FIXME: m67 bringup
struct CONTENT_EXPORT SharedMailboxManager {
static gpu::gles2::MailboxManager* GetMailboxManager();
};
+#endif // !defined(EWK_BRINGUP)
}
#include "content/common/content_export.h"
#include "content/public/common/context_menu_params.h"
#include "content/public/common/menu_item.h"
-#include "third_party/WebKit/public/web/WebInputEvent.h"
-#include "third_party/WebKit/public/platform/modules/screen_orientation/WebScreenOrientationLockType.h"
+#include "third_party/blink/public/platform/web_gesture_event.h"
+#include "third_party/blink/public/platform/web_input_event.h"
+#include "third_party/blink/public/platform/modules/screen_orientation/web_screen_orientation_lock_type.h"
#include "ui/gfx/geometry/rect.h"
namespace content {
#include "media/blink/webmediasource_impl.h"
#include "media/filters/chunk_demuxer.h"
#include "media/filters/decrypting_demuxer_stream.h"
-#include "third_party/WebKit/public/web/WebRuntimeFeatures.h"
+#include "third_party/blink/public/web/WebRuntimeFeatures.h"
namespace content {
#include "media/base/media_keys.h"
#include "media/filters/chunk_demuxer.h"
#include "media/filters/decrypting_demuxer_stream.h"
-#include "third_party/WebKit/public/platform/WebMediaPlayer.h"
+#include "third_party/blink/public/platform/WebMediaPlayer.h"
namespace content {
#include "content/common/media/efl/media_player_messages_enums_efl.h"
#include "content/public/renderer/render_frame_observer.h"
#include "media/base/efl/media_player_efl.h"
-#include "third_party/WebKit/public/platform/WebMediaPlayer.h"
+#include "third_party/blink/public/platform/WebMediaPlayer.h"
#include "url/gurl.h"
#if defined(TIZEN_TBM_SUPPORT)
#include "ui/gfx/gpu_memory_buffer.h"
#include "media/base/video_frame.h"
#include "media/blink/webmediaplayer_util.h"
#include "third_party/libyuv/include/libyuv/planar_functions.h"
-#include "third_party/WebKit/public/platform/WebMediaPlayer.h"
-#include "third_party/WebKit/public/platform/WebMediaPlayerClient.h"
+#include "third_party/blink/public/platform/WebMediaPlayer.h"
+#include "third_party/blink/public/platform/WebMediaPlayerClient.h"
#define BIND_TO_RENDER_LOOP(function) \
(DCHECK(main_loop_->BelongsToCurrentThread()), \
#include "media/blink/video_frame_compositor.h"
#include "media/blink/webmediaplayer_params.h"
#include "media/renderers/skcanvas_video_renderer.h"
-#include "third_party/WebKit/public/platform/WebMediaPlayer.h"
-#include "third_party/WebKit/public/platform/WebMediaPlayerEncryptedMediaClient.h"
+#include "third_party/blink/public/platform/WebMediaPlayer.h"
+#include "third_party/blink/public/platform/WebMediaPlayerEncryptedMediaClient.h"
#if defined(TIZEN_MULTIMEDIA_EME_SUPPORT)
#include "media/blink/encrypted_media_player_support.h"
#include "media/base/efl/webaudio_media_codec_info_efl.h"
#include "media/base/limits.h"
#include "public/platform/Platform.h"
-#include "third_party/WebKit/public/platform/WebAudioBus.h"
+#include "third_party/blink/public/platform/WebAudioBus.h"
namespace content {
#include "content/common/tts_messages_efl.h"
#include "content/common/tts_utterance_request_efl.h"
#include "content/public/renderer/render_thread.h"
-#include "third_party/WebKit/public/platform/WebCString.h"
-#include "third_party/WebKit/public/platform/WebSpeechSynthesisUtterance.h"
-#include "third_party/WebKit/public/platform/WebSpeechSynthesisVoice.h"
-#include "third_party/WebKit/public/platform/WebString.h"
-#include "third_party/WebKit/public/platform/WebVector.h"
+#include "third_party/blink/public/platform/WebCString.h"
+#include "third_party/blink/public/platform/WebSpeechSynthesisUtterance.h"
+#include "third_party/blink/public/platform/WebSpeechSynthesisVoice.h"
+#include "third_party/blink/public/platform/WebString.h"
+#include "third_party/blink/public/platform/WebVector.h"
namespace content {
int TtsDispatcherEfl::next_utterance_id_ = 1;
#include "base/containers/hash_tables.h"
#include "content/common/content_export.h"
#include "content/public/renderer/render_thread_observer.h"
-#include "third_party/WebKit/public/platform/WebSpeechSynthesizer.h"
-#include "third_party/WebKit/public/platform/WebSpeechSynthesizerClient.h"
+#include "third_party/blink/public/platform/WebSpeechSynthesizer.h"
+#include "third_party/blink/public/platform/WebSpeechSynthesizerClient.h"
namespace IPC {
class Message;
class Shell::Impl {
public:
Impl(Shell* shell, Evas_Object* window)
- : url_bar_(NULL)
- , refresh_btn_(NULL)
- , stop_btn_(NULL)
- , back_btn_(NULL)
- , forward_btn_(NULL)
- , shell_(shell) {
-
- Evas_Object *box = elm_box_add(window);
+ : url_bar_(NULL),
+ refresh_btn_(NULL),
+ stop_btn_(NULL),
+ back_btn_(NULL),
+ forward_btn_(NULL),
+ shell_(shell) {
+ Evas_Object* box = elm_box_add(window);
evas_object_size_hint_align_set(box, EVAS_HINT_FILL, EVAS_HINT_FILL);
evas_object_size_hint_weight_set(box, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
elm_win_resize_object_add(window, box);
if (!switches::IsRunLayoutTestSwitchPresent())
CreateURLBar(box);
- Evas_Object* view = static_cast<Evas_Object*>(
- shell->web_contents()->GetNativeView());
+ Evas_Object* view =
+ static_cast<Evas_Object*>(shell->web_contents()->GetNativeView());
evas_object_size_hint_align_set(view, EVAS_HINT_FILL, EVAS_HINT_FILL);
evas_object_size_hint_weight_set(view, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
elm_box_pack_end(box, view);
evas_object_size_hint_weight_set(wrapper, EVAS_HINT_EXPAND, 0.0f);
evas_object_show(wrapper);
- Evas_Object *button_box = elm_box_add(wrapper);
+ Evas_Object* button_box = elm_box_add(wrapper);
elm_box_horizontal_set(button_box, EINA_TRUE);
Evas_Object* new_window_button = AddButton(button_box, "file", OnNewWindow);
elm_entry_single_line_set(url_bar_, EINA_TRUE);
elm_entry_scrollable_set(url_bar_, EINA_TRUE);
evas_object_size_hint_align_set(url_bar_, EVAS_HINT_FILL, EVAS_HINT_FILL);
- evas_object_size_hint_weight_set(url_bar_, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+ evas_object_size_hint_weight_set(url_bar_, EVAS_HINT_EXPAND,
+ EVAS_HINT_EXPAND);
elm_entry_input_panel_layout_set(url_bar_, ELM_INPUT_PANEL_LAYOUT_URL);
evas_object_size_hint_weight_set(url_bar_, EVAS_HINT_EXPAND, 0.0f);
evas_object_size_hint_align_set(url_bar_, EVAS_HINT_FILL, EVAS_HINT_FILL);
}
Evas_Object* AddButton(Evas_Object* parent_box,
- const char* icon_name, Evas_Smart_Cb cb) {
+ const char* icon_name,
+ Evas_Smart_Cb cb) {
Evas_Object* btn = elm_button_add(parent_box);
Evas_Object* icon = elm_icon_add(parent_box);
elm_icon_standard_set(icon, icon_name);
Shell* shell = static_cast<Shell::Impl*>(data)->shell_;
gfx::Size initial_size = Shell::GetShellDefaultSize();
Shell::CreateNewWindow(shell->web_contents()->GetBrowserContext(),
- GURL("https://www.google.com"),
- NULL,
- initial_size);
+ GURL("https://www.google.com"), NULL, initial_size);
}
static void OnForward(void* data, Evas_Object*, void*) {
static_cast<Shell::Impl*>(data)->shell_->Stop();
}
- static void OnURLEntered(void *data, Evas_Object *obj, void*) {
+ static void OnURLEntered(void* data, Evas_Object* obj, void*) {
GURL url(elm_object_text_get(obj));
if (!url.has_scheme()) {
url = GURL(std::string("http://") + elm_object_text_get(obj));
LOG(INFO) << "EFL Shell platform exit";
}
-void Shell::PlatformCleanUp() {
-}
+void Shell::PlatformCleanUp() {}
void Shell::PlatformEnableUIControl(UIControl control, bool is_enabled) {
impl_->ToggleControl(control, is_enabled);
impl_->SetAddressBarURL(url.spec().c_str());
}
-void Shell::PlatformSetIsLoading(bool loading) {
-}
+void Shell::PlatformSetIsLoading(bool loading) {}
-void Shell::PlatformCreateWindow(int width, int height) {
-}
+void Shell::PlatformCreateWindow(int width, int height) {}
void Shell::PlatformSetContents() {
Evas_Object* win = efl::WindowFactory::GetHostWindow(web_contents_.get());
- evas_object_smart_callback_add(win, "delete,request",
- OnShellWindowDelRequest, this);
+ evas_object_smart_callback_add(win, "delete,request", OnShellWindowDelRequest,
+ this);
gfx::Size initial_size = Shell::GetShellDefaultSize();
evas_object_resize(win, initial_size.width(), initial_size.height());
evas_object_show(win);
impl_ = new Impl(this, static_cast<Evas_Object*>(window_));
}
-void Shell::PlatformResizeSubViews() {
-}
+void Shell::PlatformResizeSubViews() {}
void Shell::Close() {
LOG(INFO) << "Closing Content Shell EFL";
}
void Shell::PlatformSetTitle(const base::string16& title) {
- elm_win_title_set(static_cast<Evas_Object*>(window_), UTF16ToUTF8(title).c_str());
-}
-
-bool Shell::PlatformHandleContextMenu(
- const content::ContextMenuParams& params) {
- return false;
+ elm_win_title_set(static_cast<Evas_Object*>(window_),
+ base::UTF16ToUTF8(title).c_str());
}
-JavaScriptDialogManager* Shell::GetJavaScriptDialogManager(WebContents* source) {
+JavaScriptDialogManager* Shell::GetJavaScriptDialogManager(
+ WebContents* source) {
if (!dialog_manager_) {
if (switches::IsRunLayoutTestSwitchPresent()) {
dialog_manager_.reset(new LayoutTestJavaScriptDialogManager);
- } else {
+ } else {
dialog_manager_.reset(new JavaScriptDialogManagerEfl);
}
}
#include "content/shell/browser/shell_content_browser_client.h"
#include "content/shell/browser/shell_devtools_frontend.h"
#include "content/shell/common/shell_switches.h"
-#include "third_party/WebKit/public/web/WebContextMenuData.h"
+#include "third_party/blink/public/web/WebContextMenuData.h"
using blink::WebContextMenuData;
static Evas_Object* g_context_menu = NULL;
void OpenInNewWindow(void* data, Evas_Object*, void*) {
- const ContextMenuParams* params =
- static_cast<const ContextMenuParams*>(data);
+ const ContextMenuParams* params = static_cast<const ContextMenuParams*>(data);
ShellBrowserContext* browser_context =
ShellContentBrowserClient::Get()->browser_context();
- Shell::CreateNewWindow(browser_context,
- params->link_url,
- NULL,
- gfx::Size());
+ Shell::CreateNewWindow(browser_context, params->link_url, NULL, gfx::Size());
}
void StartDragging(void* data, Evas_Object*, void*) {
WebContents* wc = static_cast<WebContents*>(data);
RenderViewHost* rvh = wc->GetRenderViewHost();
-#if !defined(EWK_BRINGUP)
+#if !defined(EWK_BRINGUP) // FIXME: m67 bringup
rvh->StartDragging();
#endif
}
void Reload(void* data, Evas_Object*, void*) {
WebContents* wc = static_cast<WebContents*>(data);
- wc->GetController().Reload(false);
+ wc->GetController().Reload(content::ReloadType::NORMAL, false);
wc->Focus();
}
-
}
WebContentsViewDelegate* CreateShellWebContentsViewDelegate(
ShellWebContentsViewDelegate::ShellWebContentsViewDelegate(
WebContents* web_contents)
- : web_contents_(web_contents) {
-}
+ : web_contents_(web_contents) {}
-ShellWebContentsViewDelegate::~ShellWebContentsViewDelegate() {
-}
+ShellWebContentsViewDelegate::~ShellWebContentsViewDelegate() {}
void ShellWebContentsViewDelegate::ShowContextMenu(
RenderFrameHost* render_frame_host,
Elm_Object_Item* menu_it = NULL;
if (has_link) {
- elm_menu_item_add(menu, NULL, NULL, "Open in new window",
- OpenInNewWindow, ¶ms_);
+ elm_menu_item_add(menu, NULL, NULL, "Open in new window", OpenInNewWindow,
+ ¶ms_);
elm_menu_item_separator_add(menu, NULL);
}
-#if !defined(EWK_BRINGUP)
+#if !defined(EWK_BRINGUP) // FIXME: m67 bringup
if (params.is_draggable) {
- elm_menu_item_add(menu, NULL, NULL, "Start dragging",
- StartDragging, web_contents_);
+ elm_menu_item_add(menu, NULL, NULL, "Start dragging", StartDragging,
+ web_contents_);
}
#endif
if (params_.is_editable) {
- menu_it = elm_menu_item_add(menu, NULL, NULL, "Cut",
- Cut, web_contents_);
- elm_object_item_disabled_set(menu_it,
- (params_.edit_flags & WebContextMenuData::CanCut) == 0);
- menu_it = elm_menu_item_add(menu, NULL, NULL, "Copy",
- Copy, web_contents_);
- elm_object_item_disabled_set(menu_it,
- (params_.edit_flags & WebContextMenuData::CanCopy) == 0);
- menu_it = elm_menu_item_add(menu, NULL, NULL, "Paste",
- Paste, web_contents_);
- elm_object_item_disabled_set(menu_it,
- (params_.edit_flags & WebContextMenuData::CanPaste) == 0);
- menu_it = elm_menu_item_add(menu, NULL, "delete", "Delete",
- Delete, web_contents_);
- elm_object_item_disabled_set(menu_it,
- (params_.edit_flags & WebContextMenuData::CanDelete) == 0);
+ menu_it = elm_menu_item_add(menu, NULL, NULL, "Cut", Cut, web_contents_);
+ elm_object_item_disabled_set(
+ menu_it, (params_.edit_flags & WebContextMenuData::kCanCut) == 0);
+ menu_it = elm_menu_item_add(menu, NULL, NULL, "Copy", Copy, web_contents_);
+ elm_object_item_disabled_set(
+ menu_it, (params_.edit_flags & WebContextMenuData::kCanCopy) == 0);
+ menu_it =
+ elm_menu_item_add(menu, NULL, NULL, "Paste", Paste, web_contents_);
+ elm_object_item_disabled_set(
+ menu_it, (params_.edit_flags & WebContextMenuData::kCanPaste) == 0);
+ menu_it = elm_menu_item_add(menu, NULL, "delete", "Delete", Delete,
+ web_contents_);
+ elm_object_item_disabled_set(
+ menu_it, (params_.edit_flags & WebContextMenuData::kCanDelete) == 0);
elm_menu_item_separator_add(menu, NULL);
}
- menu_it = elm_menu_item_add(menu, NULL, "back", "Back",
- Back, web_contents_);
+ menu_it = elm_menu_item_add(menu, NULL, "back", "Back", Back, web_contents_);
elm_object_item_disabled_set(menu_it,
- !web_contents_->GetController().CanGoBack());
- menu_it = elm_menu_item_add(menu, NULL, "forward", "Forward",
- Forward, web_contents_);
+ !web_contents_->GetController().CanGoBack());
+ menu_it = elm_menu_item_add(menu, NULL, "forward", "Forward", Forward,
+ web_contents_);
elm_object_item_disabled_set(menu_it,
- !web_contents_->GetController().CanGoForward());
- elm_menu_item_add(menu, NULL, "reload", "Reload",
- Reload, web_contents_);
+ !web_contents_->GetController().CanGoForward());
+ elm_menu_item_add(menu, NULL, "reload", "Reload", Reload, web_contents_);
g_context_menu = menu;
elm_menu_move(menu, params.x, params.y);
#include "device/battery/battery_status_manager_tizen.h"
-#include <vconf/vconf.h>
+#include <device/battery.h>
#include <system/device.h>
+#include <vconf/vconf.h>
namespace device {
}
bool BatteryStatusManagerTizen::StartListeningBatteryChange() {
+#if !defined(EWK_BRINGUP) // FIXME: m67 bringup
if (vconf_notify_key_changed(
VCONFKEY_SYSMAN_BATTERY_CHARGE_NOW, OnChargingStatusChanged, this) ||
device_battery_set_cb(OnLevelChanged, this) != DEVICE_ERROR_NONE ||
StopListeningBatteryChange();
return false;
}
+#endif
int charging = 0;
if (vconf_get_int(VCONFKEY_SYSMAN_BATTERY_CHARGE_NOW, &charging) < 0)
UnsetRemainingTimeUntilDischargedCb();
vconf_ignore_key_changed(VCONFKEY_SYSMAN_BATTERY_CHARGE_NOW,
OnChargingStatusChanged);
+#if !defined(EWK_BRINGUP) // FIXME: m67 bringup
device_battery_unset_cb();
+#endif
}
} // namespace device
namespace device {
+VibrationManagerImplEfl::VibrationManagerImplEfl() {
+}
+
+VibrationManagerImplEfl::~VibrationManagerImplEfl() {
+}
+
std::unique_ptr<VibrationProviderClient> VibrationManagerImplEfl::provider_client_ = std::unique_ptr<VibrationProviderClient>();
void VibrationManagerImplEfl::Vibrate(int64_t milliseconds, const VibrateCallback& callback) {
// static
void VibrationManagerImpl::Create(
mojo::InterfaceRequest<VibrationManager> request) {
- new VibrationManagerImplEfl(std::move(request));
+ new VibrationManagerImplEfl();
}
} // namespace device
#ifndef VIBRATION_MANAGER_IMPL_EFL_H
#define VIBRATION_MANAGER_IMPL_EFL_H
-#include "device/vibration/vibration_manager_impl.h"
+#include "services/device/vibration/vibration_manager_impl.h"
-#include "device/vibration/vibration_export.h"
-#include "device/vibration/vibration_provider_client.h"
+#include "services/device/vibration/vibration_export.h"
+#include "services/device/vibration/vibration_provider_client.h"
#include "mojo/public/cpp/bindings/strong_binding.h"
namespace device {
class DEVICE_VIBRATION_EXPORT VibrationManagerImplEfl : public VibrationManager {
public:
- explicit VibrationManagerImplEfl(
- mojo::InterfaceRequest<VibrationManager> request)
- : binding_(this, std::move(request)) {}
+ VibrationManagerImplEfl();
~VibrationManagerImplEfl() override {}
void Vibrate(int64_t milliseconds, const VibrateCallback& callback) override;
static void RegisterProviderClient(VibrationProviderClient* provider_client);
private:
- friend VibrationManagerImpl;
-
- // The binding between this object and the other end of the pipe.
- mojo::StrongBinding<VibrationManager> binding_;
static std::unique_ptr<VibrationProviderClient> provider_client_;
};
#include "efl/init.h"
+#include <Ecore.h>
#include <Elementary.h>
#include "ecore_x_wayland_wrapper.h"
-#include <Ecore.h>
#include "base/logging.h"
#include "base/message_loop/message_loop.h"
#include "cc/base/switches.h"
#include "content/common/paths_efl.h"
#include "content/public/common/content_switches.h"
+#include "gpu/config/gpu_switches.h"
#include "ui/compositor/compositor_switches.h"
#include "ui/display/screen_efl.h"
#include "ui/gfx/switches.h"
std::unique_ptr<base::MessagePump> MessagePumpFactory() {
return std::unique_ptr<base::MessagePump>(new base::MessagePumpEcore);
}
-} // namespace
+} // namespace
int Initialize(int argc, const char* argv[]) {
base::CommandLine::Init(argc, argv);
const base::CommandLine& cmd_line = *base::CommandLine::ForCurrentProcess();
std::string process_type =
- cmd_line.GetSwitchValueASCII(switches::kProcessType);
+ cmd_line.GetSwitchValueASCII(switches::kProcessType);
if (process_type != "zygote") {
elm_init(argc, (char**)argv);
ui::InstallScreenInstance();
#if defined(USE_OZONE)
- ui::OzonePlatform::InitializeForUI();
+ ui::OzonePlatform::InitParams params;
+
+ // TODO: If required fetch from command-line argument.
+ params.single_process = false;
+ // params.using_mojo = true;
+ ui::OzonePlatform::InitializeForUI(params);
#endif
PathsEfl::Register();
}
void AppendPortParams(base::CommandLine& cmdline) {
- cmdline.AppendSwitchASCII(switches::kUseGL,
- gl::kGLImplementationEGLName);
+ cmdline.AppendSwitchASCII(switches::kUseGL, gl::kGLImplementationEGLName);
cmdline.AppendSwitch(switches::kInProcessGPU);
-#if !defined(EWK_BRINGUP)
+#if !defined(EWK_BRINGUP) // FIXME: m67 bringup
// [M44_2403] Temporary disabling the codes for switching to new chromium
// FIXME: http://web.sec.samsung.net/bugzilla/show_bug.cgi?id=14040
#if defined(OS_TIZEN)
// Select ETC1 compression method
if (!cmdline.HasSwitch(cc::switches::kDisableTileCompression) &&
- cmdline.HasSwitch(cc::switches::kEnableTileCompression))
+ cmdline.HasSwitch(cc::switches::kEnableTileCompression))
cmdline.AppendSwitch(switches::kDisableGpuRasterization);
#endif
-#endif // EWK_BRINGUP
+#endif // EWK_BRINGUP
#if !defined(OS_TIZEN)
cmdline.AppendSwitch(switches::kIgnoreGpuBlacklist);
#if defined(OS_TIZEN_TV)
cmdline.AppendSwitchASCII(switches::kAcceleratedCanvas2dMSAASampleCount, "4");
#endif
-
}
-} // namespace efl
+} // namespace efl
CollectInfoResult CollectBasicGraphicsInfo(GPUInfo* gpu_info) {
DCHECK(gpu_info);
- gpu_info->can_lose_context = false;
// Create a short-lived context on the UI thread to collect the GL strings.
// Make sure we restore the existing context if there is one.
]
if (!is_tizen) {
- external_exclude_gpu_efl_sources += [
- "gpu_info_collector_linux.cc",
- ]
+ external_exclude_gpu_efl_sources += [ "gpu_info_collector_linux.cc" ]
}
external_gpu_efl_sources = [
"//tizen_src/chromium_impl/gpu/config/gpu_driver_bug_list_json_efl.cc",
"//tizen_src/chromium_impl/gpu/config/gpu_info_collector_efl.cc",
- "//tizen_src/chromium_impl/gpu/config/software_rendering_list_json_efl.cc",
"//tizen_src/chromium_impl/gpu/config/scoped_restore_non_owned_egl_context.cc",
- "//tizen_src/chromium_impl/gpu/config/scoped_restore_non_owned_egl_context.h"
+ "//tizen_src/chromium_impl/gpu/config/scoped_restore_non_owned_egl_context.h",
+ "//tizen_src/chromium_impl/gpu/config/scoped_restore_non_owned_evasgl_context.cc",
+ "//tizen_src/chromium_impl/gpu/config/scoped_restore_non_owned_evasgl_context.h",
]
#include "base/memory/shared_memory.h"
#include "media/base/efl/media_player_efl.h"
-#include "third_party/WebKit/public/platform/WebMediaPlayer.h"
+#include "third_party/blink/public/platform/WebMediaPlayer.h"
#if defined(TIZEN_TBM_SUPPORT)
#include "ui/gfx/gpu_memory_buffer.h"
#include "media/base/efl/media_player_efl.h"
#include "media/base/efl/media_player_util_efl.h"
#include "media/base/decoder_buffer.h"
-#include "third_party/WebKit/public/platform/WebMediaPlayer.h"
+#include "third_party/blink/public/platform/WebMediaPlayer.h"
namespace media {
#include "RenderThemeChromiumTizen.h"
+#if !defined(EWK_BRINGUP) // FIXME: m67 bringup
+// FIXME: EWK_BRINGUP definition should be removed.
#include "TizenUserAgentStyleSheets.h"
+#endif // !defined(EWK_BRINGUP)
namespace blink {
-PassRefPtr<LayoutTheme> RenderThemeChromiumTizen::create()
-{
- return adoptRef(new RenderThemeChromiumTizen());
+RefPtr<LayoutTheme> RenderThemeChromiumTizen::create() {
+ return new RenderThemeChromiumTizen();
}
-LayoutTheme& LayoutTheme::nativeTheme()
-{
- DEFINE_STATIC_REF(LayoutTheme, renderTheme, (RenderThemeChromiumTizen::create()));
- return *renderTheme;
+#if !defined(EWK_BRINGUP) // FIXME: m67 bringup
+// FIXME: EWK_BRINGUP definition should be removed.
+LayoutTheme& LayoutTheme::nativeTheme() {
+ DEFINE_STATIC_REF(LayoutTheme, renderTheme,
+ (RenderThemeChromiumTizen::create()));
+ return *renderTheme;
}
+#endif // !defined(EWK_BRINGUP)
-RenderThemeChromiumTizen::~RenderThemeChromiumTizen()
-{
-}
+RenderThemeChromiumTizen::~RenderThemeChromiumTizen() {}
-String RenderThemeChromiumTizen::extraDefaultStyleSheet()
-{
- return LayoutThemeDefault::extraDefaultStyleSheet() +
- String(themeChromiumTizenCss, sizeof(themeChromiumTizenCss));
+String RenderThemeChromiumTizen::ExtraDefaultStyleSheet() {
+#if !defined(EWK_BRINGUP) // FIXME: m67 bringup
+ // FIXME: EWK_BRINGUP definition should be removed.
+ return LayoutThemeDefault::extraDefaultStyleSheet() +
+ String(themeChromiumTizenCss, sizeof(themeChromiumTizenCss))
+#endif // !defined(EWK_BRINGUP)
}
-} // namespace blink
+} // namespace blink
namespace blink {
class RenderThemeChromiumTizen final : public LayoutThemeDefault {
-public:
- static PassRefPtr<LayoutTheme> create();
- String extraDefaultStyleSheet() override;
-
- bool delegatesMenuListRendering() const override { return true; }
-
- Color platformTapHighlightColor() const override {
- return RenderThemeChromiumTizen::defaultTapHighlightColor;
- }
-private:
- ~RenderThemeChromiumTizen() override;
- static const RGBA32 defaultTapHighlightColor = 0x2eee6e1a; // light orange.
+ public:
+ static RefPtr<LayoutTheme> create();
+ String ExtraDefaultStyleSheet() override;
+
+ bool DelegatesMenuListRendering() const override { return true; }
+
+ Color PlatformTapHighlightColor() const override {
+ return RenderThemeChromiumTizen::defaultTapHighlightColor;
+ }
+
+ private:
+ ~RenderThemeChromiumTizen() override;
+ static const RGBA32 defaultTapHighlightColor = 0x2eee6e1a; // light orange.
};
-} // namespace blink
+} // namespace blink
-#endif // RenderThemeChromiumTizen_h
+#endif // RenderThemeChromiumTizen_h
"//ui/events/gestures/motion_event_aura.cc",
"//ui/events/gestures/motion_event_aura.h",
]
+ include_dirs = [
+ "//third_party/skia/include/android",
+ "//third_party/skia/include/c",
+ "//third_party/skia/include/codec",
+ "//third_party/skia/include/config",
+ "//third_party/skia/include/core",
+ "//third_party/skia/include/effects",
+ "//third_party/skia/include/encode",
+ "//third_party/skia/include/gpu",
+ "//third_party/skia/include/gpu/gl",
+ "//third_party/skia/include/atlastext",
+ "//third_party/skia/include/pathops",
+ "//third_party/skia/include/ports",
+ "//third_party/skia/include/svg",
+ "//third_party/skia/include/utils",
+ "//third_party/skia/include/utils/mac",
+ ]
}
static_library("ui_native_theme_inject") {
}
}
+void ClipboardEfl::OnPreShutdown() {}
+
uint64_t ClipboardEfl::GetSequenceNumber(ClipboardType /* type */) const {
DCHECK(CalledOnValidThread());
// TODO: implement this. For now this interface will advertise
~ClipboardEfl() override;
// Clipboard overrides:
+ void OnPreShutdown() override;
+
uint64_t GetSequenceNumber(ClipboardType type) const override;
bool IsFormatAvailable(const FormatType& format,
ClipboardType type) const override;
static std::map<std::string, std::string> s_clipboard;
#endif
-enum ClipType
-{
+enum ClipType {
CLIP_TYPE_PRIMARY,
CLIP_TYPE_SECONDARY,
CLIP_TYPE_CLIPBOARD,
CLIP_TYPE_MAX,
};
-struct ClipData
-{
- // TODO: Webview and Rendering TG will implement following for Wayland.
+struct ClipData {
+// TODO: Webview and Rendering TG will implement following for Wayland.
#if !defined(WAYLAND_BRINGUP)
Ecore_X_Selection selection;
- void (* request)(Ecore_X_Window window, const char* pTarget);
+ void (*request)(Ecore_X_Window window, const char* pTarget);
#endif
Elm_Sel_Format format;
// TODO: Webview and Rendering TG will implement following for Wayland.
#if !defined(WAYLAND_BRINGUP)
-typedef int (*ClipNotifyHandler)(ClipData* clipData, Ecore_X_Event_Selection_Notify* notifyData);
+typedef int (*ClipNotifyHandler)(ClipData* clipData,
+ Ecore_X_Event_Selection_Notify* notifyData);
#endif
-enum
-{
+enum {
ATOM_TARGETS = 0,
ATOM_ATOM,
ATOM_LISTING_ATOMS = ATOM_ATOM,
ATOM_MAX,
};
-struct AtomData
-{
+struct AtomData {
const char* pName;
Elm_Sel_Format formats;
- // TODO: Webview and Rendering TG will implement following for Wayland.
+// TODO: Webview and Rendering TG will implement following for Wayland.
#if !defined(WAYLAND_BRINGUP)
ClipNotifyHandler notify;
Ecore_X_Atom atom;
ClipData clipList[CLIP_TYPE_MAX];
Eina_Bool propertyChangeCallback(void* data, int type, void* event) {
- ClipboardHelperEfl *clipboardHelper = static_cast<ClipboardHelperEfl*>(data);
- // TODO: Webview and Rendering TG will implement following for Wayland.
+ ClipboardHelperEfl* clipboardHelper = static_cast<ClipboardHelperEfl*>(data);
+// TODO: Webview and Rendering TG will implement following for Wayland.
#if !defined(WAYLAND_BRINGUP)
- Ecore_X_Event_Window_Property *ev = (Ecore_X_Event_Window_Property*) event;
+ Ecore_X_Event_Window_Property* ev = (Ecore_X_Event_Window_Property*)event;
if (ev->atom == ECORE_X_ATOM_E_ILLUME_CLIPBOARD_STATE)
clipboardHelper->UpdateClipboardWindowState(ev);
clipboard_window_opened_ = false;
}
-void ClipboardHelperEfl::SetData(const std::string& data, ClipboardDataType type) {
- // TODO: Webview and Rendering TG will implement following for Wayland.
+void ClipboardHelperEfl::SetData(const std::string& data,
+ ClipboardDataType type) {
+// TODO: Webview and Rendering TG will implement following for Wayland.
#if !defined(WAYLAND_BRINGUP)
Ecore_X_Atom data_type = 0;
- switch(type)
- {
+ switch (type) {
case CLIPBOARD_DATA_TYPE_PLAIN_TEXT:
case CLIPBOARD_DATA_TYPE_URI_LIST:
case CLIPBOARD_DATA_TYPE_URL:
#else
std::string data_type;
- switch(type) {
+ switch (type) {
case CLIPBOARD_DATA_TYPE_PLAIN_TEXT:
case CLIPBOARD_DATA_TYPE_URI_LIST:
case CLIPBOARD_DATA_TYPE_URL:
unsigned char* buf = 0;
int property_size = 0;
- int property_array_size = ecore_x_window_prop_property_get(0, xAtomCbhm, XA_WINDOW, 0, &buf, &property_size);
+ int property_array_size = ecore_x_window_prop_property_get(
+ 0, xAtomCbhm, XA_WINDOW, 0, &buf, &property_size);
if (property_array_size && property_size)
memcpy(&xCbhmWin, buf, sizeof(Ecore_X_Window));
#endif
bool ClipboardHelperEfl::SendCbhmMessage(const std::string& message) {
- // TODO: Webview and Rendering TG will implement following for Wayland.
+// TODO: Webview and Rendering TG will implement following for Wayland.
#if !defined(WAYLAND_BRINGUP)
Ecore_X_Window cbhm_win = GetCbhmWindow();
Ecore_X_Atom atom_cbhm_item = ecore_x_atom_get(kCbhmAtomMessage);
messageEvent.window = xwin;
messageEvent.message_type = atom_cbhm_item;
messageEvent.format = 8; /* data should be viewed as byte */
- snprintf(messageEvent.data.b, sizeof(messageEvent.data.b), "%s", message.c_str());
+ snprintf(messageEvent.data.b, sizeof(messageEvent.data.b), "%s",
+ message.c_str());
- XSendEvent(static_cast<Display*>(ecore_x_display_get()), cbhm_win, false, NoEventMask,
- reinterpret_cast<XEvent*>(&messageEvent));
+ XSendEvent(static_cast<Display*>(ecore_x_display_get()), cbhm_win, false,
+ NoEventMask, reinterpret_cast<XEvent*>(&messageEvent));
ecore_x_sync();
#else
// TODO: Webview and Rendering TG will implement following for Wayland.
#if !defined(WAYLAND_BRINGUP)
-bool ClipboardHelperEfl::SetClipboardItem(Ecore_X_Atom data_type,const std::string& data) {
+bool ClipboardHelperEfl::SetClipboardItem(Ecore_X_Atom data_type,
+ const std::string& data) {
if (data.empty())
return false;
data_start_index = sizeof(prefix) - 1;
ecore_x_sync();
- ecore_x_window_prop_property_set(cbhm_win,
- atom_cbhm_item,
- data_type,
- 8,
- const_cast<char*>(data.c_str()) + data_start_index,
- data.length() - data_start_index + 1);
+ ecore_x_window_prop_property_set(
+ cbhm_win, atom_cbhm_item, data_type, 8,
+ const_cast<char*>(data.c_str()) + data_start_index,
+ data.length() - data_start_index + 1);
ecore_x_sync();
if (SendCbhmMessage(kCbhmMessageSetItem))
return false;
}
#else
-bool ClipboardHelperEfl::SetClipboardItem(const std::string& data_type, const std::string& data) {
+bool ClipboardHelperEfl::SetClipboardItem(const std::string& data_type,
+ const std::string& data) {
s_clipboard[data_type] = data;
if (SendCbhmMessage(kCbhmMessageSetItem))
// TODO: Webview and Rendering TG will implement following for Wayland.
#if !defined(WAYLAND_BRINGUP)
-std::string ClipboardHelperEfl::GetCbhmReply(Ecore_X_Window xwin, Ecore_X_Atom property, Ecore_X_Atom* data_type) {
+std::string ClipboardHelperEfl::GetCbhmReply(Ecore_X_Window xwin,
+ Ecore_X_Atom property,
+ Ecore_X_Atom* data_type) {
if (!property)
return std::string();
long unsigned int bytes = 0;
unsigned char* data = 0;
- int result = XGetWindowProperty(static_cast<Display*>(ecore_x_display_get()),
- xwin, property, 0, LONG_MAX, False, ecore_x_window_prop_any_type(),
- reinterpret_cast<Atom*>(&type), &data_unit_size, &data_length,
- &bytes, &data);
+ int result = XGetWindowProperty(
+ static_cast<Display*>(ecore_x_display_get()), xwin, property, 0, LONG_MAX,
+ False, ecore_x_window_prop_any_type(), reinterpret_cast<Atom*>(&type),
+ &data_unit_size, &data_length, &bytes, &data);
if (result != Success)
return std::string();
std::string cbhm_data;
switch (data_unit_size) {
- case kDataUnitSize8:
- cbhm_data = std::string(reinterpret_cast<const char*>(data), data_length);
- break;
- case kDataUnitSize16:
- cbhm_data = UTF16ToUTF8(base::string16(reinterpret_cast<const base::char16*>(data), data_length));
- break;
- case kDataUnitSize32:
- break;
- default:
- NOTREACHED();
- break;
+ case kDataUnitSize8:
+ cbhm_data = std::string(reinterpret_cast<const char*>(data), data_length);
+ break;
+ case kDataUnitSize16:
+ cbhm_data = base::UTF16ToUTF8(base::string16(
+ reinterpret_cast<const base::char16*>(data), data_length));
+ break;
+ case kDataUnitSize32:
+ break;
+ default:
+ NOTREACHED();
+ break;
}
XFree(data);
}
#endif
-bool ClipboardHelperEfl::RetrieveClipboardItem(int index, int* format, std::string* data) {
+bool ClipboardHelperEfl::RetrieveClipboardItem(int index,
+ int* format,
+ std::string* data) {
if (!data)
return false;
if (result.empty() || atom_item_type == ecore_x_atom_get(kCbhmAtomError))
return false;
- //TODO: Other formats need to be added here.
+ // TODO: Other formats need to be added here.
if ((atom_item_type == ecore_x_atom_get(kCbhmAtomUTF8String)) ||
(atom_item_type == ecore_x_atom_get(kCbhmAtomElmMarkup))) {
*format = ELM_SEL_FORMAT_TEXT;
data->swap(result);
if (atom_item_type == ecore_x_atom_get(kCbhmAtomElmMarkup))
- *data = std::string(evas_textblock_text_markup_to_utf8(NULL, data->c_str()));
+ *data =
+ std::string(evas_textblock_text_markup_to_utf8(NULL, data->c_str()));
return true;
} else if (atom_item_type == ecore_x_atom_get(kCbhmAtomTextHtml)) {
*format = ELM_SEL_FORMAT_HTML;
if (s_clipboard.size() < static_cast<unsigned int>(index))
return false;
- std::map<std::string, std::string>::iterator clipboardElem = s_clipboard.begin();
+ std::map<std::string, std::string>::iterator clipboardElem =
+ s_clipboard.begin();
std::advance(clipboardElem, index);
if (clipboardElem->first == kCbhmAtomUTF8String ||
*format = ELM_SEL_FORMAT_TEXT;
*data = clipboardElem->second;
if (clipboardElem->first == kCbhmAtomElmMarkup)
- *data = std::string(evas_textblock_text_markup_to_utf8(NULL, data->c_str()));
+ *data =
+ std::string(evas_textblock_text_markup_to_utf8(NULL, data->c_str()));
return true;
} else if (clipboardElem->first == kCbhmAtomTextHtml) {
*format = ELM_SEL_FORMAT_HTML;
}
int ClipboardHelperEfl::NumberOfItems() {
- // 1. Get CBHM Ecore_X_Window.
+// 1. Get CBHM Ecore_X_Window.
#if !defined(WAYLAND_BRINGUP)
Ecore_X_Atom x_atom;
x_atom = ecore_x_atom_get(kCbhmAtomXWindow);
unsigned char* data = 0;
int number_of_windows = 0;
- int result = ecore_x_window_prop_property_get(0, x_atom, XA_WINDOW, 0, &data, &number_of_windows);
+ int result = ecore_x_window_prop_property_get(0, x_atom, XA_WINDOW, 0, &data,
+ &number_of_windows);
Ecore_X_Window x_window = 0;
if (result && number_of_windows)
long unsigned bytes = 0;
unsigned char* data_in_format = 0;
result = XGetWindowProperty(display, x_window, x_atom, 0, LONG_MAX, False,
- ecore_x_window_prop_any_type(), reinterpret_cast<Atom*>(&type),
- &format, &number_of_items, &bytes, &data_in_format);
+ ecore_x_window_prop_any_type(),
+ reinterpret_cast<Atom*>(&type), &format,
+ &number_of_items, &bytes, &data_in_format);
if (result != Success)
return 0;
char* end;
errno = 0;
- long int count = strtol(reinterpret_cast<const char*>(data_in_format), &end, 10);
- if ((end == reinterpret_cast<const char*>(data_in_format) || *end != '\0') /* not a number */||
- ((count == LONG_MIN || count == LONG_MAX) && ERANGE == errno) /* out of range */) {
+ long int count =
+ strtol(reinterpret_cast<const char*>(data_in_format), &end, 10);
+ if ((end == reinterpret_cast<const char*>(data_in_format) ||
+ *end != '\0') /* not a number */
+ || ((count == LONG_MIN || count == LONG_MAX) &&
+ ERANGE == errno) /* out of range */) {
DLOG(ERROR) << "String to int conversion failed.";
return 0;
}
#endif
}
-static void pasteSelectedClipboardItem(std::string data, std::string type, EWebView *webview) {
+static void pasteSelectedClipboardItem(std::string data,
+ std::string type,
+ EWebView* webview) {
#if 0
content::SelectionControllerEfl* controller = webview->GetSelectionController();
if (controller)
static Eina_Bool clearClip(void* data, int type, void* event) {
#if !defined(WAYLAND_BRINGUP)
- Ecore_X_Event_Selection_Clear* clearEvent = (Ecore_X_Event_Selection_Clear*) event;
+ Ecore_X_Event_Selection_Clear* clearEvent =
+ (Ecore_X_Event_Selection_Clear*)event;
Ecore_X_Window window = clearEvent->win;
ClipType clipType = CLIP_TYPE_SECONDARY;
- clipList[clipType].requestedFormat = static_cast<Elm_Sel_Format>(ELM_SEL_FORMAT_TEXT | ELM_SEL_FORMAT_IMAGE);
+ clipList[clipType].requestedFormat =
+ static_cast<Elm_Sel_Format>(ELM_SEL_FORMAT_TEXT | ELM_SEL_FORMAT_IMAGE);
ecore_x_selection_secondary_request(window, ECORE_X_SELECTION_TARGET_TARGETS);
#else
return ECORE_CALLBACK_PASS_ON;
}
-static Eina_Bool notifyClip(void* data , int type, void* event) {
- EWebView *webview = static_cast<EWebView*>(data);
- // TODO: Webview and Rendering TG will implement following for Wayland.
+static Eina_Bool notifyClip(void* data, int type, void* event) {
+ EWebView* webview = static_cast<EWebView*>(data);
+// TODO: Webview and Rendering TG will implement following for Wayland.
#if !defined(WAYLAND_BRINGUP)
- Ecore_X_Event_Selection_Notify* notifytEvent = (Ecore_X_Event_Selection_Notify*) event;
+ Ecore_X_Event_Selection_Notify* notifytEvent =
+ (Ecore_X_Event_Selection_Notify*)event;
int i = 0;
for (i = 0; i < CLIP_TYPE_MAX; i++) {
// TODO: Webview and Rendering TG will implement following for Wayland.
#if !defined(WAYLAND_BRINGUP)
-static int notifyTarget(ClipData* clipData, Ecore_X_Event_Selection_Notify* notifyData) {
+static int notifyTarget(ClipData* clipData,
+ Ecore_X_Event_Selection_Notify* notifyData) {
Ecore_X_Atom dataType = 0;
if (clipData->clipboardHelper->getSelectedCbhmItem(&dataType)) {
}
}
- Ecore_X_Selection_Data_Targets* pTargets = (Ecore_X_Selection_Data_Targets*) (notifyData->data);
- Ecore_X_Atom* pAtomList = (Ecore_X_Atom*) (pTargets->data.data);
+ Ecore_X_Selection_Data_Targets* pTargets =
+ (Ecore_X_Selection_Data_Targets*)(notifyData->data);
+ Ecore_X_Atom* pAtomList = (Ecore_X_Atom*)(pTargets->data.data);
int i, j = 0;
- for (j = (ATOM_LISTING_ATOMS+1); j < ATOM_MAX; j++) {
+ for (j = (ATOM_LISTING_ATOMS + 1); j < ATOM_MAX; j++) {
if (!(atomList[j].formats & clipData->requestedFormat))
continue;
for (i = 0; i < pTargets->data.length; i++) {
if ((atomList[j].atom == pAtomList[i]) && (atomList[j].notify)) {
- if ((j == ATOM_XELM) && (!(clipData->requestedFormat & ELM_SEL_FORMAT_MARKUP)))
+ if ((j == ATOM_XELM) &&
+ (!(clipData->requestedFormat & ELM_SEL_FORMAT_MARKUP)))
continue;
goto FOUND;
}
return ECORE_CALLBACK_PASS_ON;
- FOUND:
+FOUND:
clipData->request(notifyData->win, atomList[j].pName);
return ECORE_CALLBACK_PASS_ON;
}
// TODO: Webview and Rendering TG will implement following for Wayland.
#if !defined(WAYLAND_BRINGUP)
-static int notifyText(ClipData* clipData, Ecore_X_Event_Selection_Notify* notifyData) {
- Ecore_X_Selection_Data* pData = (Ecore_X_Selection_Data*) notifyData->data;
- pasteSelectedClipboardItem(std::string((char*)pData->data), "InsertText", clipData->webView);
+static int notifyText(ClipData* clipData,
+ Ecore_X_Event_Selection_Notify* notifyData) {
+ Ecore_X_Selection_Data* pData = (Ecore_X_Selection_Data*)notifyData->data;
+ pasteSelectedClipboardItem(std::string((char*)pData->data), "InsertText",
+ clipData->webView);
return 0;
}
-static int notifyImage(ClipData* clipData, Ecore_X_Event_Selection_Notify* notifyData) {
+static int notifyImage(ClipData* clipData,
+ Ecore_X_Event_Selection_Notify* notifyData) {
return 0;
}
static int notifyUri(ClipData* clipData,
- Ecore_X_Event_Selection_Notify* notifyData) {
- Ecore_X_Selection_Data* pData = (Ecore_X_Selection_Data*) notifyData->data;
+ Ecore_X_Event_Selection_Notify* notifyData) {
+ Ecore_X_Selection_Data* pData = (Ecore_X_Selection_Data*)notifyData->data;
pasteSelectedClipboardItem(
std::string(reinterpret_cast<char*>(pData->data), pData->length),
"InsertImage", clipData->webView);
- return 0;
+ return 0;
}
-static int notifyEdje(ClipData* clipData, Ecore_X_Event_Selection_Notify* notifyData) {
+static int notifyEdje(ClipData* clipData,
+ Ecore_X_Event_Selection_Notify* notifyData) {
return 0;
}
static int notifyHtml(ClipData* clipData,
- Ecore_X_Event_Selection_Notify* notifyData) {
- Ecore_X_Selection_Data* pData = (Ecore_X_Selection_Data*) notifyData->data;
+ Ecore_X_Event_Selection_Notify* notifyData) {
+ Ecore_X_Selection_Data* pData = (Ecore_X_Selection_Data*)notifyData->data;
pasteSelectedClipboardItem(
std::string(reinterpret_cast<char*>(pData->data), pData->length),
"InsertHTML", clipData->webView);
#endif
void ClipboardHelperEfl::initializeAtomList() {
- // TODO: Webview and Rendering TG will implement following for Wayland.
+// TODO: Webview and Rendering TG will implement following for Wayland.
#if !defined(WAYLAND_BRINGUP)
atomList[ATOM_TARGETS].pName = "TARGETS";
atomList[ATOM_TARGETS].formats = ELM_SEL_FORMAT_TARGETS;
atomList[ATOM_TEXT_HTML].atom = 0;
atomList[ATOM_STRING_UTF8].pName = "UTF8_STRING";
- atomList[ATOM_STRING_UTF8].formats = static_cast<Elm_Sel_Format> (ELM_SEL_FORMAT_TEXT| ELM_SEL_FORMAT_MARKUP| ELM_SEL_FORMAT_HTML);
+ atomList[ATOM_STRING_UTF8].formats = static_cast<Elm_Sel_Format>(
+ ELM_SEL_FORMAT_TEXT | ELM_SEL_FORMAT_MARKUP | ELM_SEL_FORMAT_HTML);
atomList[ATOM_STRING_UTF8].notify = notifyText;
atomList[ATOM_STRING_UTF8].atom = 0;
atomList[ATOM_STRING].pName = "STRING";
- atomList[ATOM_STRING].formats = static_cast<Elm_Sel_Format> (ELM_SEL_FORMAT_TEXT| ELM_SEL_FORMAT_MARKUP| ELM_SEL_FORMAT_HTML);
+ atomList[ATOM_STRING].formats = static_cast<Elm_Sel_Format>(
+ ELM_SEL_FORMAT_TEXT | ELM_SEL_FORMAT_MARKUP | ELM_SEL_FORMAT_HTML);
atomList[ATOM_STRING].notify = notifyText;
atomList[ATOM_STRING].atom = 0;
atomList[ATOM_TEXT].pName = "TEXT";
- atomList[ATOM_TEXT].formats = static_cast<Elm_Sel_Format> (ELM_SEL_FORMAT_TEXT| ELM_SEL_FORMAT_MARKUP| ELM_SEL_FORMAT_HTML);
+ atomList[ATOM_TEXT].formats = static_cast<Elm_Sel_Format>(
+ ELM_SEL_FORMAT_TEXT | ELM_SEL_FORMAT_MARKUP | ELM_SEL_FORMAT_HTML);
atomList[ATOM_TEXT].notify = 0;
atomList[ATOM_TEXT].atom = 0;
atomList[ATOM_TEXT_PLAIN_UTF8].pName = "text/plain;charset=utf-8";
- atomList[ATOM_TEXT_PLAIN_UTF8].formats = static_cast<Elm_Sel_Format> (ELM_SEL_FORMAT_TEXT| ELM_SEL_FORMAT_MARKUP| ELM_SEL_FORMAT_HTML);
+ atomList[ATOM_TEXT_PLAIN_UTF8].formats = static_cast<Elm_Sel_Format>(
+ ELM_SEL_FORMAT_TEXT | ELM_SEL_FORMAT_MARKUP | ELM_SEL_FORMAT_HTML);
atomList[ATOM_TEXT_PLAIN_UTF8].notify = 0;
atomList[ATOM_TEXT_PLAIN_UTF8].atom = 0;
atomList[ATOM_TEXT_PLAIN].pName = "text/plain";
- atomList[ATOM_TEXT_PLAIN].formats = static_cast<Elm_Sel_Format> (ELM_SEL_FORMAT_TEXT| ELM_SEL_FORMAT_MARKUP| ELM_SEL_FORMAT_HTML);
+ atomList[ATOM_TEXT_PLAIN].formats = static_cast<Elm_Sel_Format>(
+ ELM_SEL_FORMAT_TEXT | ELM_SEL_FORMAT_MARKUP | ELM_SEL_FORMAT_HTML);
atomList[ATOM_TEXT_PLAIN].notify = notifyText;
atomList[ATOM_TEXT_PLAIN].atom = 0;
std::string result = GetCbhmReply(cbhmWin, atomCbhmItem, &atomItemType);
- if(result.empty())
+ if (result.empty())
return false;
if (atomItemType == ecore_x_atom_get("CBHM_ERROR"))
}
#endif
-void ClipboardHelperEfl::OpenClipboardWindow(EWebView* view, bool richly_editable) {
+void ClipboardHelperEfl::OpenClipboardWindow(EWebView* view,
+ bool richly_editable) {
clearClipboardHandler();
initializeAtomList();
- // TODO: Webview and Rendering TG will implement following for Wayland.
+// TODO: Webview and Rendering TG will implement following for Wayland.
#if !defined(WAYLAND_BRINGUP)
property_change_handler_ = ecore_event_handler_add(
ECORE_X_EVENT_WINDOW_PROPERTY, propertyChangeCallback, this);
- m_selectionClearHandler = ecore_event_handler_add(ECORE_X_EVENT_SELECTION_CLEAR, clearClip, view);
- m_selectionNotifyHandler = ecore_event_handler_add(ECORE_X_EVENT_SELECTION_NOTIFY, notifyClip, view);
+ m_selectionClearHandler =
+ ecore_event_handler_add(ECORE_X_EVENT_SELECTION_CLEAR, clearClip, view);
+ m_selectionNotifyHandler =
+ ecore_event_handler_add(ECORE_X_EVENT_SELECTION_NOTIFY, notifyClip, view);
#else
NOTIMPLEMENTED();
#endif
}
void ClipboardHelperEfl::connectClipboardWindow() {
- // TODO: Webview and Rendering TG will implement following for Wayland.
+// TODO: Webview and Rendering TG will implement following for Wayland.
#if !defined(WAYLAND_BRINGUP)
- ecore_x_selection_secondary_set(ecore_x_window_focus_get(), "",1);
+ ecore_x_selection_secondary_set(ecore_x_window_focus_get(), "", 1);
#else
NOTIMPLEMENTED();
#endif
// TODO: Webview and Rendering TG will implement following for Wayland.
#if !defined(WAYLAND_BRINGUP)
-void ClipboardHelperEfl::UpdateClipboardWindowState(Ecore_X_Event_Window_Property* ev) {
- Ecore_X_Illume_Clipboard_State state = ecore_x_e_illume_clipboard_state_get(ev->win);
+void ClipboardHelperEfl::UpdateClipboardWindowState(
+ Ecore_X_Event_Window_Property* ev) {
+ Ecore_X_Illume_Clipboard_State state =
+ ecore_x_e_illume_clipboard_state_get(ev->win);
if (state == ECORE_X_ILLUME_CLIPBOARD_STATE_OFF)
clearClipboardHandler();
#include "content/browser/renderer_host/dip_util.h"
#include "ui/base/x/x11_util.h"
#include "ui/display/device_display_info_efl.h"
-#include "ui/gfx/geometry/rect.h"
#include "ui/display/display.h"
#include "ui/display/display_observer.h"
#include "ui/display/screen.h"
#include "ui/gfx/geometry/dip_util.h"
+#include "ui/gfx/geometry/rect.h"
#include "ui/gfx/x/x11_types.h"
+using namespace display;
+
namespace ui {
class ScreenEfl : public display::Screen {
public:
- ScreenEfl() {
- }
+ ScreenEfl() {}
- ~ScreenEfl() override {
- }
+ ~ScreenEfl() override {}
+ // display::Screen overrides
gfx::Point GetCursorScreenPoint() override {
NOTIMPLEMENTED();
return gfx::Point();
return NULL;
}
- int GetNumDisplays() const override {
- return 1;
- }
+ int GetNumDisplays() const override { return 1; }
- std::vector<display::Display> GetAllDisplays() const override {
+ const std::vector<display::Display>& GetAllDisplays() const override {
return std::vector<display::Display>(1, GetPrimaryDisplay());
}
- display::Display GetDisplayNearestWindow(gfx::NativeView view) const override {
+ display::Display GetDisplayNearestWindow(
+ gfx::NativeView /*view*/) const override {
return GetPrimaryDisplay();
}
display::Display GetDisplayNearestPoint(
- const gfx::Point& point) const override {
+ const gfx::Point& /*point*/) const override {
return GetPrimaryDisplay();
}
display::Display GetDisplayMatching(
- const gfx::Rect& match_rect) const override {
+ const gfx::Rect& /*match_rect*/) const override {
return GetPrimaryDisplay();
}
display::Display GetPrimaryDisplay() const override {
display::DeviceDisplayInfoEfl display_info;
const float device_scale_factor =
- display::Display::HasForceDeviceScaleFactor() ?
- display::Display::GetForcedDeviceScaleFactor() : display_info.GetDIPScale();
+ display::Display::HasForceDeviceScaleFactor()
+ ? display::Display::GetForcedDeviceScaleFactor()
+ : display_info.GetDIPScale();
display::Display display(0);
display.SetRotationAsDegree(display_info.GetRotationDegrees());
#if defined(USE_WAYLAND)
if (display.rotation() == display::Display::ROTATE_90 ||
display.rotation() == display::Display::ROTATE_270) {
- ecore_wl_screen_size_get(&height, &width);
- }
- else {
- ecore_wl_screen_size_get(&width, &height);
+ ecore_wl_screen_size_get(&height, &width);
+ } else {
+ ecore_wl_screen_size_get(&width, &height);
}
#else
Ecore_X_Screen* screen = ecore_x_default_screen_get();
if (display.rotation() == display::Display::ROTATE_90 ||
display.rotation() == display::Display::ROTATE_270) {
- ecore_x_screen_size_get(screen, &height, &width);
- }
- else {
- ecore_x_screen_size_get(screen, &width, &height);
+ ecore_x_screen_size_get(screen, &height, &width);
+ } else {
+ ecore_x_screen_size_get(screen, &width, &height);
}
#endif
return display;
}
- void AddObserver(display::DisplayObserver* observer) override {
+ void AddObserver(display::DisplayObserver* /*observer*/) override {
+ NOTIMPLEMENTED();
}
- void RemoveObserver(display::DisplayObserver* observer) override {
+ void RemoveObserver(display::DisplayObserver* /*observer*/) override {
+ NOTIMPLEMENTED();
}
private:
DISALLOW_COPY_AND_ASSIGN(ScreenEfl);
};
-void InstallScreenInstance()
-{
+void InstallScreenInstance() {
static bool installed = false;
if (!installed) {
installed = true;
}
}
-} // namespace ui
+} // namespace ui
namespace display {
+// static
+gfx::NativeWindow Screen::GetWindowForView(gfx::NativeView view) {
+ return view;
+}
Screen* CreateNativeScreen() {
return new ui::ScreenEfl();
}
-} // namespace display
+} // namespace display
+++ /dev/null
-// Copyright 2014 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.
-
-// Define GLContextEGL to GLContextEGLOverride to be able to replace
-// initialize method in GLContextEGL
-#define GLContextEGL GLContextEGLOverride
-
-#define private protected
-
-#include "ui/gl/gl_context_egl.cc"
-
-#undef GLContextEGL
-
-namespace gl {
-
-class GL_EXPORT GLContextEGL : public GLContextEGLOverride {
- public:
- GLContextEGL(GLShareGroup* share_group);
-
- bool Initialize(GLSurface* compatible_surface,
- GpuPreference gpu_preference) override;
-
- private:
- ~GLContextEGL() {};
-};
-
-GLContextEGL::GLContextEGL(GLShareGroup* share_group) :
- GLContextEGLOverride(share_group) {
-}
-
-bool GLContextEGL::Initialize(
- GLSurface* compatible_surface, GpuPreference gpu_preference) {
- DCHECK(compatible_surface);
- DCHECK(!context_);
-
- static const EGLint kContextAttributes[] = {
- EGL_CONTEXT_CLIENT_VERSION, 2,
- EGL_NONE
- };
-
- display_ = compatible_surface->GetDisplay();
- config_ = compatible_surface->GetConfig();
-
- context_ = eglCreateContext(
- display_,
- config_,
- share_group() ? share_group()->GetHandle() : NULL,
- kContextAttributes);
-
- if (!context_) {
- LOG(ERROR) << "eglCreateContext failed with error "
- << GetLastEGLErrorString();
- return false;
- }
-
- return true;
-}
-
-}
-
virtual void Destroy(bool have_context) override;
virtual gfx::Size GetSize() override;
virtual bool BindTexImage(unsigned target) override;
- virtual void ReleaseTexImage(unsigned target) override;
virtual bool CopyTexSubImage(unsigned target,
const gfx::Point& offset,
const gfx::Rect& rect) override;
struct GLSharedContextEflPrivate : public gl::GLContext {
GLSharedContextEflPrivate(Evas_Object* object)
: GLContext(GLSharedContextEfl::GetShareGroup()) {
- Evas* evas = evas_object_evas_get(object);
+ Evas* evas = evas_object_evas_get(object);
evas_gl_config_ = evas_gl_config_new();
evas_gl_config_->options_bits = EVAS_GL_OPTIONS_NONE;
evas_gl_config_->color_format = EVAS_GL_RGBA_8888;
if (!evas_gl_context_)
LOG(FATAL) << "GLSharedContextEflPrivate(): Create evas gl context Fail";
- evas_gl_surface_ = evas_gl_surface_create(
- evas_gl_, evas_gl_config_, 1, 1);
+ evas_gl_surface_ = evas_gl_surface_create(evas_gl_, evas_gl_config_, 1, 1);
if (!evas_gl_surface_)
LOG(FATAL) << "GLSharedContextEflPrivate(): Create evas gl Surface Fail";
evas_gl_make_current(evas_gl_, 0, 0);
}
- bool Initialize(
- gl::GLSurface*, gl::GpuPreference) override {
+ bool Initialize(gl::GLSurface*, const gl::GLContextAttribs&) override {
NOTREACHED();
return false;
}
return false;
}
- void ReleaseCurrent(gl::GLSurface*) override {
- NOTREACHED();
- }
+ void ReleaseCurrent(gl::GLSurface*) override { NOTREACHED(); }
bool IsCurrent(gl::GLSurface*) override {
NOTREACHED();
return false;
}
- void* GetHandle() override {
- return handle_;
- }
+ void* GetHandle() override { return handle_; }
- virtual scoped_refptr<gl::GPUTimingClient> CreateGPUTimingClient() override {
+ scoped_refptr<gl::GPUTimingClient> CreateGPUTimingClient() override {
return 0;
}
- virtual void OnSetSwapInterval(int interval) override {
- NOTREACHED();
+ const gl::ExtensionSet& GetExtensions() override {
+ return GLSharedContextEfl::GetInstance()->GetExtensions();
}
+ void OnSetSwapInterval(int interval) override { NOTREACHED(); }
+
+ void ResetExtensions() override { NOTREACHED(); }
+
private:
friend struct GLSharedContextEfl;
// static
gl::GLShareGroup* GLSharedContextEfl::GetShareGroup() {
- static scoped_refptr<gl::GLShareGroup> share_group_ =
- new gl::GLShareGroup();
+ static scoped_refptr<gl::GLShareGroup> share_group_ = new gl::GLShareGroup();
return share_group_.get();
}
import("//tizen_src/build/config/tizen_features.gni")
static_library("ozone_efl") {
- deps = [ "//ui/ozone/common" ]
+ deps = [
+ "//ui/ozone/common",
+ ]
if (!use_wayland) {
configs += [ "//tizen_src/build:ecore-x" ]
}
sources = [
- "client_native_pixmap_factory_efl.h",
"client_native_pixmap_factory_efl.cc",
- "ozone_platform_efl.h",
+ "client_native_pixmap_factory_efl.h",
"ozone_platform_efl.cc",
- "surface_factory_efl.h",
+ "ozone_platform_efl.h",
"surface_factory_efl.cc",
+ "surface_factory_efl.h",
]
+ include_dirs = [ "//ui/ozone/public" ]
}
namespace ui {
-ClientNativePixmapFactory* CreateClientNativePixmapFactoryEfl() {
+gfx::ClientNativePixmapFactory* CreateClientNativePixmapFactoryEfl() {
+ //#if !defined(EWK_BRINGUP) // FIXME: m67 bringup
+ // [m63_3239]
+ // error: cannot convert ‘gfx::ClientNativePixmapFactory*’ to
+ // ‘ui::ClientNativePixmapFactory*
return CreateStubClientNativePixmapFactory();
+ //#endif
}
} // namespace ui
#ifndef OZONE_PIXMAP_FACTORY_EFL_H_
#define OZONE_PIXMAP_FACTORY_EFL_H_
-namespace ui {
+namespace gfx {
class ClientNativePixmapFactory;
// Constructor hook for use in constructor_list.cc
ClientNativePixmapFactory* CreateClientNativePixmapFactoryEfl();
-} // namespace ui
+} // namespace gfx
#endif // OZONE_PIXMAP_FACTORY_EFL_H_
#include "ui/ozone/ozone_platform_efl.h"
-#include "base/logging.h"
#include "ui/display/types/native_display_delegate.h"
-#include "ui/ozone/common/stub_overlay_manager.h"
-#include "ui/ozone/public/gpu_platform_support.h"
#include "ui/ozone/public/gpu_platform_support_host.h"
#include "ui/ozone/public/ozone_platform.h"
-#include "ui/ozone/public/system_input_injector.h"
#include "ui/ozone/surface_factory_efl.h"
#include "ui/platform_window/platform_window.h"
namespace {
+// OzonePlatform implementation for EFL.
class OzonePlatformEfl : public OzonePlatform {
public:
- OzonePlatformEfl()
- : surface_factory_(new SurfaceFactoryEfl) {
- }
+ OzonePlatformEfl() {}
+ ~OzonePlatformEfl() override {}
- SurfaceFactoryOzone* GetSurfaceFactoryOzone() override {
+ ui::SurfaceFactoryOzone* GetSurfaceFactoryOzone() override {
return surface_factory_.get();
}
- OverlayManagerOzone* GetOverlayManager() override {
- return overlay_manager_.get();
- }
+ ui::OverlayManagerOzone* GetOverlayManager() override { return nullptr; }
- CursorFactoryOzone* GetCursorFactoryOzone() override {
- NOTIMPLEMENTED();
- return NULL;
- }
+ ui::CursorFactoryOzone* GetCursorFactoryOzone() override { return nullptr; }
- InputController* GetInputController() override {
- NOTIMPLEMENTED();
- return NULL;
- }
+ ui::InputController* GetInputController() override { return nullptr; }
- GpuPlatformSupport* GetGpuPlatformSupport() override {
- return gpu_platform_.get();
- }
-
- GpuPlatformSupportHost* GetGpuPlatformSupportHost() override {
+ ui::GpuPlatformSupportHost* GetGpuPlatformSupportHost() override {
return gpu_platform_host_.get();
}
std::unique_ptr<SystemInputInjector> CreateSystemInputInjector() override {
- NOTIMPLEMENTED();
- return NULL;
+ return nullptr;
}
std::unique_ptr<PlatformWindow> CreatePlatformWindow(
- PlatformWindowDelegate* delegate,
- const gfx::Rect& bounds) override {
- NOTIMPLEMENTED();
- return NULL;
- }
-
- std::unique_ptr<ui::NativeDisplayDelegate> CreateNativeDisplayDelegate() override {
- NOTIMPLEMENTED();
- return NULL;
+ PlatformWindowDelegate* /*delegate*/,
+ const gfx::Rect& /*bounds*/) override {
+ return nullptr;
}
- base::ScopedFD OpenClientNativePixmapDevice() const {
- return base::ScopedFD();
+ std::unique_ptr<display::NativeDisplayDelegate> CreateNativeDisplayDelegate()
+ override {
+ return nullptr;
}
-
private:
- void InitializeUI() override {
+ void InitializeUI(const InitParams& /*params*/) override {
gpu_platform_host_.reset(CreateStubGpuPlatformSupportHost());
- overlay_manager_.reset(new StubOverlayManager());
}
- void InitializeGPU() override {
- gpu_platform_.reset(CreateStubGpuPlatformSupport());
+ void InitializeGPU(const InitParams& /*params*/) override {
+ surface_factory_.reset(new SurfaceFactoryEfl());
}
std::unique_ptr<SurfaceFactoryEfl> surface_factory_;
- std::unique_ptr<GpuPlatformSupport> gpu_platform_;
std::unique_ptr<GpuPlatformSupportHost> gpu_platform_host_;
- std::unique_ptr<OverlayManagerOzone> overlay_manager_;
DISALLOW_COPY_AND_ASSIGN(OzonePlatformEfl);
};
-} // namespace
+} // namespace
OzonePlatform* CreateOzonePlatformEfl() {
return new OzonePlatformEfl;
}
-} // namespace ui
+} // namespace ui
class OzonePlatform;
+// Constructor hook for use in ozone_platform_list.cc
OzonePlatform* CreateOzonePlatformEfl();
} // namespace ui
#include "ecore_x_wayland_wrapper.h"
-#if defined(USE_WAYLAND)
-#include <wayland-egl.h>
-#endif
-#include <EGL/egl.h>
-#include <EGL/eglext.h>
-
+#include "ui/gl/gl_surface_egl.h"
#include "ui/ozone/common/egl_util.h"
+#include "ui/ozone/common/gl_ozone_egl.h"
namespace ui {
-SurfaceFactoryEfl::SurfaceFactoryEfl()
- : SurfaceFactoryOzone() {
-}
+namespace {
-bool SurfaceFactoryEfl::LoadEGLGLES2Bindings(
- AddGLLibraryCallback add_gl_library,
- SetGLGetProcAddressProcCallback set_gl_get_proc_address) {
- return ui::LoadDefaultEGLGLES2Bindings(add_gl_library, set_gl_get_proc_address);
-}
+class GLOzoneEGLEfl : public GLOzoneEGL {
+ public:
+ GLOzoneEGLEfl() {}
+ ~GLOzoneEGLEfl() override {}
+
+ scoped_refptr<gl::GLSurface> CreateViewGLSurface(
+ gfx::AcceleratedWidget window) override {
+ // We use offscreen surface for EFL port.
+ return nullptr;
+ }
-intptr_t SurfaceFactoryEfl::GetNativeDisplay() {
+ scoped_refptr<gl::GLSurface> CreateOffscreenGLSurface(
+ const gfx::Size& size) override {
+ if (gl::GLSurfaceEGL::IsEGLSurfacelessContextSupported() &&
+ size.width() == 0 && size.height() == 0) {
+ return gl::InitializeGLSurface(new gl::SurfacelessEGL(size));
+ } else {
+ return gl::InitializeGLSurface(new gl::PbufferGLSurfaceEGL(size));
+ }
+ }
+
+ protected:
+ intptr_t GetNativeDisplay() override {
#if defined(USE_WAYLAND)
- return reinterpret_cast<intptr_t>(ecore_wl_display_get());
+ return reinterpret_cast<intptr_t>(ecore_wl_display_get());
#else
- return reinterpret_cast<intptr_t>(ecore_x_display_get());
+ return reinterpret_cast<intptr_t>(ecore_x_display_get());
#endif
+ }
+
+ bool LoadGLES2Bindings(gl::GLImplementation implementation) override {
+ return LoadDefaultEGLGLES2Bindings(implementation);
+ }
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(GLOzoneEGLEfl);
+};
+
+} // namespace
+
+SurfaceFactoryEfl::SurfaceFactoryEfl() {
+ egl_implementation_.reset(new GLOzoneEGLEfl());
}
-} // namespace ui
+SurfaceFactoryEfl::~SurfaceFactoryEfl() {}
+
+std::vector<gl::GLImplementation>
+SurfaceFactoryEfl::GetAllowedGLImplementations() {
+ std::vector<gl::GLImplementation> impls;
+ impls.push_back(gl::kGLImplementationEGLGLES2);
+ return impls;
+}
+
+GLOzone* SurfaceFactoryEfl::GetGLOzone(gl::GLImplementation implementation) {
+ switch (implementation) {
+ case gl::kGLImplementationEGLGLES2:
+ return egl_implementation_.get();
+ default:
+ return nullptr;
+ }
+}
+} // namespace ui
namespace ui {
-class SurfaceFactoryEfl : public ui::SurfaceFactoryOzone {
+// SurfaceFactoryOzone implementation for EFL.
+class SurfaceFactoryEfl : public SurfaceFactoryOzone {
public:
SurfaceFactoryEfl();
+ ~SurfaceFactoryEfl() override;
- bool LoadEGLGLES2Bindings(
- AddGLLibraryCallback add_gl_library,
- SetGLGetProcAddressProcCallback set_gl_get_proc_address) override;
- intptr_t GetNativeDisplay() override;
+ // SurfaceFactoryOzone:
+ std::vector<gl::GLImplementation> GetAllowedGLImplementations() override;
+ GLOzone* GetGLOzone(gl::GLImplementation implementation) override;
+
+ private:
+ std::unique_ptr<GLOzone> egl_implementation_;
+
+ DISALLOW_COPY_AND_ASSIGN(SurfaceFactoryEfl);
};
-} // namespace ui
+} // namespace ui
#endif // OZONE_SURFACE_FACTORY_EFL
namespace ui {
bool GrabViewSnapshot(gfx::NativeView view,
- std::vector<unsigned char>* png_representation,
- const gfx::Rect& snapshot_bounds) {
- return GrabWindowSnapshot(view, png_representation, snapshot_bounds);
+ const gfx::Rect& snapshot_bounds,
+ gfx::Image* image) {
+ return GrabWindowSnapshot(view, snapshot_bounds, image);
}
bool GrabWindowSnapshot(gfx::NativeWindow window,
- std::vector<unsigned char>* png_representation,
- const gfx::Rect& snapshot_bounds) {
+ const gfx::Rect& snapshot_bounds,
+ gfx::Image* image) {
// Not supported in EFL port. Callers should fall back to the async version.
return false;
}
]
# For //ui/gfx/x target
-external_ui_gfx_x11_sources = [ "//tizen_src/chromium_impl/ui/gfx/x/x11_types_override.cc" ]
+external_ui_gfx_x11_sources =
+ [ "//tizen_src/chromium_impl/ui/gfx/x/x11_types_override.cc" ]
external_exclude_ui_gfx_x11_sources = [ "x11_types.cc" ]
if (wayland_bringup) {
external_exclude_ui_gfx_x11_sources += [ "gfx/x11_types_override.cc" ]
}
external_exclude_ui_gl_sources = []
+
# For //ui/gl target
-external_exclude_ui_gl_sources += [ "gl_context_egl.cc" ]
+#external_exclude_ui_gl_sources += [ "gl_context_egl.cc" ]
external_ui_gl_sources = [
"//tizen_src/chromium_impl/ui/gl/gl_shared_context_efl.h",
"//tizen_src/chromium_impl/ui/gl/gl_shared_context_efl.cc",
- "//tizen_src/chromium_impl/ui/gl/gl_context_egl_override.cc",
"//tizen_src/chromium_impl/ui/gl/gl_current_context_efl.cc",
]
if (building_for_tizen) {
"//tizen_src/chromium_impl/ui/base/clipboard/clipboard_helper_efl.cc",
"//tizen_src/chromium_impl/ui/base/clipboard/clipboard_helper_efl.h",
]
-if (use_x11) {
- if (!wayland_bringup) {
- external_ui_base_sources += [
- "//ui/base/cursor/cursor_x11.cc",
- "//ui/base/cursor/cursor_x11.h",
- "//ui/base/cursor/cursor_loader_x11.h",
- "//ui/base/cursor/cursor_loader_x11.cc",
- ]
- }
-}
+
+# EWK_BRINGUP
+#if (use_x11) {
+# if (!wayland_bringup) {
+# external_ui_base_sources += [
+# "//ui/base/cursor/cursor_x11.cc",
+# "//ui/base/cursor/cursor_x11.h",
+# "//ui/base/cursor/cursor_loader_x11.h",
+# "//ui/base/cursor/cursor_loader_x11.cc",
+# ]
+# }
+#}
external_exclude_ui_base_sources = []
# For //ui/snapshot target
-external_ui_snapshot_sources = [ "//tizen_src/chromium_impl/ui/snapshot/snapshot_efl.cc" ]
+external_ui_snapshot_sources =
+ [ "//tizen_src/chromium_impl/ui/snapshot/snapshot_efl.cc" ]
# For //ui/events:gesture_detection target
-external_exclude_ui_gesture_detection_sources = [ "gesture_detection/gesture_configuration_default.cc"]
+external_exclude_ui_gesture_detection_sources =
+ [ "gesture_detection/gesture_configuration_default.cc" ]
external_ui_gesture_detection_sources = [ "//tizen_src/chromium_impl/ui/events/gesture_detection/gesture_configuration_efl.cc" ]
_ZN7content13BrowserThread11CurrentlyOnENS0_2IDE;
_ZN7content13BrowserThread15GetBlockingPoolEv;
_ZN7content13BrowserThread16PostTaskAndReplyENS0_2IDERKN15tracked_objects8LocationERKN4base8CallbackIFvvEEESB_;
- _ZN7content13BrowserThread28GetMessageLoopProxyForThreadENS0_2IDE;
+ _ZN7content13BrowserThread28GetTaskRunnerForThreadENS0_2IDE;
_ZN7content13BrowserThread29UnsafeGetMessageLoopForThreadENS0_2IDE;
_ZN7content13BrowserThread8PostTaskENS0_2IDERKN15tracked_objects8LocationERKN4base8CallbackIFvvEEE;
_ZN7content13ContentClientC1Ev;
"notification_permission_popup.cc",
"notification_permission_popup.h",
"permission_popup.h",
-# "permission_popup_manager.cc",
+ "permission_popup_manager.cc",
"permission_popup_manager.h",
"popup_controller_efl.cc",
"popup_controller_efl.h",
"wrt/dynamicplugin.h",
]
sources -= exclude_source_set
+ # FIXME: Followings are guarded just for bringup.
+ if (ewk_bringup) {
+ sources -= [
+ "browser/permission_manager_efl.cc",
+ "browser/permission_manager_efl.h",
+ "browser/vibration/vibration_provider_client.cc",
+ "browser/vibration/vibration_provider_client.h",
+ "devtools_delegate_efl.cc",
+ "devtools_delegate_efl.h",
+ "devtools_manager_delegate_efl.cc",
+ "devtools_manager_delegate_efl.h",
+ "permission_popup_manager.cc",
+ "permission_popup_manager.h",
+ ]
+ }
deps += [ "resource:edje_resources_ewk" ]
}
#include "base/bind.h"
#include "base/logging.h"
+#include "base/threading/thread_task_runner_handle.h"
+#include "content/browser/appcache/appcache_service_impl.h"
#include "content/common/render_messages_efl.h"
#include "content/public/browser/browser_context.h"
#include "content/public/browser/browser_thread.h"
#include "net/http/http_cache.h"
#include "net/url_request/url_request_context.h"
#include "net/url_request/url_request_context_getter.h"
-#include "storage/common/quota/quota_types.h"
#include "storage/browser/quota/quota_manager.h"
-#include "content/browser/appcache/appcache_service_impl.h"
+#include "storage/common/quota/quota_types.h"
using content::BrowserThread;
return;
// we can delete ourselves, but following chromium we do delete later.
- base::MessageLoop::current()->DeleteSoon(FROM_HERE, this);
+ base::ThreadTaskRunnerHandle::Get()->DeleteSoon(FROM_HERE, this);
}
typedef void (*Application_Cache_Origins_Get_Callback)(void* origins, void* user_data);
#include "base/files/file_path.h"
#include "base/path_service.h"
-#include "components/mime_util/mime_util.h"
+#include "third_party/WebKit/common/mime_util/mime_util.h"
#include "content/common/paths_efl.h"
#include "content/public/browser/download_danger_type.h"
#include "content/public/browser/download_item.h"
base::FilePath DownloadManagerDelegateEfl::GetPlatformDownloadPath(
content::DownloadItem* item) const {
base::FilePath path;
- if (mime_util::IsSupportedImageMimeType(item->GetMimeType())) {
+ if (blink::IsSupportedImageMimeType(item->GetMimeType())) {
if (!PathService::Get(PathsEfl::DIR_DOWNLOAD_IMAGE, &path)) {
LOG(ERROR) << "Could not get image directory.";
return base::FilePath();
callback.Run(base::FilePath(), /* Empty file path for cancellation */
content::DownloadItem::TARGET_DISPOSITION_OVERWRITE,
content::DOWNLOAD_DANGER_TYPE_NOT_DANGEROUS,
- base::FilePath());
+ base::FilePath(),
+ content::DOWNLOAD_INTERRUPT_REASON_USER_CANCELED);
}
bool DownloadManagerDelegateEfl::DetermineDownloadTarget(content::DownloadItem* item,
callback.Run(GetPlatformDownloadPath(item),
content::DownloadItem::TARGET_DISPOSITION_OVERWRITE,
content::DOWNLOAD_DANGER_TYPE_NOT_DANGEROUS,
- GetPlatformDownloadPath(item));
+ GetPlatformDownloadPath(item),
+ content::DOWNLOAD_INTERRUPT_REASON_NONE);
}
return true;
}
static_cast<int *>(res->data)[1] = static_cast<int>(bitmap.alphaType());
static_cast<int *>(res->data)[2] = bitmap.width();
static_cast<int *>(res->data)[3] = bitmap.height();
+#if !defined(EWK_BRINGUP) // FIXME: m67 bringup
if (!bitmap.copyPixelsTo(static_cast<int *>(res->data) + 4, bitmap.getSize())) {
res->free();
}
+#endif
return res;
}
// the deserialized SkBitmap owns and holds it's internal image data
// for it's whole lifetime, we create a deep copy of the |bitmap|.
SkBitmap copy;
+#if !defined(EWK_BRINGUP) // FIXME: m67 bringup
bitmap.copyTo(©, colorType);
+#endif
return copy;
}
}
void FaviconDatabase::SyncSQLite() {
- scoped_refptr<base::SingleThreadTaskRunner> ptr = content::BrowserThread::GetMessageLoopProxyForThread(content::BrowserThread::DB);
+ scoped_refptr<base::SingleThreadTaskRunner> ptr = content::BrowserThread::GetTaskRunnerForThread(content::BrowserThread::DB);
ptr->PostTask(FROM_HERE, base::Bind(&FaviconDatabasePrivate::performSync, d->weakPtrFactory.GetWeakPtr()));
}
}
scoped_refptr<base::SingleThreadTaskRunner> FaviconDatabasePrivate::taskRunner() const {
- return content::BrowserThread::GetMessageLoopProxyForThread(content::BrowserThread::DB);
+ return content::BrowserThread::GetTaskRunnerForThread(content::BrowserThread::DB);
}
void FaviconDatabasePrivate::performSync() {
#include "ewk_global_data.h"
#include "private/ewk_context_private.h"
-namespace content {
+namespace device {
AccessTokenStoreEfl::AccessTokenStoreEfl()
: system_request_context_(NULL)
void AccessTokenStoreEfl::LoadAccessTokens(const LoadAccessTokensCallback& callback)
{
- BrowserThread::PostTaskAndReply(BrowserThread::UI,
+ content::BrowserThread::PostTaskAndReply(content::BrowserThread::UI,
FROM_HERE,
base::Bind(&AccessTokenStoreEfl::GetRequestContextOnUIThread,
this),
{
}
-} // namespace content
+} // namespace device
#ifndef ACCESS_TOKEN_STORE_EFL_H_
#define ACCESS_TOKEN_STORE_EFL_H_
-#include "content/public/browser/access_token_store.h"
#include "browser_context_efl.h"
+#include "device/geolocation/access_token_store.h"
namespace content {
-
class BrowserContextEfl;
+}
+
+namespace device {
-class AccessTokenStoreEfl : public content::AccessTokenStore {
+class AccessTokenStoreEfl : public device::AccessTokenStore {
public:
AccessTokenStoreEfl();
DISALLOW_COPY_AND_ASSIGN(AccessTokenStoreEfl);
};
-} // namespace content
+} // namespace device
#endif // ACCESS_TOKEN_STORE_EFL_H_
#include "base/callback.h"
#include "base/memory/weak_ptr.h"
-#include "third_party/WebKit/public/platform/modules/permissions/permission_status.mojom.h"
+#include "third_party/blink/public/platform/modules/permissions/permission_status.mojom.h"
class GURL;
using content::BrowserThread;
using web_contents_utils::WebViewFromWebContents;
-JavaScriptModalCallbacksData::JavaScriptModalCallbacksData(content::JavaScriptMessageType javascript_message_type,
- void* user_data)
- : alert_callback_(NULL), user_data_(user_data), javascript_message_type_(javascript_message_type)
-{
-}
-
-bool JavaScriptModalCallbacksData::Run(Evas_Object* obj, const char* message_text, const char* default_text)
-{
- switch (javascript_message_type_) {
- case content::JAVASCRIPT_MESSAGE_TYPE_ALERT: {
+JavaScriptModalCallbacksData::JavaScriptModalCallbacksData(
+ content::JavaScriptDialogType javascript_dialog_type,
+ void* user_data)
+ : alert_callback_(NULL),
+ user_data_(user_data),
+ javascript_dialog_type_(javascript_dialog_type) {}
+
+bool JavaScriptModalCallbacksData::Run(Evas_Object* obj,
+ const char* message_text,
+ const char* default_text) {
+ switch (javascript_dialog_type_) {
+ case content::JAVASCRIPT_DIALOG_TYPE_ALERT: {
if (alert_callback_)
return alert_callback_(obj, message_text, user_data_);
break;
}
- case content::JAVASCRIPT_MESSAGE_TYPE_CONFIRM: {
+ case content::JAVASCRIPT_DIALOG_TYPE_CONFIRM: {
if (confirm_callback_)
return confirm_callback_(obj, message_text, user_data_);
break;
}
- case content::JAVASCRIPT_MESSAGE_TYPE_PROMPT: {
+ case content::JAVASCRIPT_DIALOG_TYPE_PROMPT: {
if (prompt_callback_)
return prompt_callback_(obj, message_text, default_text, user_data_);
break;
return false;
}
-JavaScriptModalCallbacksData* JavaScriptModalCallbacksData::CreateWithAlertDialogData(
+JavaScriptModalCallbacksData*
+JavaScriptModalCallbacksData::CreateWithAlertDialogData(
Ewk_View_JavaScript_Alert_Callback callback,
- void* user_data)
-{
- JavaScriptModalCallbacksData* callback_data = new JavaScriptModalCallbacksData(
- content::JAVASCRIPT_MESSAGE_TYPE_ALERT, user_data);
+ void* user_data) {
+ JavaScriptModalCallbacksData* callback_data =
+ new JavaScriptModalCallbacksData(content::JAVASCRIPT_DIALOG_TYPE_ALERT,
+ user_data);
callback_data->alert_callback_ = callback;
return callback_data;
}
-JavaScriptModalCallbacksData* JavaScriptModalCallbacksData::CreateWithConfirmDialogData(
+JavaScriptModalCallbacksData*
+JavaScriptModalCallbacksData::CreateWithConfirmDialogData(
Ewk_View_JavaScript_Confirm_Callback callback,
- void* user_data)
-{
- JavaScriptModalCallbacksData* callback_data = new JavaScriptModalCallbacksData(
- content::JAVASCRIPT_MESSAGE_TYPE_CONFIRM, user_data);
+ void* user_data) {
+ JavaScriptModalCallbacksData* callback_data =
+ new JavaScriptModalCallbacksData(content::JAVASCRIPT_DIALOG_TYPE_CONFIRM,
+ user_data);
callback_data->confirm_callback_ = callback;
return callback_data;
}
-JavaScriptModalCallbacksData* JavaScriptModalCallbacksData::CreateWithPromptDialogData(
+JavaScriptModalCallbacksData*
+JavaScriptModalCallbacksData::CreateWithPromptDialogData(
Ewk_View_JavaScript_Prompt_Callback callback,
- void* user_data)
-{
- JavaScriptModalCallbacksData* callback_data = new JavaScriptModalCallbacksData(
- content::JAVASCRIPT_MESSAGE_TYPE_PROMPT, user_data);
+ void* user_data) {
+ JavaScriptModalCallbacksData* callback_data =
+ new JavaScriptModalCallbacksData(content::JAVASCRIPT_DIALOG_TYPE_PROMPT,
+ user_data);
callback_data->prompt_callback_ = callback;
return callback_data;
}
-JavaScriptDialogManagerEfl::JavaScriptDialogManagerEfl() {
-}
+JavaScriptDialogManagerEfl::JavaScriptDialogManagerEfl() {}
-JavaScriptDialogManagerEfl::~JavaScriptDialogManagerEfl() {
-}
+JavaScriptDialogManagerEfl::~JavaScriptDialogManagerEfl() {}
-void JavaScriptDialogManagerEfl::RunJavaScriptDialog(content::WebContents* web_contents,
- const GURL& origin_url,
- content::JavaScriptMessageType javascript_message_type,
- const base::string16& message_text,
- const base::string16& default_prompt_text,
- const DialogClosedCallback& callback,
- bool* did_suppress_message) {
+void JavaScriptDialogManagerEfl::RunJavaScriptDialog(
+ content::WebContents* web_contents,
+ const GURL& alerting_frame_url,
+ content::JavaScriptDialogType dialog_type,
+ const base::string16& message_text,
+ const base::string16& default_prompt_text,
+ DialogClosedCallback callback,
+ bool* did_suppress_message) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
DCHECK(web_contents);
- dialog_closed_callback_ = callback;
+ dialog_closed_callback_ = std::move(callback);
EWebView* wv = WebViewFromWebContents(web_contents);
wv->SmartCallback<EWebViewCallbacks::PopupReplyWaitStart>().call(0);
JavaScriptModalDialogEfl::Type type = JavaScriptModalDialogEfl::ALERT;
- if (javascript_message_type == content::JAVASCRIPT_MESSAGE_TYPE_ALERT) {
+ if (dialog_type == content::JAVASCRIPT_DIALOG_TYPE_ALERT) {
type = JavaScriptModalDialogEfl::ALERT;
if (alert_callback_data_) {
if (!(alert_callback_data_->Run(wv->evas_object(),
- UTF16ToUTF8(message_text).c_str(),
- NULL)))
+ base::UTF16ToUTF8(message_text).c_str(), NULL)))
ExecuteDialogClosedCallBack(false, std::string());
}
}
- if (javascript_message_type == content::JAVASCRIPT_MESSAGE_TYPE_CONFIRM) {
+ if (dialog_type == content::JAVASCRIPT_DIALOG_TYPE_CONFIRM) {
type = JavaScriptModalDialogEfl::CONFIRM;
if (confirm_callback_data_) {
- if (!(confirm_callback_data_->Run(wv->evas_object(),
- UTF16ToUTF8(message_text).c_str(),
- NULL)))
+ if (!(confirm_callback_data_->Run(
+ wv->evas_object(), base::UTF16ToUTF8(message_text).c_str(), NULL)))
ExecuteDialogClosedCallBack(false, std::string());
}
}
- if (javascript_message_type == content::JAVASCRIPT_MESSAGE_TYPE_PROMPT) {
+ if (dialog_type == content::JAVASCRIPT_DIALOG_TYPE_PROMPT) {
type = JavaScriptModalDialogEfl::PROMPT;
if (prompt_callback_data_) {
- if (!(prompt_callback_data_->Run(wv->evas_object(),
- UTF16ToUTF8(message_text).c_str(),
- UTF16ToUTF8(default_prompt_text).c_str())))
+ if (!(prompt_callback_data_->Run(
+ wv->evas_object(), base::UTF16ToUTF8(message_text).c_str(),
+ base::UTF16ToUTF8(default_prompt_text).c_str())))
ExecuteDialogClosedCallBack(false, std::string());
}
}
- dialog_.reset(JavaScriptModalDialogEfl::CreateDialog(web_contents,
- origin_url,
- type,
- message_text,
- default_prompt_text,
- callback));
+ dialog_.reset(JavaScriptModalDialogEfl::CreateDialog(
+ web_contents, type, message_text, default_prompt_text,
+ std::move(callback)));
}
-void JavaScriptDialogManagerEfl::SetAlertCallback(Ewk_View_JavaScript_Alert_Callback callback, void* user_data)
-{
- alert_callback_data_.reset(JavaScriptModalCallbacksData::CreateWithAlertDialogData(callback, user_data));
+void JavaScriptDialogManagerEfl::SetAlertCallback(
+ Ewk_View_JavaScript_Alert_Callback callback,
+ void* user_data) {
+ alert_callback_data_.reset(
+ JavaScriptModalCallbacksData::CreateWithAlertDialogData(callback,
+ user_data));
}
-void JavaScriptDialogManagerEfl::SetConfirmCallback(Ewk_View_JavaScript_Confirm_Callback callback, void* user_data)
-{
- confirm_callback_data_.reset(JavaScriptModalCallbacksData::CreateWithConfirmDialogData(callback, user_data));
+void JavaScriptDialogManagerEfl::SetConfirmCallback(
+ Ewk_View_JavaScript_Confirm_Callback callback,
+ void* user_data) {
+ confirm_callback_data_.reset(
+ JavaScriptModalCallbacksData::CreateWithConfirmDialogData(callback,
+ user_data));
}
-void JavaScriptDialogManagerEfl::SetPromptCallback(Ewk_View_JavaScript_Prompt_Callback callback, void* user_data)
-{
- prompt_callback_data_.reset(JavaScriptModalCallbacksData::CreateWithPromptDialogData(callback, user_data));
+void JavaScriptDialogManagerEfl::SetPromptCallback(
+ Ewk_View_JavaScript_Prompt_Callback callback,
+ void* user_data) {
+ prompt_callback_data_.reset(
+ JavaScriptModalCallbacksData::CreateWithPromptDialogData(callback,
+ user_data));
}
-void JavaScriptDialogManagerEfl::ExecuteDialogClosedCallBack(bool result, const std::string prompt_data)
-{
- dialog_closed_callback_.Run(result, base::UTF8ToUTF16(prompt_data));
- if(dialog_) {
+void JavaScriptDialogManagerEfl::ExecuteDialogClosedCallBack(
+ bool result,
+ const std::string prompt_data) {
+ std::move(dialog_closed_callback_).Run(result, base::UTF8ToUTF16(prompt_data));
+ if (dialog_) {
dialog_->close();
}
}
dialog_->SetPopupSize(width, height);
}
-void JavaScriptDialogManagerEfl::RunBeforeUnloadDialog(content::WebContents* web_contents,
- bool is_reload,
- const DialogClosedCallback& callback) {
+void JavaScriptDialogManagerEfl::RunBeforeUnloadDialog(
+ content::WebContents* web_contents,
+ bool is_reload,
+ DialogClosedCallback callback) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
DCHECK(web_contents);
- dialog_closed_callback_ = callback;
+ dialog_closed_callback_ = std::move(callback);
EWebView* wv = WebViewFromWebContents(web_contents);
wv->SmartCallback<EWebViewCallbacks::PopupReplyWaitStart>().call(0);
dialog_.reset(JavaScriptModalDialogEfl::CreateDialog(
- web_contents, GURL(), JavaScriptModalDialogEfl::NAVIGATION,
+ web_contents, JavaScriptModalDialogEfl::NAVIGATION,
base::UTF8ToUTF16(
std::string(dgettext("WebKit", "IDS_WEBVIEW_BEFOREUNLOAD_MESSAGE"))),
- base::string16(), callback));
+ base::string16(), std::move(callback)));
}
+
+bool JavaScriptDialogManagerEfl::HandleJavaScriptDialog(
+ content::WebContents* web_contents,
+ bool accept,
+ const base::string16* prompt_override) {
+ NOTIMPLEMENTED();
+ return false;
+}
+
+void JavaScriptDialogManagerEfl::CancelDialogs(
+ content::WebContents* web_contents,
+ bool reset_state) {}
#include <string>
#include "base/strings/string16.h"
#include "content/public/browser/javascript_dialog_manager.h"
-#include "content/public/common/javascript_message_type.h"
#include "eweb_view.h"
#include "public/ewk_view.h"
#include "url/gurl.h"
-namespace content{
+namespace content {
class WebContents;
}
class JavaScriptModalDialogEfl;
class JavaScriptModalCallbacksData {
public:
- bool Run(Evas_Object* obj, const char* content_text, const char* default_text);
- static JavaScriptModalCallbacksData* CreateWithAlertDialogData(Ewk_View_JavaScript_Alert_Callback callback,
- void* user_data);
- static JavaScriptModalCallbacksData* CreateWithConfirmDialogData(Ewk_View_JavaScript_Confirm_Callback callback,
- void* user_data);
- static JavaScriptModalCallbacksData* CreateWithPromptDialogData(Ewk_View_JavaScript_Prompt_Callback callback,
- void* user_data);
- ~JavaScriptModalCallbacksData() { }
+ bool Run(Evas_Object* obj,
+ const char* content_text,
+ const char* default_text);
+ static JavaScriptModalCallbacksData* CreateWithAlertDialogData(
+ Ewk_View_JavaScript_Alert_Callback callback,
+ void* user_data);
+ static JavaScriptModalCallbacksData* CreateWithConfirmDialogData(
+ Ewk_View_JavaScript_Confirm_Callback callback,
+ void* user_data);
+ static JavaScriptModalCallbacksData* CreateWithPromptDialogData(
+ Ewk_View_JavaScript_Prompt_Callback callback,
+ void* user_data);
+ ~JavaScriptModalCallbacksData() {}
private:
- JavaScriptModalCallbacksData(content::JavaScriptMessageType javascript_message_type, void* user_data);
+ JavaScriptModalCallbacksData(
+ content::JavaScriptDialogType javascript_dialog_type,
+ void* user_data);
union {
Ewk_View_JavaScript_Alert_Callback alert_callback_;
Ewk_View_JavaScript_Confirm_Callback confirm_callback_;
Ewk_View_JavaScript_Prompt_Callback prompt_callback_;
};
void* user_data_;
- content::JavaScriptMessageType javascript_message_type_;
-
+ content::JavaScriptDialogType javascript_dialog_type_;
};
-class JavaScriptDialogManagerEfl: public content::JavaScriptDialogManager {
+class JavaScriptDialogManagerEfl : public content::JavaScriptDialogManager {
public:
JavaScriptDialogManagerEfl();
virtual ~JavaScriptDialogManagerEfl();
- virtual void RunJavaScriptDialog(
- content::WebContents* web_contents,
- const GURL& origin_url,
- content::JavaScriptMessageType javascript_message_type,
- const base::string16& message_text,
- const base::string16& default_prompt_text,
- const DialogClosedCallback& callback,
- bool* did_suppress_message) override;
-
- virtual void RunBeforeUnloadDialog(content::WebContents* web_contents,
- bool is_reload,
- const DialogClosedCallback& callback) override;
-
- virtual bool HandleJavaScriptDialog(content::WebContents* web_contents,
- bool accept,
- const base::string16* prompt_override) override
- {
- NOTIMPLEMENTED();
- return false;
- }
-
- virtual void CancelActiveAndPendingDialogs(content::WebContents* web_contents) override
- {
- NOTIMPLEMENTED();
- }
- virtual void ResetDialogState(content::WebContents* web_contents) override
- {
- NOTIMPLEMENTED();
- }
+ // JavaScriptDialogManager:
+ void RunJavaScriptDialog(content::WebContents* web_contents,
+ const GURL& alerting_frame_url,
+ content::JavaScriptDialogType dialog_type,
+ const base::string16& message_text,
+ const base::string16& default_prompt_text,
+ DialogClosedCallback callback,
+ bool* did_suppress_message) override;
+ void RunBeforeUnloadDialog(content::WebContents* web_contents,
+ bool is_reload,
+ DialogClosedCallback callback) override;
+ bool HandleJavaScriptDialog(content::WebContents* web_contents,
+ bool accept,
+ const base::string16* prompt_override) override;
+ void CancelDialogs(content::WebContents* web_contents,
+ bool reset_state) override;
- void SetAlertCallback(Ewk_View_JavaScript_Alert_Callback callback, void* user_data);
- void SetConfirmCallback(Ewk_View_JavaScript_Confirm_Callback callback, void* user_data);
- void SetPromptCallback(Ewk_View_JavaScript_Prompt_Callback callback, void* user_data);
+ void SetAlertCallback(Ewk_View_JavaScript_Alert_Callback callback,
+ void* user_data);
+ void SetConfirmCallback(Ewk_View_JavaScript_Confirm_Callback callback,
+ void* user_data);
+ void SetPromptCallback(Ewk_View_JavaScript_Prompt_Callback callback,
+ void* user_data);
void ExecuteDialogClosedCallBack(bool result, const std::string prompt_data);
void SetPopupSize(int width, int height);
//static
JavaScriptModalDialogEfl* JavaScriptModalDialogEfl::CreateDialog(content::WebContents* web_contents,
- const GURL& origin_url,
Type type,
const base::string16& message_text,
const base::string16& default_prompt_text,
- const content::JavaScriptDialogManager::DialogClosedCallback& callback) {
+ content::JavaScriptDialogManager::DialogClosedCallback callback) {
JavaScriptModalDialogEfl* dialog =
- new JavaScriptModalDialogEfl(web_contents, origin_url, type, message_text,
- default_prompt_text, callback);
+ new JavaScriptModalDialogEfl(web_contents, type, message_text,
+ default_prompt_text, std::move(callback));
if (!dialog->ShowJavaScriptDialog()) {
delete dialog;
dialog = NULL;
}
JavaScriptModalDialogEfl::JavaScriptModalDialogEfl(content::WebContents* web_contents,
- const GURL& origin_url,
Type type,
const base::string16& message_text,
const base::string16& default_prompt_text,
- const content::JavaScriptDialogManager::DialogClosedCallback& callback)
- : callback_(callback)
- , origin_url_(origin_url)
+ content::JavaScriptDialogManager::DialogClosedCallback callback)
+ : callback_(std::move(callback))
, label_(false)
, type_(type)
, message_text_(message_text)
, default_prompt_text_(default_prompt_text)
- , web_view_(WebViewFromWebContents(web_contents))
+ , web_view_(web_contents_utils::WebViewFromWebContents(web_contents))
, prompt_entry_(NULL)
, ok_button_(NULL)
, cancel_button_(NULL)
if (type_ == PROMPT) {
if (message_text_.c_str())
- elm_object_part_text_set(popup_, "title,text", UTF16ToUTF8(message_text_).c_str());
+ elm_object_part_text_set(popup_, "title,text", base::UTF16ToUTF8(message_text_).c_str());
base::FilePath edj_dir;
base::FilePath javaScriptPopup_edj;
elm_entry_single_line_set(prompt_entry_, EINA_TRUE);
elm_entry_input_panel_return_key_type_set(prompt_entry_, ELM_INPUT_PANEL_RETURN_KEY_TYPE_DONE );
evas_object_smart_callback_add(prompt_entry_, "activated", promptEnterKeyDownCallback, this);
- elm_object_text_set(prompt_entry_, UTF16ToUTF8(default_prompt_text_).c_str());
+ elm_object_text_set(prompt_entry_, base::UTF16ToUTF8(default_prompt_text_).c_str());
elm_entry_scrollable_set(prompt_entry_, EINA_TRUE);
elm_entry_cursor_end_set(prompt_entry_);
} else if (type_ == NAVIGATION) {
if (message_text_.c_str())
- elm_object_part_text_set(popup_, "title,text", UTF16ToUTF8(message_text_).c_str());
+ elm_object_part_text_set(popup_, "title,text", base::UTF16ToUTF8(message_text_).c_str());
std::string question(dgettext("WebKit", "IDS_WEBVIEW_POP_LEAVE_THIS_PAGE_Q"));
std::string message;
if (default_prompt_text_.c_str())
- message = std::string(UTF16ToUTF8(default_prompt_text_).c_str()) + ("\n") + question;
+ message = std::string(base::UTF16ToUTF8(default_prompt_text_).c_str()) + ("\n") + question;
else
message = question;
"IDS_WEBVIEW_POP_JAVASCRIPT_ALERT"));
}
- if (!setLabelText(UTF16ToUTF8(message_text_).c_str()))
+ if (!setLabelText(base::UTF16ToUTF8(message_text_).c_str()))
return false;
ok_button_ = elm_button_add(popup_);
"IDS_WEBVIEW_POP_JAVASCRIPT"));
}
- if (!setLabelText(UTF16ToUTF8(message_text_).c_str()))
+ if (!setLabelText(base::UTF16ToUTF8(message_text_).c_str()))
return false;
cancel_button_ = elm_button_add(popup_);
void JavaScriptModalDialogEfl::OkButtonHandlerForAlert(void *data, Evas_Object *obj, void *event_info) {
JavaScriptModalDialogEfl* dialog = (JavaScriptModalDialogEfl*)data;
- dialog->callback_.Run(true, base::string16());
+ std::move(dialog->callback_).Run(true, base::string16());
evas_object_del(dialog->popup_);
dialog->close();
void JavaScriptModalDialogEfl::CancelButtonHandlerForAlert(void *data, Evas_Object *obj, void *event_info) {
JavaScriptModalDialogEfl* dialog = (JavaScriptModalDialogEfl*)data;
- dialog->callback_.Run(false, base::string16());
+ std::move(dialog->callback_).Run(false, base::string16());
evas_object_del(dialog->popup_);
dialog->close();
void JavaScriptModalDialogEfl::OkButtonHandlerForConfirm(void *data, Evas_Object *obj, void *event_info) {
JavaScriptModalDialogEfl* dialog = (JavaScriptModalDialogEfl*)data;
- dialog->callback_.Run(true, base::string16());
+ std::move(dialog->callback_).Run(true, base::string16());
evas_object_del(dialog->popup_);
dialog->close();
void JavaScriptModalDialogEfl::CancelButtonHandlerForConfirm(void *data, Evas_Object *obj, void *event_info) {
JavaScriptModalDialogEfl* dialog = (JavaScriptModalDialogEfl*)data;
- dialog->callback_.Run(false, base::string16());
+ std::move(dialog->callback_).Run(false, base::string16());
evas_object_del(dialog->popup_);
dialog->close();
if (dialog->prompt_entry_)
prompt_data = elm_entry_entry_get(dialog->prompt_entry_);
- dialog->callback_.Run(true, base::UTF8ToUTF16(prompt_data));
+ std::move(dialog->callback_).Run(true, base::UTF8ToUTF16(prompt_data));
evas_object_del(dialog->popup_);
dialog->close();
void JavaScriptModalDialogEfl::CancelButtonHandlerForPrompt(void *data, Evas_Object *obj, void *event_info) {
JavaScriptModalDialogEfl* dialog = (JavaScriptModalDialogEfl*)data;
- dialog->callback_.Run(false, base::string16());
+ std::move(dialog->callback_).Run(false, base::string16());
evas_object_del(dialog->popup_);
dialog->close();
#include <string>
#include "base/strings/string16.h"
-#include "url/gurl.h"
+#include "ui/views/window/dialog_delegate.h"
#include <Evas.h>
#include <Elementary.h>
#include "ecore_x_wayland_wrapper.h"
+
+
class EWebView;
namespace content {
static void CancelButtonHandlerForPrompt(void *data, Evas_Object *obj, void *event_info);
static void javascriptPopupResizeCallback(void *data, Evas *e, Evas_Object *obj, void *event_info);
static JavaScriptModalDialogEfl* CreateDialog(content::WebContents* web_contents,
- const GURL& origin_url,
Type type,
const base::string16& message_text,
const base::string16& default_prompt_text,
- const content::JavaScriptDialogManager::DialogClosedCallback& callback);
+ content::JavaScriptDialogManager::DialogClosedCallback callback);
static void KeyUpCallback(void *data, Evas *e, Evas_Object *obj, void *event_info);
bool ShowJavaScriptDialog();
private:
JavaScriptModalDialogEfl(content::WebContents* web_contents,
- const GURL& origin_url,
Type type,
const base::string16& message_text,
const base::string16& default_prompt_text,
- const content::JavaScriptDialogManager::DialogClosedCallback& callback);
+ content::JavaScriptDialogManager::DialogClosedCallback callback);
content::JavaScriptDialogManager::DialogClosedCallback callback_;
- GURL origin_url_;
bool label_;
Type type_;
base::string16 message_text_;
}
NotificationControllerEfl::~NotificationControllerEfl() {
- notifications_map_.Clear();
+ //notifications_map_.Clear();
}
-
+#if !defined(EWK_BRINGUP) // FIXME: m67 bringup
void NotificationControllerEfl::NotificationAdd(uint64_t notification_id,
const GURL& origin, const base::string16& replace_id,
std::unique_ptr<DesktopNotificationDelegate> delegate) {
notifications_map_.Remove(notification_id);
return true;
}
-
+#endif
void NotificationControllerEfl::NotificationCancelled(uint64_t notification_id) {
- NotificationClosed(notification_id, false);
+ //NotificationClosed(notification_id, false);
if (notification_cancel_callback_) {
notification_cancel_callback_(notification_id, notification_callback_user_data_);
}
}
-
+#if !defined(EWK_BRINGUP) // FIXME: m67 bringup
bool NotificationControllerEfl::NotificationClicked(uint64_t notification_id) {
NotificationData* saved_data = notifications_map_.Lookup(notification_id);
if (!saved_data)
saved_data->notification_delegate->NotificationDisplayed();
return true;
}
-
+#endif
blink::mojom::PermissionStatus NotificationControllerEfl::CheckPermissionOnUIThread(
BrowserContext* browser_context,
const GURL& origin,
void NotificationControllerEfl::DisplayNotification(
BrowserContext* browser_context,
+ const std::string& notification_id,
const GURL& origin,
const PlatformNotificationData& notification_data,
const NotificationResources& notification_resources,
- std::unique_ptr<DesktopNotificationDelegate> delegate,
base::Closure* cancel_callback) {
-
BrowserContextEfl* browser_context_efl =
static_cast<BrowserContextEfl*>(browser_context);
CHECK(browser_context_efl);
bool has_callbacks = ctx->HasNotificationCallbacks()
|| (notification_show_callback_ && notification_cancel_callback_);
-
+#if !defined(EWK_BRINGUP) // FIXME: m67 bringup
if (!has_callbacks) {
delegate->NotificationClosed();
return;
notification_show_callback_(notification, notification_callback_user_data_);
delete notification;
+#endif
}
-void NotificationControllerEfl:: DisplayPersistentNotification(
+void NotificationControllerEfl::DisplayPersistentNotification(
BrowserContext* browser_context,
- int64_t persistent_notification_id,
+ const std::string& notification_id,
+ const GURL& service_worker_origin,
const GURL& origin,
const PlatformNotificationData& notification_data,
const NotificationResources& notification_resources) {
void NotificationControllerEfl::ClosePersistentNotification(
BrowserContext* browser_context,
- int64_t persistent_notification_id) {
+ const std::string& notification_id) {
NOTIMPLEMENTED();
}
}
}
+#if !defined(EWK_BRINGUP) // FIXME: m67 bringup
bool NotificationControllerEfl::IsNotificationPresent(const GURL& origin,
const base::string16& replaceid, uint64_t& notification_id) {
IDMap<NotificationData, IDMapOwnPointer>::const_iterator it(¬ifications_map_);
return false;
}
+#endif
void NotificationControllerEfl::RequestPermission(
WebContents* web_contents,
notification_callback_user_data_ = user_data;
}
-bool NotificationControllerEfl::GetDisplayedPersistentNotifications(
- BrowserContext* browser_context,
- std::set<std::string>* displayed_notifications) {
- NOTIMPLEMENTED();
- return false;
-}
-
}//namespace
#include <Eina.h>
-#include "base/id_map.h"
+#include "base/containers/id_map.h"
#include "base/memory/weak_ptr.h"
#include "base/synchronization/lock.h"
-#include "content/public/browser/desktop_notification_delegate.h"
+//#include "content/public/browser/desktop_notification_delegate.h"
#include "content/public/browser/platform_notification_service.h"
#include "public/ewk_notification.h"
-#include "third_party/WebKit/public/platform/modules/permissions/permission_status.mojom.h"
+#include "third_party/blink/public/platform/modules/permissions/permission_status.mojom.h"
#include "url/gurl.h"
namespace content {
class WebContents;
+#if !defined(EWK_BRINGUP) // FIXME: m67 bringup
+//DesktopNotificationDelegate is not defined
struct NotificationData {
const std::string origin_url;
const base::string16 replace_id;
replace_id(replaceid),
notification_delegate(std::move(delegate)) {}
};
-
+#endif // !defined(EWK_BRINGUP)
class NotificationControllerEfl: public PlatformNotificationService {
public:
NotificationControllerEfl();
~NotificationControllerEfl();
-
+#if !defined(EWK_BRINGUP) // FIXME: m67 bringup
+//DesktopNotificationDelegate is not defined
// Adds a new notification received from engine to a list
void NotificationAdd(uint64_t notification_id, const GURL& origin,
const base::string16& replace_id,
std::unique_ptr<DesktopNotificationDelegate> delegate);
bool NotificationClosed(uint64_t notification_id, bool by_user);
-
+#endif
void NotificationCancelled(uint64_t notification_id);
-
+#if !defined(EWK_BRINGUP) // FIXME: m67 bringup
+//DesktopNotificationDelegate is not defined
// Notify engine when user clicked on the notification
bool NotificationClicked(uint64_t notification_id);
// Notification engine that notification was displayed
bool NotificationDisplayed(uint64_t notification_id);
-
+#endif
// sets the permission for a particular pending notification
void SetPermissionForNotification(
Ewk_Notification_Permission_Request* notification,
// Removes stored permissions for given origins
void RemovePermissions(Eina_List* origins);
+#if !defined(EWK_BRINGUP) // FIXME: m67 bringup
+//DesktopNotificationDelegate is not defined
// Checks if the notification is already present.
// If present returns the notification id of the notification else false
bool IsNotificationPresent(const GURL& origin,
const base::string16& replaceid, uint64_t& notification_id);
-
+#endif
void RequestPermission(WebContents* web_contents,
const GURL& requesting_frame,
const base::Callback<void(
// |cancel_callback| argument. This method must be called on the UI thread.
void DisplayNotification(
BrowserContext* browser_context,
+ const std::string& notification_id,
const GURL& origin,
const PlatformNotificationData& notification_data,
const NotificationResources& notification_resources,
- std::unique_ptr<DesktopNotificationDelegate> delegate,
base::Closure* cancel_callback) override;
// Displays the persistent notification described in |notification_data| to
// the user. This method must be called on the UI thread.
void DisplayPersistentNotification(
BrowserContext* browser_context,
- int64_t persistent_notification_id,
+ const std::string& notification_id,
+ const GURL& service_worker_origin,
const GURL& origin,
const PlatformNotificationData& notification_data,
const NotificationResources& notification_resources) override;
// |persistent_notification_id|. This method must be called on the UI thread.
void ClosePersistentNotification(
BrowserContext* browser_context,
- int64_t persistent_notification_id) override;
+ const std::string& notification_id) override;
+ // FIXME: Removed in upstream
+ //
// Writes the ids of all currently displaying persistent notifications for the
// given |browser_context| to |displayed_notifications|. Returns whether the
// platform is able to provide such a set.
bool GetDisplayedPersistentNotifications(
BrowserContext* browser_context,
- std::set<std::string>* displayed_notifications) override;
+ std::set<std::string>* displayed_notifications);
private:
blink::mojom::PermissionStatus CheckPermissionForOrigin(
const GURL &origin) const;
- IDMap<NotificationData, IDMapOwnPointer> notifications_map_; // This stores the notifications displayed to the user
+ //IDMap<NotificationData, IDMapOwnPointer> notifications_map_; // This stores the notifications displayed to the user
std::map<GURL, bool> permissions_map_;
mutable base::Lock permissions_mutex_;
// PasswordManagerClient implementation.
virtual bool PromptUserToSaveOrUpdatePassword(
- scoped_ptr<PasswordFormManager> form_to_save,
+ std::unique_ptr<PasswordFormManager> form_to_save,
CredentialSourceType type,
bool update_password) override;
void NotifyUserAutoSignin(
ScopedVector<autofill::PasswordForm> local_forms) override;
void AutomaticPasswordSave(
- scoped_ptr<PasswordFormManager> saved_form_manager) override;
+ std::unique_ptr<PasswordFormManager> saved_form_manager) override;
const PasswordManager* GetPasswordManager() const override;
const CredentialsFilter* GetStoreResultFilter() const override;
scoped_refptr<base::SingleThreadTaskRunner> main_thread_runner(
base::ThreadTaskRunnerHandle::Get());
scoped_refptr<base::SingleThreadTaskRunner> db_thread_runner(
- content::BrowserThread::GetMessageLoopProxyForThread(
+ content::BrowserThread::GetTaskRunnerForThread(
content::BrowserThread::DB));
scoped_refptr<PasswordStore> ps = new PasswordStoreDefault(
int PermissionManagerEfl::RequestPermission(PermissionType permission,
content::RenderFrameHost* render_frame_host,
const GURL& requesting_origin,
+ bool user_gesture,
const base::Callback<void(PermissionStatus)>& callback) {
-#if !defined(EWK_BRINGUP)
+#if !defined(EWK_BRINGUP) // FIXME: m67 bringup
// [M48_2564] Temporary disabling the codes for switching to new chromium
// FIXME: http://web.sec.samsung.net/bugzilla/show_bug.cgi?id=15387
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
const std::vector<PermissionType>& permission,
RenderFrameHost* render_frame_host,
const GURL& requesting_origin,
+ bool user_gesture,
const base::Callback<void(
const std::vector<PermissionStatus>&)>& callback) {
NOTIMPLEMENTED();
const GURL& embedding_origin) {
}
-void PermissionManagerEfl::RegisterPermissionUsage(PermissionType permission,
- const GURL& requesting_origin,
- const GURL& embedding_origin) {
-}
-
int PermissionManagerEfl::SubscribePermissionStatusChange(
PermissionType permission,
const GURL& requesting_origin,
PermissionType permission,
content::RenderFrameHost* render_frame_host,
const GURL& requesting_origin,
+ bool user_gesture,
const base::Callback<void(blink::mojom::PermissionStatus)>& callback)
override;
const std::vector<PermissionType>& permission,
RenderFrameHost* render_frame_host,
const GURL& requesting_origin,
+ bool user_gesture,
const base::Callback<
void(const std::vector<blink::mojom::PermissionStatus>&)>& callback)
override;
const GURL& requesting_origin,
const GURL& embedding_origin) override;
- void RegisterPermissionUsage(PermissionType permission,
- const GURL& requesting_origin,
- const GURL& embedding_origin) override;
-
// Runs the given |callback| whenever the |permission| associated with the
// pair { requesting_origin, embedding_origin } changes.
// Returns the subscription_id to be used to unsubscribe.
#define POLICY_RESPONSE_DELEGATE_EFL_H_
#include "base/memory/ref_counted.h"
-#include "content/public/browser/resource_controller.h"
+#include "content/browser/loader/resource_controller.h"
#include "content/public/common/resource_type.h"
#include "net/base/completion_callback.h"
#include "private/ewk_policy_decision_private.h"
using web_contents_utils::WebViewFromViewId;
using namespace content;
-void QuotaPermissionContextEfl::RequestQuotaPermission(const StorageQuotaParams& params,
- int render_process_id,
- const QuotaPermissionContext::PermissionCallback &callback)
-{
+void QuotaPermissionContextEfl::RequestQuotaPermission(
+ const StorageQuotaParams& params,
+ int render_process_id,
+ const QuotaPermissionContext::PermissionCallback& callback) {
if (!BrowserThread::CurrentlyOn(BrowserThread::UI)) {
BrowserThread::PostTask(
BrowserThread::UI, FROM_HERE,
return;
}
- EWebView* web_view = WebViewFromViewId(render_process_id, params.render_view_id);
+ EWebView* web_view =
+ web_contents_utils::WebViewFromFrameId(render_process_id, params.render_frame_id);
if (!web_view) {
NOTREACHED();
return;
}
- bool isPersistent = (storage::StorageType::kStorageTypePersistent == params.storage_type);
+ bool isPersistent =
+ (storage::StorageType::kStorageTypePersistent == params.storage_type);
- _Ewk_Quota_Permission_Request* request = new _Ewk_Quota_Permission_Request(params.origin_url,
- params.requested_size,
- isPersistent);
+ _Ewk_Quota_Permission_Request* request = new _Ewk_Quota_Permission_Request(
+ params.origin_url, params.requested_size, isPersistent);
web_view->InvokeQuotaPermissionRequest(request, callback);
}
-void QuotaPermissionContextEfl::DispatchCallback(const QuotaPermissionContext::PermissionCallback &callback,
- QuotaPermissionContext::QuotaPermissionResponse response) {
+void QuotaPermissionContextEfl::DispatchCallback(
+ const QuotaPermissionContext::PermissionCallback& callback,
+ QuotaPermissionContext::QuotaPermissionResponse response) {
DCHECK_EQ(false, callback.is_null());
if (!content::BrowserThread::CurrentlyOn(content::BrowserThread::IO)) {
content::BrowserThread::PostTask(
- content::BrowserThread::IO, FROM_HERE,
- base::Bind(&QuotaPermissionContextEfl::DispatchCallback, callback, response));
+ content::BrowserThread::IO, FROM_HERE,
+ base::Bind(&QuotaPermissionContextEfl::DispatchCallback, callback,
+ response));
return;
}
callback.Run(response);
}
-
#include "content/public/browser/quota_permission_context.h"
class QuotaPermissionContextEfl : public content::QuotaPermissionContext {
-public:
+ public:
void RequestQuotaPermission(const content::StorageQuotaParams& params,
int render_process_id,
const PermissionCallback& callback) override;
- static void DispatchCallback(const PermissionCallback& callback, QuotaPermissionResponse response);
+ static void DispatchCallback(const PermissionCallback& callback,
+ QuotaPermissionResponse response);
};
#endif /* QUOTA_PERMISSION_CONTEXT_EFL_ */
#include "base/compiler_specific.h"
#include "content/public/browser/browser_message_filter.h"
#include "private/ewk_hit_test_private.h"
-#include "third_party/WebKit/public/web/WebNavigationPolicy.h"
-#include "third_party/WebKit/public/web/WebNavigationType.h"
+#include "third_party/blink/public/web/WebNavigationPolicy.h"
+#include "third_party/blink/public/web/WebNavigationType.h"
#include "url/gurl.h"
#if defined(TIZEN_MULTIMEDIA_SUPPORT)
const std::string& /*content_disposition*/,
const std::string& /*mime_type*/,
int64_t /*content_length*/) {
- WebContents* web_contents = WebContentsFromViewID(
- render_process_id, render_view_id);
+ WebContents* web_contents =
+ WebContentsFromViewID(render_process_id, render_view_id);
if (!web_contents)
return;
- BrowserContextEfl* browser_context = static_cast<BrowserContextEfl*>(
- web_contents->GetBrowserContext());
+ BrowserContextEfl* browser_context =
+ static_cast<BrowserContextEfl*>(web_contents->GetBrowserContext());
if (!browser_context)
return;
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
start_download_callback->TriggerCallback(url.spec());
}
-
}
void ResourceDispatcherHostDelegateEfl::RequestBeginning(
net::URLRequest* request,
- ResourceContext* resource_context,
- AppCacheService* appcache_service,
- ResourceType resource_type,
- ScopedVector<ResourceThrottle>* throttles) {
+ content::ResourceContext* resource_context,
+ content::AppCacheService* appcache_service,
+ content::ResourceType resource_type,
+ std::vector<std::unique_ptr<content::ResourceThrottle>>* throttles) {
+// Arguments have changed. Needs a relook.
+#if !defined(EWK_BRINGUP) // FIXME: m67 bringup
// Add throttle for http, https and file protocol.
if (request->url().SchemeIsHTTPOrHTTPS() || request->url().SchemeIsFile())
throttles->push_back(new ResourceThrottleEfl(*request, resource_type));
- // policy response and custom headers should be probably only for HTTP and HTTPs
+ // policy response and custom headers should be probably only for HTTP and
+ // HTTPs
if (request->url().SchemeIsHTTPOrHTTPS()) {
- BrowserContextEfl::ResourceContextEfl *resource_context_efl =
+ BrowserContextEfl::ResourceContextEfl* resource_context_efl =
static_cast<BrowserContextEfl::ResourceContextEfl*>(resource_context);
if (!resource_context_efl)
return;
HTTPCustomHeadersEflMap header_map =
resource_context_efl->GetHTTPCustomHeadersEflMap();
for (HTTPCustomHeadersEflMap::iterator it = header_map.begin();
- it != header_map.end(); ++it)
+ it != header_map.end(); ++it)
request->SetExtraRequestHeaderByName(it->first, it->second, true);
}
+#endif
}
ResourceDispatcherHostLoginDelegate*
void ResourceDispatcherHostDelegateEfl::DownloadStarting(
net::URLRequest* request,
content::ResourceContext* resource_context,
- int child_id,
- int route_id,
bool is_content_initiated,
bool must_download,
- ScopedVector<content::ResourceThrottle>* throttles) {
+ bool is_new_request,
+ std::vector<std::unique_ptr<content::ResourceThrottle>>* throttles) {
std::string user_agent;
std::string content_disposition;
std::string mime_type;
net::HttpResponseHeaders* response_headers = request->response_headers();
if (response_headers) {
response_headers->GetNormalizedHeader("content-disposition",
- &content_disposition);
+ &content_disposition);
response_headers->GetMimeType(&mime_type);
}
+#if !defined(EWK_BRINGUP) // FIXME: m67 bringup
+ // FIXME: EWK_BRINGUP definition should be removed.
// POST request cannot be repeated in general, so prevent client from
// retrying the same request, even if it is with a GET.
if ("GET" == request->method()) {
- TriggerNewDownloadStartCallback(request,
- user_agent,
- content_disposition,
- mime_type,
- content_length,
- child_id,
- route_id);
+ TriggerNewDownloadStartCallback(request, user_agent, content_disposition,
+ mime_type, content_length, child_id,
+ route_id);
}
+#endif // !defined(EWK_BRINGUP)
}
void ResourceDispatcherHostDelegateEfl::TriggerNewDownloadStartCallback(
// Since called by IO thread callback trigger needs to
// be posted to UI thread so that IO thread is unblocked
BrowserThread::PostTask(
- BrowserThread::UI, FROM_HERE,
- base::Bind(TriggerNewDownloadStartCallbackOnUIThread,
- render_process_id,
- render_view_id,
- request->url(),
- user_agent,
- content_disposition,
- mime_type,
- content_length));
+ BrowserThread::UI, FROM_HERE,
+ base::Bind(TriggerNewDownloadStartCallbackOnUIThread, render_process_id,
+ render_view_id, request->url(), user_agent,
+ content_disposition, mime_type, content_length));
}
bool ResourceDispatcherHostDelegateEfl::ShouldOverrideMimeType(
- const GURL& url, std::string& new_mime_type) const {
+ const GURL& url,
+ std::string& new_mime_type) const {
MimeOverrideManagerEfl* mime_override_manager_efl =
MimeOverrideManagerEfl::GetInstance();
return mime_override_manager_efl->PopOverriddenMime(url.spec(),
new_mime_type);
}
-} // namespace content
+} // namespace content
class ResourceDispatcherHostDelegateEfl
: public ResourceDispatcherHostDelegate {
public:
- ResourceDispatcherHostDelegateEfl()
- {
- }
+ ResourceDispatcherHostDelegateEfl() {}
+ // ResourceDispatcherHostDelegate implementation.
+ //
// Called after ShouldBeginRequest to allow the embedder to add resource
// throttles.
- virtual void RequestBeginning(net::URLRequest* request,
- ResourceContext* resource_context,
- AppCacheService* appcache_service,
- ResourceType resource_type,
- ScopedVector<ResourceThrottle>* throttles) override;
-
- // Create login delegate.
- virtual ResourceDispatcherHostLoginDelegate* CreateLoginDelegate(
- net::AuthChallengeInfo* auth_info, net::URLRequest* request) override;
+ void RequestBeginning(net::URLRequest* request,
+ content::ResourceContext* resource_context,
+ content::AppCacheService* appcache_service,
+ content::ResourceType resource_type,
+ std::vector<std::unique_ptr<content::ResourceThrottle>>*
+ throttles) override;
// Called to trigger download.
- virtual void DownloadStarting(
- net::URLRequest* request,
- content::ResourceContext* resource_context,
- int child_id,
- int route_id,
- bool is_content_initiated,
- bool must_download,
- ScopedVector<content::ResourceThrottle>* throttles) override;
+ void DownloadStarting(net::URLRequest* request,
+ content::ResourceContext* resource_context,
+ bool is_content_initiated,
+ bool must_download,
+ bool is_new_request,
+ std::vector<std::unique_ptr<content::ResourceThrottle>>*
+ throttles) override;
+
+ // Create login delegate.
+ content::ResourceDispatcherHostLoginDelegate* CreateLoginDelegate(
+ net::AuthChallengeInfo* auth_info,
+ net::URLRequest* request) override;
+ // EWK_BRINGUP: Removed in upversion.
// Returns true if mime type should be overridden, otherwise returns false.
bool ShouldOverrideMimeType(const GURL& url,
- std::string& new_mime_type) const override;
+ std::string& new_mime_type) const;
private:
- void TriggerNewDownloadStartCallback(
- net::URLRequest* request,
- const std::string& user_agent,
- const std::string& content_disposition,
- const std::string& mime_type,
- int64_t content_length,
- int render_process_id,
- int render_view_id);
+ void TriggerNewDownloadStartCallback(net::URLRequest* request,
+ const std::string& user_agent,
+ const std::string& content_disposition,
+ const std::string& mime_type,
+ int64_t content_length,
+ int render_process_id,
+ int render_view_id);
};
-} // namespace net
+} // namespace net
-#endif // RESOURCE_DISPATCHER_HOST_DELEGATE_EFL_H
+#endif // RESOURCE_DISPATCHER_HOST_DELEGATE_EFL_H
#include <cstddef> //for NULL
#include "browser/policy_response_delegate_efl.h"
#include "content/public/browser/resource_throttle.h"
-#include "content/public/browser/resource_controller.h"
+#include "content/browser/loader/resource_controller.h"
#include "content/public/common/resource_type.h"
#include "net/url_request/url_request.h"
-class ResourceThrottleEfl : public content::ResourceThrottle {
+class ResourceThrottleEfl : public content::ResourceThrottle {
public:
ResourceThrottleEfl(net::URLRequest& request,
content::ResourceType resource_type)
: request_(request),
resource_type_(resource_type),
- policy_delegate_(NULL) {
- }
+ policy_delegate_(NULL) {}
~ResourceThrottleEfl();
}
void Resume() {
- controller()->Resume();
+ // EWK_BRINGUP. Removed in upstream
+ // 64fa092bc4ccdcb1c0cc08b93d6c1bd49363adb0
+ // controller()->Resume();
+ Resume();
}
void Ignore() {
- controller()->CancelAndIgnore();
+ // EWK_BRINGUP. Removed in upstream
+ // 64fa092bc4ccdcb1c0cc08b93d6c1bd49363adb0
+ // controller()->CancelAndIgnore();
+ Cancel();
}
private:
#include "base/logging.h"
Popup_Menu_Item::Popup_Menu_Item(const content::MenuItem& item)
- : type(static_cast<Popup_Menu_Item_Type>(item.type))
- , textDirection(item.rtl ? blink::WebTextDirectionRightToLeft: blink::WebTextDirectionLeftToRight)
- , hasTextDirectionOverride(item.has_directional_override)
- , isEnabled(item.enabled)
- , isLabel(true)
- , isSelected(item.checked)
- , text(base::UTF16ToUTF8(item.label))
- , toolTip(base::UTF16ToUTF8(item.tool_tip))
- , accessibilityText(base::UTF16ToUTF8(item.label)) {
-}
+ : type(static_cast<Popup_Menu_Item_Type>(item.type)),
+ textDirection(item.rtl ? blink::kWebTextDirectionRightToLeft
+ : blink::kWebTextDirectionLeftToRight),
+ hasTextDirectionOverride(item.has_directional_override),
+ isEnabled(item.enabled),
+ isLabel(true),
+ isSelected(item.checked),
+ text(base::UTF16ToUTF8(item.label)),
+ toolTip(base::UTF16ToUTF8(item.tool_tip)),
+ accessibilityText(base::UTF16ToUTF8(item.label)) {}
Popup_Menu_Item_Type popup_menu_item_type_get(const Popup_Menu_Item* item) {
- EINA_SAFETY_ON_NULL_RETURN_VAL(item, POPUP_MENU_UNKNOWN);
+ EINA_SAFETY_ON_NULL_RETURN_VAL(item, POPUP_MENU_UNKNOWN);
- return item->type;
+ return item->type;
}
const char* popup_menu_item_text_get(const Popup_Menu_Item* item) {
- EINA_SAFETY_ON_NULL_RETURN_VAL(item, 0);
+ EINA_SAFETY_ON_NULL_RETURN_VAL(item, 0);
- return item->text.c_str();
+ return item->text.c_str();
}
-blink::WebTextDirection popup_menu_item_text_direction_get(const Popup_Menu_Item* item) {
- EINA_SAFETY_ON_NULL_RETURN_VAL(item, blink::WebTextDirectionLeftToRight);
+blink::WebTextDirection popup_menu_item_text_direction_get(
+ const Popup_Menu_Item* item) {
+ EINA_SAFETY_ON_NULL_RETURN_VAL(item, blink::kWebTextDirectionLeftToRight);
- return item->textDirection;
+ return item->textDirection;
}
-Eina_Bool popup_menu_item_text_direction_override_get(const Popup_Menu_Item* item) {
- EINA_SAFETY_ON_NULL_RETURN_VAL(item, false);
+Eina_Bool popup_menu_item_text_direction_override_get(
+ const Popup_Menu_Item* item) {
+ EINA_SAFETY_ON_NULL_RETURN_VAL(item, false);
- return item->hasTextDirectionOverride;
+ return item->hasTextDirectionOverride;
}
const char* popup_menu_item_tooltip_get(const Popup_Menu_Item* item) {
- EINA_SAFETY_ON_NULL_RETURN_VAL(item, 0);
+ EINA_SAFETY_ON_NULL_RETURN_VAL(item, 0);
- return item->toolTip.c_str();
+ return item->toolTip.c_str();
}
-const char* popup_menu_item_accessibility_text_get(const Popup_Menu_Item* item) {
- EINA_SAFETY_ON_NULL_RETURN_VAL(item, 0);
+const char* popup_menu_item_accessibility_text_get(
+ const Popup_Menu_Item* item) {
+ EINA_SAFETY_ON_NULL_RETURN_VAL(item, 0);
- return item->accessibilityText.c_str();
+ return item->accessibilityText.c_str();
}
Eina_Bool popup_menu_item_enabled_get(const Popup_Menu_Item* item) {
- EINA_SAFETY_ON_NULL_RETURN_VAL(item, false);
+ EINA_SAFETY_ON_NULL_RETURN_VAL(item, false);
- return item->isEnabled;
+ return item->isEnabled;
}
Eina_Bool popup_menu_item_is_label_get(const Popup_Menu_Item* item) {
- EINA_SAFETY_ON_NULL_RETURN_VAL(item, false);
+ EINA_SAFETY_ON_NULL_RETURN_VAL(item, false);
- return item->isLabel;
+ return item->isLabel;
}
Eina_Bool popup_menu_item_selected_get(const Popup_Menu_Item* item) {
- EINA_SAFETY_ON_NULL_RETURN_VAL(item, false);
+ EINA_SAFETY_ON_NULL_RETURN_VAL(item, false);
- return item->isSelected;
+ return item->isSelected;
}
#include <Eina.h>
#include <string>
-#include "third_party/WebKit/public/web/WebTextDirection.h"
+#include "third_party/blink/public/web/WebTextDirection.h"
#ifdef __cplusplus
extern "C" {
#include "popup_menu_item.h"
#include "content/public/common/menu_item.h"
-#include "third_party/WebKit/public/web/WebTextDirection.h"
+#include "third_party/blink/public/web/WebTextDirection.h"
#include <string>
}
void SSLHostStateDelegateEfl::HostRanInsecureContent(const std::string& host,
- int pid) {
+ int child_id,
+ InsecureContentType content_type) {
// Intentional no-op for efl WebView.
}
bool SSLHostStateDelegateEfl::DidHostRunInsecureContent(const std::string& host,
- int pid) const {
+ int child_id,
+ InsecureContentType content_type) const {
// Intentional no-op for efl WebView.
return false;
}
cert_policy_for_host_[host].Allow(cert, error);
}
-void SSLHostStateDelegateEfl::Clear() {
+void SSLHostStateDelegateEfl::Clear(
+ const base::Callback<bool(const std::string&)>& host_filter) {
cert_policy_for_host_.clear();
}
const net::X509Certificate& cert,
net::CertStatus error) override;
- void Clear() override;
+ void Clear(const base::Callback<bool(const std::string&)>& host_filter) override;
// Queries whether |cert| is allowed or denied for |host| and |error|.
content::SSLHostStateDelegate::CertJudgment QueryPolicy(
bool* expired_previous_decision) override;
// Records that a host has run insecure content.
- void HostRanInsecureContent(const std::string& host, int pid) override;
+ void HostRanInsecureContent(const std::string& host,
+ int child_id,
+ InsecureContentType content_type) override;
// Returns whether the specified host ran insecure content.
bool DidHostRunInsecureContent(const std::string& host,
- int pid) const override;
+ int child_id,
+ InsecureContentType content_type) const override;
// Revokes all SSL certificate error allow exceptions made by the user for
// |host|.
WebDataService::WebDataService(scoped_refptr<WebDatabaseService> wdbs,
const ProfileErrorCallback& callback)
: WebDataServiceBase(wdbs, callback,
- BrowserThread::GetMessageLoopProxyForThread(BrowserThread::UI)) {
+ BrowserThread::GetTaskRunnerForThread(BrowserThread::UI)) {
}
WebDataService::WebDataService()
: WebDataServiceBase(NULL, ProfileErrorCallback(),
- BrowserThread::GetMessageLoopProxyForThread(BrowserThread::UI)) {
+ BrowserThread::GetTaskRunnerForThread(BrowserThread::UI)) {
}
WebDataService::~WebDataService() {
web_database_ =
new WebDatabaseService(
path,
- BrowserThread::GetMessageLoopProxyForThread(BrowserThread::UI),
- BrowserThread::GetMessageLoopProxyForThread(BrowserThread::DB));
+ BrowserThread::GetTaskRunnerForThread(BrowserThread::UI),
+ BrowserThread::GetTaskRunnerForThread(BrowserThread::DB));
// All tables objects that participate in managing the database must
// be added here.
autofill_web_data_ =
new AutofillWebDataService(
web_database_,
- BrowserThread::GetMessageLoopProxyForThread(BrowserThread::UI),
- BrowserThread::GetMessageLoopProxyForThread(BrowserThread::DB),
+ BrowserThread::GetTaskRunnerForThread(BrowserThread::UI),
+ BrowserThread::GetTaskRunnerForThread(BrowserThread::DB),
base::Bind(&ProfileErrorCallback, 0));
autofill_web_data_->Init();
#include "browser/geolocation/geolocation_permission_context_efl.h"
#include "browser/permission_manager_efl.h"
#include "browser/webdata/web_data_service_factory.h"
-#include "browser/scoped_allow_wait_for_legacy_web_view_api.h"
#include "components/autofill/core/browser/personal_data_manager.h"
#include "components/autofill/core/common/autofill_pref_names.h"
#include "components/password_manager/core/common/password_manager_pref_names.h"
NOTIMPLEMENTED();
}
-} // namespace
+} // namespace
namespace content {
completion->Signal();
}
-BrowserContextEfl::ResourceContextEfl::ResourceContextEfl(scoped_refptr<CookieManager> cookie_manager)
- : getter_(NULL),
- cookie_manager_(cookie_manager) {
-}
+BrowserContextEfl::ResourceContextEfl::ResourceContextEfl(
+ scoped_refptr<CookieManager> cookie_manager)
+ : getter_(NULL), cookie_manager_(cookie_manager) {}
BrowserContextEfl::~BrowserContextEfl() {
#if defined(TIZEN_AUTOFILL_SUPPORT)
}
}
-BrowserContextEfl::ResourceContextEfl::~ResourceContextEfl() {
-}
+BrowserContextEfl::ResourceContextEfl::~ResourceContextEfl() {}
bool BrowserContextEfl::ResourceContextEfl::HTTPCustomHeaderAdd(
- const std::string& name, const std::string& value) {
+ const std::string& name,
+ const std::string& value) {
if (name.empty())
return false;
base::AutoLock locker(http_custom_headers_lock_);
- return http_custom_headers_.insert(
- std::make_pair(name, value)).second;
+ return http_custom_headers_.insert(std::make_pair(name, value)).second;
}
bool BrowserContextEfl::ResourceContextEfl::HTTPCustomHeaderRemove(
}
const HTTPCustomHeadersEflMap
- BrowserContextEfl::ResourceContextEfl::GetHTTPCustomHeadersEflMap() const {
+BrowserContextEfl::ResourceContextEfl::GetHTTPCustomHeadersEflMap() const {
base::AutoLock locker(http_custom_headers_lock_);
return http_custom_headers_;
}
-
net::HostResolver* BrowserContextEfl::ResourceContextEfl::GetHostResolver() {
CHECK(getter_.get());
return getter_->host_resolver();
}
-net::URLRequestContext* BrowserContextEfl::ResourceContextEfl::GetRequestContext() {
+net::URLRequestContext*
+BrowserContextEfl::ResourceContextEfl::GetRequestContext() {
CHECK(getter_.get());
return getter_->GetURLRequestContext();
}
return request_context_getter_.get();
}
-net::URLRequestContextGetter* BrowserContextEfl::CreateMediaRequestContextForStoragePartition(const base::FilePath&, bool) {
+net::URLRequestContextGetter*
+BrowserContextEfl::CreateMediaRequestContextForStoragePartition(
+ const base::FilePath&,
+ bool) {
return nullptr;
}
}
BrowserContextEfl::BrowserContextEfl(EWebContext* web_context, bool incognito)
- : resource_context_(NULL),
- web_context_(web_context),
- temp_dir_creation_attempted_(false),
- incognito_(incognito) {
+ : resource_context_(NULL),
+ web_context_(web_context),
+ temp_dir_creation_attempted_(false),
+ incognito_(incognito) {
InitVisitedLinkMaster();
PrefRegistrySimple* pref_registry = new PrefRegistrySimple();
pref_registry->RegisterBooleanPref(kAutofillEnabled, true);
pref_registry->RegisterBooleanPref(kAutofillWalletImportEnabled, true);
- pref_registry->RegisterBooleanPref(kPasswordManagerSavingEnabled, true);
+ pref_registry->RegisterBooleanPref(kCredentialsEnableService, true);
PrefServiceFactory pref_service_factory;
- pref_service_factory.set_user_prefs(make_scoped_refptr(new InMemoryPrefStore()));
+ pref_service_factory.set_user_prefs(base::MakeRefCounted<InMemoryPrefStore>());
pref_service_factory.set_read_error_callback(base::Bind(&HandleReadError));
user_pref_service_ = std::move(pref_service_factory.Create(pref_registry));
user_prefs::UserPrefs::Set(this, user_pref_service_.get());
#if defined(TIZEN_AUTOFILL_SUPPORT)
- autofill::PersonalDataManagerFactory::GetInstance()
- ->PersonalDataManagerAdd(this);
+ autofill::PersonalDataManagerFactory::GetInstance()->PersonalDataManagerAdd(
+ this);
#endif
BrowserContext::Initialize(this, GetPath());
}
return GetResourceContextEfl();
}
-BrowserContextEfl::ResourceContextEfl* BrowserContextEfl::GetResourceContextEfl() {
+BrowserContextEfl::ResourceContextEfl*
+BrowserContextEfl::GetResourceContextEfl() {
if (!resource_context_) {
resource_context_ = new ResourceContextEfl(web_context_->cookieManager());
}
// NetWorkDelegate must be created on IO thread
base::WaitableEvent done(base::WaitableEvent::ResetPolicy::AUTOMATIC,
base::WaitableEvent::InitialState::NOT_SIGNALED);
- BrowserThread::PostTask(BrowserThread::IO, FROM_HERE,
- base::Bind(CreateNetworkDelegateOnIOThread, this, &done));
- ScopedAllowWaitForLegacyWebViewApi allow_wait;
+ BrowserThread::PostTask(
+ BrowserThread::IO, FROM_HERE,
+ base::Bind(CreateNetworkDelegateOnIOThread, this, &done));
done.Wait();
}
request_context_getter_ = new URLRequestContextGetterEfl(
std::move(network_delegate_for_getter_), false, cache_base_path,
- BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO),
- BrowserThread::GetMessageLoopProxyForThread(BrowserThread::FILE),
+ BrowserThread::GetTaskRunnerForThread(BrowserThread::IO),
+ BrowserThread::GetTaskRunnerForThread(BrowserThread::FILE),
protocol_handlers, std::move(request_interceptors), NULL);
web_context_->cookieManager()->SetRequestContextGetter(
request_context_getter_);
base::FilePath* certificate_path = new base::FilePath(certificate_file);
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
BrowserThread::PostTask(BrowserThread::FILE, FROM_HERE,
- base::Bind(&BrowserContextEfl::ReadCertificateAndAdd, base::Owned(certificate_path)));
+ base::Bind(&BrowserContextEfl::ReadCertificateAndAdd,
+ base::Owned(certificate_path)));
}
void BrowserContextEfl::ReadCertificateAndAdd(base::FilePath* file_path) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE));
std::string cert_contents;
base::ReadFileToString(*file_path, &cert_contents);
- scoped_refptr<net::X509Certificate> cert(net::X509Certificate::CreateFromBytes(
- cert_contents.c_str(), cert_contents.size()));
+ scoped_refptr<net::X509Certificate> cert(
+ net::X509Certificate::CreateFromBytes(cert_contents.c_str(),
+ cert_contents.size()));
if (!cert.get()) {
DLOG(ERROR) << "User certificate could not be parsed.";
return;
}
+#if !defined(EWK_BRINGUP) // FIXME: m67 bringup
+ // FIXME: EWK_BRINGUP definition should be removed.
int err_code = net::CertDatabase::GetInstance()->CheckUserCert(cert.get());
if (net::OK != err_code) {
DLOG(ERROR) << "User certificate is not valid. Error code : " << err_code;
}
err_code = net::CertDatabase::GetInstance()->AddUserCert(cert.get());
if (net::OK != err_code) {
- DLOG(ERROR) << "User certificate could not be added. Error code : " << err_code;
+ DLOG(ERROR) << "User certificate could not be added. Error code : "
+ << err_code;
return;
}
+#endif // !defined(EWK_BRINGUP)
}
void BrowserContextEfl::InitVisitedLinkMaster() {
if (!IsOffTheRecord()) {
- visitedlink_master_.reset(new visitedlink::VisitedLinkMaster(this, this, false));
+ visitedlink_master_.reset(
+ new visitedlink::VisitedLinkMaster(this, this, false));
visitedlink_master_->Init();
}
}
}
}
-void BrowserContextEfl::RebuildTable(const scoped_refptr<URLEnumerator>& enumerator) {
+void BrowserContextEfl::RebuildTable(
+ const scoped_refptr<URLEnumerator>& enumerator) {
if (!IsOffTheRecord()) {
// WebView rebuilds from WebChromeClient.getVisitedHistory. The client
// can change in the lifetime of this WebView and may not yet be set here.
}
const GeolocationPermissionContextEfl&
- BrowserContextEfl::GetGeolocationPermissionContext() const {
+BrowserContextEfl::GetGeolocationPermissionContext() const {
if (!geolocation_permission_context_.get()) {
geolocation_permission_context_.reset(
new GeolocationPermissionContextEfl());
return *(geolocation_permission_context_.get());
}
+BackgroundFetchDelegate* BrowserContextEfl::GetBackgroundFetchDelegate() {
+ return nullptr;
+}
+
+BrowsingDataRemoverDelegate* BrowserContextEfl::GetBrowsingDataRemoverDelegate() {
+ return nullptr;
+}
}
namespace content {
-class BrowserContextEfl
- : public BrowserContext,
- public visitedlink::VisitedLinkDelegate {
+class BrowserContextEfl : public BrowserContext,
+ public visitedlink::VisitedLinkDelegate {
public:
class ResourceContextEfl : public ResourceContext {
public:
ResourceContextEfl(scoped_refptr<CookieManager> cookie_manager);
- virtual ~ResourceContextEfl();
+ ~ResourceContextEfl();
bool HTTPCustomHeaderAdd(const std::string& name, const std::string& value);
bool HTTPCustomHeaderRemove(const std::string& name);
void HTTPCustomHeaderClear();
const HTTPCustomHeadersEflMap GetHTTPCustomHeadersEflMap() const;
-
- virtual net::HostResolver* GetHostResolver() override;
- virtual net::URLRequestContext* GetRequestContext() override;
+ net::HostResolver* GetHostResolver() override;
+ net::URLRequestContext* GetRequestContext() override;
void set_url_request_context_getter(URLRequestContextGetterEfl* getter);
scoped_refptr<CookieManager> GetCookieManager() const;
BrowserContextEfl(EWebContext*, bool incognito = false);
~BrowserContextEfl();
+ // BrowserContext implementation.
net::URLRequestContextGetter* CreateMediaRequestContext() override;
- net::URLRequestContextGetter* CreateMediaRequestContextForStoragePartition(const base::FilePath&, bool) override;
- virtual std::unique_ptr<ZoomLevelDelegate> CreateZoomLevelDelegate(
- const base::FilePath& partition_path);
- virtual bool IsOffTheRecord() const override { return incognito_; }
- URLRequestContextGetterEfl* GetRequestContextEfl()
- { return request_context_getter_.get(); }
+ net::URLRequestContextGetter* CreateMediaRequestContextForStoragePartition(
+ const base::FilePath&,
+ bool) override;
+ bool IsOffTheRecord() const override { return incognito_; }
- // These methods map to Add methods in visitedlink::VisitedLinkMaster.
- void AddVisitedURLs(const std::vector<GURL>& urls);
// visitedlink::VisitedLinkDelegate implementation.
- virtual void RebuildTable(
- const scoped_refptr<URLEnumerator>& enumerator) override;
- // Reset visitedlink master and initialize it.
- void InitVisitedLinkMaster();
-
- virtual ResourceContext* GetResourceContext() override;
-
- virtual content::DownloadManagerDelegate* GetDownloadManagerDelegate() override
- { return &download_manager_delegate_; }
+ void RebuildTable(const scoped_refptr<URLEnumerator>& enumerator) override;
- virtual BrowserPluginGuestManager* GetGuestManager() override
- { return 0; }
- virtual ResourceContextEfl* GetResourceContextEfl();
-
- virtual storage::SpecialStoragePolicy* GetSpecialStoragePolicy() override
- { return 0; }
+ ResourceContext* GetResourceContext() override;
+ content::DownloadManagerDelegate* GetDownloadManagerDelegate() override {
+ return &download_manager_delegate_;
+ }
+ BrowserPluginGuestManager* GetGuestManager() override { return 0; }
+ storage::SpecialStoragePolicy* GetSpecialStoragePolicy() override {
+ return 0;
+ }
+ PushMessagingService* GetPushMessagingService() override { return 0; }
+ base::FilePath GetPath() const override;
+ PermissionManager* GetPermissionManager() override;
+ BackgroundSyncController* GetBackgroundSyncController() override;
+ net::URLRequestContextGetter* CreateRequestContextForStoragePartition(
+ const base::FilePath& partition_path,
+ bool in_memory,
+ ProtocolHandlerMap* protocol_handlers,
+ URLRequestInterceptorScopedVector request_interceptors) override {
+ return nullptr;
+ }
+ BackgroundFetchDelegate* GetBackgroundFetchDelegate() override;
+ BrowsingDataRemoverDelegate* GetBrowsingDataRemoverDelegate() override;
- virtual PushMessagingService* GetPushMessagingService() override
- { return 0; }
+ std::unique_ptr<ZoomLevelDelegate> CreateZoomLevelDelegate(
+ const base::FilePath& partition_path);
+ URLRequestContextGetterEfl* GetRequestContextEfl() {
+ return request_context_getter_.get();
+ }
- virtual const GeolocationPermissionContextEfl&
- GetGeolocationPermissionContext() const;
+ // These methods map to Add methods in visitedlink::VisitedLinkMaster.
+ void AddVisitedURLs(const std::vector<GURL>& urls);
- virtual base::FilePath GetPath() const override;
+ // Reset visitedlink master and initialize it.
+ void InitVisitedLinkMaster();
- virtual PermissionManager* GetPermissionManager() override;
+ ResourceContextEfl* GetResourceContextEfl();
- virtual BackgroundSyncController* GetBackgroundSyncController() override;
+ const GeolocationPermissionContextEfl& GetGeolocationPermissionContext()
+ const;
net::URLRequestContextGetter* CreateRequestContext(
content::ProtocolHandlerMap* protocol_handlers,
URLRequestInterceptorScopedVector request_interceptors);
- virtual net::URLRequestContextGetter* CreateRequestContextForStoragePartition(
- const base::FilePath& partition_path,
- bool in_memory,
- ProtocolHandlerMap* protocol_handlers,
- URLRequestInterceptorScopedVector request_interceptors) override {
- return nullptr;
- }
-
void SetCertificate(const char* certificate_file);
- EWebContext* WebContext() const
- { return web_context_; }
+ EWebContext* WebContext() const { return web_context_; }
void CreateNetworkDelegate();
private:
static void ReadCertificateAndAdd(base::FilePath* file_path);
- virtual SSLHostStateDelegate* GetSSLHostStateDelegate() override;
+ SSLHostStateDelegate* GetSSLHostStateDelegate() override;
mutable std::unique_ptr<GeolocationPermissionContextEfl>
geolocation_permission_context_;
std::unique_ptr<visitedlink::VisitedLinkMaster> visitedlink_master_;
DISALLOW_COPY_AND_ASSIGN(BrowserContextEfl);
};
-
}
#endif
#include "base/command_line.h"
#include "content/public/common/content_switches.h"
-using devtools_http_handler::DevToolsDelegateEfl;
+using content::DevToolsDelegateEfl;
namespace content {
#include "base/macros.h"
#include "content/public/browser/browser_main_parts.h"
-namespace devtools_http_handler {
-class DevToolsDelegateEfl;
-}
-
namespace content {
+class DevToolsDelegateEfl;
+
// EFL port implementation of BrowserMainParts.
// This class contains different "stages" to be executed by BrowserMain(),
// Each stage is represented by a single BrowserMainParts method, called from
virtual void PostMainMessageLoopRun() override;
private:
- devtools_http_handler::DevToolsDelegateEfl* devtools_delegate_;
+ content::DevToolsDelegateEfl* devtools_delegate_;
DISALLOW_COPY_AND_ASSIGN(BrowserMainPartsEfl);
};
std::string linkTitle; // the title of link
std::string linkLabel; // the text of the link
std::string imageURI;
- std::string mediaURI;
bool isEditable;
int mode;
#include "common/navigation_policy_params.h"
-#include "third_party/WebKit/public/web/WebNavigationPolicy.h"
+#include "third_party/blink/public/web/WebNavigationPolicy.h"
NavigationPolicyParams::NavigationPolicyParams()
: render_view_id(-1)
- , policy(blink::WebNavigationPolicyIgnore)
- , type(blink::WebNavigationTypeOther)
+ , policy(blink::kWebNavigationPolicyIgnore)
+ , type(blink::kWebNavigationTypeOther)
, should_replace_current_entry(false)
, is_main_frame(false)
, is_redirect(false) {
#define POLICY_NAVIGATION_PARAMS_H_
#include "content/public/common/referrer.h"
-#include "third_party/WebKit/public/web/WebNavigationPolicy.h"
-#include "third_party/WebKit/public/web/WebNavigationType.h"
-#include "third_party/WebKit/public/platform/WebString.h"
+#include "third_party/blink/public/web/WebNavigationPolicy.h"
+#include "third_party/blink/public/web/WebNavigationType.h"
+#include "third_party/blink/public/platform/WebString.h"
#include "url/gurl.h"
struct NavigationPolicyParams {
desired_dpi(0),
is_first_request(true),
print_to_pdf(true),
- print_scaling_option(blink::WebPrintScalingOptionSourceSize),
+ print_scaling_option(blink::kWebPrintScalingOptionSourceSize),
document_cookie(0) {
}
#include "base/files/file_path.h"
#include "base/memory/shared_memory.h"
#include "printing/printing_export.h"
-#include "third_party/WebKit/public/web/WebPrintScalingOption.h"
+#include "third_party/blink/public/web/WebPrintScalingOption.h"
#include "ui/gfx/geometry/rect.h"
#include "ui/gfx/geometry/size.h"
#include "private/ewk_wrt_private.h"
#include "public/ewk_hit_test.h"
#include "public/ewk_view.h"
-#include "third_party/WebKit/public/web/WebNavigationPolicy.h"
-#include "third_party/WebKit/public/web/WebNavigationType.h"
-#include "third_party/WebKit/public/web/WebViewModeEnums.h"
+#include "third_party/blink/public/web/WebNavigationPolicy.h"
+#include "third_party/blink/public/web/WebNavigationType.h"
+#include "third_party/blink/public/web/WebViewModeEnums.h"
#include "ipc_message_start_ewk.h"
typedef std::map<std::string, std::string> StringMap;
IPC_STRUCT_TRAITS_MEMBER(linkTitle)
IPC_STRUCT_TRAITS_MEMBER(linkLabel)
IPC_STRUCT_TRAITS_MEMBER(imageURI)
- IPC_STRUCT_TRAITS_MEMBER(mediaURI)
IPC_STRUCT_TRAITS_MEMBER(isEditable)
IPC_STRUCT_TRAITS_MEMBER(mode)
IPC_STRUCT_TRAITS_MEMBER(nodeData)
NavigationPolicyParams,
bool /*handled*/)
+// FIXME: error: ‘WebNavigationTypeOther’ is not a member of ‘blink’
IPC_MESSAGE_ROUTED1(ViewMsg_SetViewMode,
blink::WebViewMode /* view_mode */)
// if the browser supports the WebRTC feature.
// TODO(max koo): Do we need to open our real version number
// or just use Chrome/aa.bb.cc.dd as Chromium/Chrome do?
- return std::string("Chrome/") + CHROMIUM_VERSION;
+ // TODO(suchit): Need to fix for chromium version in gn file
+ return std::string("Chrome/") /*+ CHROMIUM_VERSION*/;
}
std::string VersionInfo::DefaultUserAgent() const {
return WebContents::FromRenderViewHost(render_view_host);
}
+EWebView* WebViewFromFrameId(int render_process_id, int render_frame_id) {
+ content::WebContents* web_contents =
+ web_contents_utils::WebContentsFromFrameID(render_process_id,
+ render_frame_id);
+ if (!web_contents)
+ return NULL;
+ return WebViewFromWebContents(web_contents);
+}
+
EWebView* WebViewFromViewId(int render_process_id, int render_view_id) {
content::WebContents* web_contents =
web_contents_utils::WebContentsFromViewID(render_process_id,
return strncmp(keyname, "Escape", 6) == 0;
}
-} // namespace web_contents_utils
+} // namespace web_contents_utils
namespace content {
class WebContents;
-} // namespace content
+} // namespace content
namespace web_contents_utils {
content::WebContents* WebContentsFromViewID(int render_process_id,
int render_view_id);
content::WebContents* WebContentsFromFrameID(int render_process_id,
int render_frame_id);
-EWebView* WebViewFromViewId(int render_process_id,
- int render_view_id);
+EWebView* WebViewFromFrameId(int render_process_id, int render_frame_id);
+EWebView* WebViewFromViewId(int render_process_id, int render_view_id);
EWebView* WebViewFromWebContents(const content::WebContents*);
bool MapsToHWBackKey(const char* keyname);
-} // namespace web_contents_utils
-#endif // WEB_CONTENTS_UTILS_H
+} // namespace web_contents_utils
+#endif // WEB_CONTENTS_UTILS_H
namespace content {
ContentBrowserClientEfl::ContentBrowserClientEfl()
- : browser_main_parts_efl_(nullptr)
+ : browser_main_parts_efl_(nullptr)
#if defined(ENABLE_NOTIFICATIONS)
- , notification_controller_(new NotificationControllerEfl)
+ , notification_controller_(new NotificationControllerEfl)
#endif
{
}
return browser_main_parts_efl_;
}
-void ContentBrowserClientEfl::AppendExtraCommandLineSwitches(base::CommandLine* command_line,
+void ContentBrowserClientEfl::AppendExtraCommandLineSwitches(
+ base::CommandLine* command_line,
int child_process_id) {
if (command_line->HasSwitch(switches::kProcessType)) {
- std::string processType = command_line->
- GetSwitchValueASCII(switches::kProcessType);
+ std::string processType =
+ command_line->GetSwitchValueASCII(switches::kProcessType);
if (processType == switches::kRendererProcess) {
if (content::RenderProcessHost* host =
content::RenderProcessHost::FromID(child_process_id)) {
- if (EWebContext* context = static_cast<BrowserContextEfl*>(
- host->GetBrowserContext())->WebContext()) {
+ if (EWebContext* context =
+ static_cast<BrowserContextEfl*>(host->GetBrowserContext())
+ ->WebContext()) {
const std::string& injectedBundlePath =
context->GetInjectedBundlePath();
if (!injectedBundlePath.empty()) {
- command_line->AppendSwitchASCII(
- switches::kInjectedBundlePath, injectedBundlePath);
+ command_line->AppendSwitchASCII(switches::kInjectedBundlePath,
+ injectedBundlePath);
const std::string& tizen_id = context->GetTizenId();
- command_line->AppendSwitchASCII(
- switches::kTizenId, tizen_id);
+ command_line->AppendSwitchASCII(switches::kTizenId, tizen_id);
double scale = context->GetWidgetScale();
- command_line->AppendSwitchASCII(
- switches::kWidgetScale, base::DoubleToString(scale));
+ command_line->AppendSwitchASCII(switches::kWidgetScale,
+ base::DoubleToString(scale));
- const std::string& widget_theme =
- context->GetWidgetTheme();
- command_line->AppendSwitchASCII(
- switches::kWidgetTheme, widget_theme);
+ const std::string& widget_theme = context->GetWidgetTheme();
+ command_line->AppendSwitchASCII(switches::kWidgetTheme,
+ widget_theme);
const std::string& widget_encoded_bundle =
context->GetWidgetEncodedBundle();
- command_line->AppendSwitchASCII(
- switches::kWidgetEncodedBundle,
- widget_encoded_bundle);
+ command_line->AppendSwitchASCII(switches::kWidgetEncodedBundle,
+ widget_encoded_bundle);
}
}
}
}
bool ContentBrowserClientEfl::CanCreateWindow(
+ RenderFrameHost* opener,
const GURL& opener_url,
const GURL& opener_top_level_frame_url,
const GURL& source_origin,
- WindowContainerType container_type,
+ content::mojom::WindowContainerType container_type,
const GURL& target_url,
const Referrer& referrer,
+ const std::string& frame_name,
WindowOpenDisposition disposition,
- const blink::WebWindowFeatures& features,
+ const blink::mojom::WindowFeatures& features,
bool user_gesture,
bool opener_suppressed,
- ResourceContext* context,
- int render_process_id,
- int opener_render_view_id,
- int opener_render_frame_id,
bool* no_javascript_access) {
+#if !defined(EWK_BRINGUP) // FIXME: m67 bringup
if (!user_gesture) {
*no_javascript_access = true;
- BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, base::Bind(
- &ContentBrowserClientEfl::DispatchPopupBlockedOnUIThread,
- render_process_id, target_url));
+ BrowserThread::PostTask(
+ BrowserThread::UI, FROM_HERE,
+ base::Bind(&ContentBrowserClientEfl::DispatchPopupBlockedOnUIThread,
+ render_process_id, target_url));
return false;
}
+#endif
// TODO: shouldn't we call policy,decision,new,window smart callback here?
}
void ContentBrowserClientEfl::DispatchPopupBlockedOnUIThread(
- int render_process_id, const GURL &target_url) {
+ int render_process_id,
+ const GURL& target_url) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
std::unique_ptr<RenderWidgetHostIterator> widgets(
if (!content)
return;
- EWebView *wv = WebViewFromWebContents(content);
- wv->SmartCallback<EWebViewCallbacks::PopupBlocked>().
- call(target_url.spec().c_str());
+ EWebView* wv = WebViewFromWebContents(content);
+ wv->SmartCallback<EWebViewCallbacks::PopupBlocked>().call(
+ target_url.spec().c_str());
}
void ContentBrowserClientEfl::ResourceDispatcherHostCreated() {
const net::SSLInfo& ssl_info,
const GURL& request_url,
ResourceType resource_type,
- bool overridable,
bool strict_enforcement,
bool expired_previous_decision,
- const base::Callback<void(bool)>& callback,
- CertificateRequestResultType* result) {
+ const base::Callback<void(CertificateRequestResultType)>& callback) {
DCHECK(web_contents);
- WebContentsDelegate * delegate = web_contents->GetDelegate();
+ WebContentsDelegate* delegate = web_contents->GetDelegate();
if (!delegate) {
+#if !defined(EWK_BRINGUP) // FIXME: m67 bringup
+ // FIXME: EWK_BRINGUP definition should be removed.
callback.Run(NULL);
+#endif // !defined(EWK_BRINGUP)
return;
}
- static_cast<content::WebContentsDelegateEfl*>(delegate)->
- RequestCertificateConfirm(web_contents, cert_error, ssl_info, request_url,
- resource_type, overridable, strict_enforcement, callback, result);
+#if !defined(EWK_BRINGUP) // FIXME: m67 bringup
+ // FIXME: EWK_BRINGUP definition should be removed.
+ static_cast<content::WebContentsDelegateEfl*>(delegate)
+ ->RequestCertificateConfirm(web_contents, cert_error, ssl_info,
+ request_url, resource_type, overridable,
+ strict_enforcement, callback);
+#endif // !defined(EWK_BRINGUP)
}
#if defined(ENABLE_NOTIFICATIONS)
-PlatformNotificationService* ContentBrowserClientEfl::GetPlatformNotificationService() {
+PlatformNotificationService*
+ContentBrowserClientEfl::GetPlatformNotificationService() {
return notification_controller_.get();
}
-NotificationControllerEfl* ContentBrowserClientEfl::GetNotificationController() const {
+NotificationControllerEfl* ContentBrowserClientEfl::GetNotificationController()
+ const {
return notification_controller_.get();
}
#endif
if (!cookie_manager.get())
return false;
- return cookie_manager->AllowGetCookie(url,
- first_party,
- cookie_list,
- context,
- render_process_id,
- render_frame_id);
+ return cookie_manager->AllowGetCookie(url, first_party, cookie_list, context,
+ render_process_id, render_frame_id);
}
bool ContentBrowserClientEfl::AllowSetCookie(
if (!cookie_manager.get())
return false;
- return cookie_manager->AllowSetCookie(url,
- first_party,
- cookie_line,
- context,
- render_process_id,
- render_frame_id,
+ return cookie_manager->AllowSetCookie(url, first_party, cookie_line, context,
+ render_process_id, render_frame_id,
options);
}
return;
std::string pem_certificate;
- if (!net::X509Certificate::GetPEMEncoded(
- ssl_info.cert->os_cert_handle(), &pem_certificate))
+ if (!net::X509Certificate::GetPEMEncoded(ssl_info.cert->os_cert_handle(),
+ &pem_certificate))
return;
- BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, base::Bind(
- &ContentBrowserClientEfl::SetCertificatePemOnUIThread,
- render_process_id, render_view_id, pem_certificate));
+ BrowserThread::PostTask(
+ BrowserThread::UI, FROM_HERE,
+ base::Bind(&ContentBrowserClientEfl::SetCertificatePemOnUIThread,
+ render_process_id, render_view_id, pem_certificate));
}
void ContentBrowserClientEfl::SetCertificatePemOnUIThread(
- int render_process_id, int render_view_id, std::string certificate) {
- WebContents* web_contents = WebContentsFromViewID(
- render_process_id, render_view_id);
+ int render_process_id,
+ int render_view_id,
+ std::string certificate) {
+ WebContents* web_contents =
+ WebContentsFromViewID(render_process_id, render_view_id);
if (!web_contents)
return;
- EWebView *wv = WebViewFromWebContents(web_contents);
+ EWebView* wv = WebViewFromWebContents(web_contents);
wv->SetCertificatePem(certificate);
}
-content::DevToolsManagerDelegate* ContentBrowserClientEfl::GetDevToolsManagerDelegate() {
+content::DevToolsManagerDelegate*
+ContentBrowserClientEfl::GetDevToolsManagerDelegate() {
+#if !defined(EWK_BRINGUP) // FIXME: m67 bringup
+ // FIXME: EWK_BRINGUP definition should be removed.
return new DevToolsManagerDelegateEfl();
+#endif // !defined(EWK_BRINGUP)
}
std::string ContentBrowserClientEfl::GetApplicationLocale() {
return new WebContentsViewDelegateEwk(WebViewFromWebContents(web_contents));
}
-QuotaPermissionContext* ContentBrowserClientEfl::CreateQuotaPermissionContext() {
+QuotaPermissionContext*
+ContentBrowserClientEfl::CreateQuotaPermissionContext() {
return new QuotaPermissionContextEfl();
}
-
}
#include "content/public/browser/browser_context.h"
#include "content/public/browser/content_browser_client.h"
+#include "third_party/blink/public/web/WebWindowFeatures.h"
namespace base {
class CommandLine;
class WebContents;
class WebContentsView;
-class ContentBrowserClientEfl: public ContentBrowserClient {
+class ContentBrowserClientEfl : public ContentBrowserClient {
public:
typedef void (*Notification_Show_Callback)(Ewk_Notification*, void*);
typedef void (*Notification_Cancel_Callback)(uint64_t, void*);
virtual void AppendExtraCommandLineSwitches(base::CommandLine* command_line,
int child_process_id) override;
- bool CanCreateWindow(const GURL& opener_url,
+ bool CanCreateWindow(RenderFrameHost* opener,
+ const GURL& opener_url,
const GURL& opener_top_level_frame_url,
const GURL& source_origin,
- WindowContainerType container_type,
+ content::mojom::WindowContainerType container_type,
const GURL& target_url,
const Referrer& referrer,
+ const std::string& frame_name,
WindowOpenDisposition disposition,
- const blink::WebWindowFeatures& features,
+ const blink::mojom::WindowFeatures& features,
bool user_gesture,
bool opener_suppressed,
- ResourceContext* context,
- int render_process_id,
- int opener_render_view_id,
- int opener_render_frame_id,
bool* no_javascript_access) override;
virtual void ResourceDispatcherHostCreated() override;
const net::SSLInfo& ssl_info,
const GURL& request_url,
ResourceType resource_type,
- bool overridable,
bool strict_enforcement,
bool expired_previous_decision,
- const base::Callback<void(bool)>& callback,
- CertificateRequestResultType* result) override;
+ const base::Callback<void(CertificateRequestResultType)>& callback)
+ override;
#if defined(ENABLE_NOTIFICATIONS)
- virtual PlatformNotificationService* GetPlatformNotificationService() override;
+ virtual PlatformNotificationService* GetPlatformNotificationService()
+ override;
NotificationControllerEfl* GetNotificationController() const;
#endif
virtual void OverrideWebkitPrefs(content::RenderViewHost* render_view_host,
content::WebPreferences* prefs) override;
- virtual void RenderProcessWillLaunch(content::RenderProcessHost* host) override;
+ virtual void RenderProcessWillLaunch(
+ content::RenderProcessHost* host) override;
virtual void SetCertificatePem(const net::SSLInfo& ssl_info,
int render_process_id,
private:
static void SetCertificatePemOnUIThread(int render_process_id,
- int render_view_id, std::string certificate);
+ int render_view_id,
+ std::string certificate);
static void DispatchPopupBlockedOnUIThread(int render_process_id,
- const GURL &target_url);
+ const GURL& target_url);
- std::unique_ptr<ResourceDispatcherHostDelegateEfl> resource_disp_host_del_efl_;
+ std::unique_ptr<ResourceDispatcherHostDelegateEfl>
+ resource_disp_host_del_efl_;
BrowserMainPartsEfl* browser_main_parts_efl_;
#if defined(ENABLE_NOTIFICATIONS)
std::unique_ptr<NotificationControllerEfl> notification_controller_;
DISALLOW_COPY_AND_ASSIGN(ContentBrowserClientEfl);
};
-
}
-#endif // CONTENT_BROWSER_CLIENT_EFL
+#endif // CONTENT_BROWSER_CLIENT_EFL
#include "base/path_service.h"
#include "browser/resource_dispatcher_host_delegate_efl.h"
#include "command_line_efl.h"
+#include "content/browser/gpu/gpu_main_thread_factory.h"
#include "content/browser/gpu/gpu_process_host.h"
#include "content/common/paths_efl.h"
#include "content/gpu/in_process_gpu_thread.h"
switches::kBrowserSubprocessPath, base::FilePath(SubProcessPath()));
// needed for gpu thread
- GpuProcessHost::RegisterGpuMainThreadFactory(CreateInProcessGpuThread);
+ content::RegisterGpuMainThreadFactory(CreateInProcessGpuThread);
}
void ContentMainDelegateEfl::PreSandboxStartup() {
#include "content/public/browser/navigation_entry.h"
#include "eweb_view.h"
#include "net/base/filename_util.h"
+#include "net/traffic_annotation/network_traffic_annotation.h"
#include "content/common/paths_efl.h"
-#include "third_party/WebKit/public/platform/WebReferrerPolicy.h"
+#include "third_party/blink/public/platform/WebReferrerPolicy.h"
#include "ui/base/clipboard/clipboard.h"
#include "private/ewk_context_menu_private.h"
AddItemToProposedList(EWK_CONTEXT_MENU_ITEM_TYPE_ACTION, EWK_CONTEXT_MENU_ITEM_TAG_PASTE,
std::string(dgettext("WebKit", "IDS_WEBVIEW_OPT_PASTE")));
}
- if (params_.media_type != blink::WebContextMenuData::MediaTypeImage &&
+ if (params_.media_type != blink::WebContextMenuData::kMediaTypeImage &&
!params_.selection_text.empty() && params_.is_editable) {
AddItemToProposedList(EWK_CONTEXT_MENU_ITEM_TYPE_ACTION, EWK_CONTEXT_MENU_ITEM_TAG_CUT,
std::string(dgettext("WebKit", "IDS_WEBVIEW_OPT_CUT_ABB")));
}
- if (params_.media_type != blink::WebContextMenuData::MediaTypeImage &&
+ if (params_.media_type != blink::WebContextMenuData::kMediaTypeImage &&
!params_.selection_text.empty()) {
AddItemToProposedList(EWK_CONTEXT_MENU_ITEM_TYPE_ACTION, EWK_CONTEXT_MENU_ITEM_TAG_COPY,
std::string(dgettext("WebKit", "IDS_WEBVIEW_OPT_COPY")));
}
RenderWidgetHostViewEfl* rwhv = static_cast<RenderWidgetHostViewEfl*>(web_contents_.GetRenderWidgetHostView());
- if ((params_.media_type != blink::WebContextMenuData::MediaTypeImage &&
+ if ((params_.media_type != blink::WebContextMenuData::kMediaTypeImage &&
!params_.selection_text.empty()) ||
(params_.is_editable && (rwhv && !rwhv->IsLastAvailableTextEmpty()))) {
AddItemToProposedList(EWK_CONTEXT_MENU_ITEM_TYPE_ACTION, EWK_CONTEXT_MENU_ITEM_TAG_SELECT_WORD,
AddItemToProposedList(EWK_CONTEXT_MENU_ITEM_TYPE_ACTION, EWK_CONTEXT_MENU_ITEM_TAG_SELECT_ALL,
std::string(dgettext("WebKit", "IDS_WEBVIEW_OPT_SELECT_ALL_ABB")));
}
-#if !defined(EWK_BRINGUP)
+#if !defined(EWK_BRINGUP) // FIXME: m67 bringup
if (params_.is_draggable) {
AddItemToProposedList(EWK_CONTEXT_MENU_ITEM_TYPE_ACTION, EWK_CONTEXT_MENU_ITEM_TAG_DRAG,
std::string(dgettext("WebKit", "IDS_WEBVIEW_OPT_DRAG_AND_DROP")));
if (!item) {
save_fail_dialog_.reset(JavaScriptModalDialogEfl::CreateDialog(
&web_contents_,
- GURL(),
JavaScriptModalDialogEfl::ALERT,
base::UTF8ToUTF16(std::string(dgettext("WebKit", "IDS_WEBVIEW_POP_FAIL"))),
base::string16(),
if (disk_download_items_.find(download) != disk_download_items_.end()) {
file_saved_dialog_.reset(JavaScriptModalDialogEfl::CreateDialog(
&web_contents_,
- GURL(),
JavaScriptModalDialogEfl::ALERT,
base::UTF8ToUTF16(std::string(dgettext("WebKit", "IDS_WEBVIEW_POP_SAVED"))),
base::string16(),
web_contents_.GetBrowserContext());
std::unique_ptr<DownloadUrlParameters> dl_params(
- DownloadUrlParameters::CreateForWebContentsMainFrame(&web_contents_, url));
+ DownloadUrlParameters::CreateForWebContentsMainFrame(&web_contents_, url, NO_TRAFFIC_ANNOTATION_YET));
dl_params->set_post_id(-1);
dl_params->set_referrer(
- content::Referrer(referrer, blink::WebReferrerPolicyAlways));
+ content::Referrer(referrer, blink::kWebReferrerPolicyAlways));
dl_params->set_referrer_encoding("utf8");
base::FilePath fileName = net::GenerateFileName(url,"","","","","");
base::FilePath fullPath = outputDir.Append(fileName);
content::OpenURLParams params(url,
content::Referrer(
web_contents_.GetVisibleURL(),
- blink::WebReferrerPolicyAlways),
+ blink::kWebReferrerPolicyAlways),
-1, /* -1 to indicate the main frame */
disposition,
ui::PAGE_TRANSITION_LINK,
switch(menu_item->GetContextMenuOption())
{
case EWK_CONTEXT_MENU_ITEM_TAG_OPEN_LINK: {
- OpenURL(GURL(params_.link_url.spec()), CURRENT_TAB);
+ OpenURL(GURL(params_.link_url.spec()), WindowOpenDisposition::CURRENT_TAB);
break;
}
case EWK_CONTEXT_MENU_ITEM_TAG_OPEN_LINK_IN_NEW_WINDOW: {
- OpenURL(GURL(params_.link_url.spec()), NEW_FOREGROUND_TAB);
+ OpenURL(GURL(params_.link_url.spec()), WindowOpenDisposition::NEW_FOREGROUND_TAB);
break;
}
case EWK_CONTEXT_MENU_ITEM_TAG_SHARE_LINK: {
break;
}
case EWK_CONTEXT_MENU_ITEM_TAG_COPY_LINK_DATA: {
- ClipboardHelperEfl::GetInstance()->SetData(UTF16ToUTF8(params_.link_text),
+ ClipboardHelperEfl::GetInstance()->SetData(base::UTF16ToUTF8(params_.link_text),
ClipboardHelperEfl::CLIPBOARD_DATA_TYPE_URL);
break;
}
break;
}
case EWK_CONTEXT_MENU_ITEM_TAG_OPEN_IMAGE_IN_CURRENT_WINDOW: {
- OpenURL(GURL(params_.src_url.spec()), CURRENT_TAB);
+ OpenURL(GURL(params_.src_url.spec()), WindowOpenDisposition::CURRENT_TAB);
break;
}
case EWK_CONTEXT_MENU_ITEM_TAG_OPEN_IMAGE_IN_NEW_WINDOW: {
- OpenURL(GURL(params_.src_url.spec()), NEW_FOREGROUND_TAB);
+ OpenURL(GURL(params_.src_url.spec()), WindowOpenDisposition::NEW_FOREGROUND_TAB);
break;
}
case EWK_CONTEXT_MENU_ITEM_TAG_SELECT_WORD: {
break;
}
case EWK_CONTEXT_MENU_ITEM_TAG_DRAG: {
-#if !defined(EWK_BRINGUP)
+#if !defined(EWK_BRINGUP) // FIXME: m67 bringup
RenderViewHost* rvh = web_contents_.GetRenderViewHost();
rvh->StartDragging();
context_menu_show_pos_.SetPoint(params_.x, params_.y);
#include "base/synchronization/waitable_event.h"
#include "content/public/browser/browser_thread.h"
#include "content/browser/storage_partition_impl.h"
-#include "browser/scoped_allow_wait_for_legacy_web_view_api.h"
#include "eweb_context.h"
#include "net/base/net_errors.h"
#include "net/base/static_cookie_policy.h"
#include "net/url_request/url_request_context_getter.h"
#include "url/gurl.h"
+#include "net/cookies/cookie_store_test_callbacks.h"
+
#include <Eina.h>
using content::BrowserThread;
DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::IO));
std::unique_ptr<net::CookieStore> cookie_store = GetCookieStore();
- if (cookie_store.get())
- cookie_store->DeleteSessionCookiesAsync(base::Callback<void(int)>());
+
+ // FIXME: EWK_BRINGUP: Check it.
+ if (cookie_store.get()) {
+ net::ResultSavingCookieCallback<uint32_t> callback;
+ cookie_store->DeleteSessionCookiesAsync(
+ base::Bind(&net::ResultSavingCookieCallback<uint32_t>::Run,
+ base::Unretained(&callback)));
+ callback.WaitUntilDone();
+ }
}
static void DeleteCookiesOnIOThread(std::unique_ptr<net::CookieStore> cookie_store,
if (ShouldBlockThirdPartyCookies()) {
net::StaticCookiePolicy policy(net::StaticCookiePolicy::BLOCK_ALL_THIRD_PARTY_COOKIES);
- int rv;
- if (setting_cookie)
- rv = policy.CanSetCookie(url, first_party_url);
- else
- rv = policy.CanGetCookies(url, first_party_url);
-
- if (net::OK == rv)
- return true;
+ return (policy.CanAccessCookies(url, first_party_url) == net::OK);
}
return false;
bool CookieManager::OnCanGetCookies(const net::URLRequest& request,
const net::CookieList& cookie_list) {
- return AllowCookies(request.url(), request.first_party_for_cookies(), false);
+ return AllowCookies(request.url(), request.site_for_cookies(), false);
}
bool CookieManager::OnCanSetCookie(const net::URLRequest& request,
const std::string& cookie_line,
net::CookieOptions* options) {
- return AllowCookies(request.url(), request.first_party_for_cookies(), true);
+ return AllowCookies(request.url(), request.site_for_cookies(), true);
}
bool CookieManager::AllowGetCookie(const GURL& url,
base::Passed(std::move(cookie_store)),
GURL(url), &cookie_value, &completion));
// allow wait temporarily.
- ScopedAllowWaitForLegacyWebViewApi allow_wait;
completion.Wait();
return cookie_value;
}
#include <vector>
+#include <stdlib.h>
+#include <time.h>
+#include <unistd.h>
#include "base/bind.h"
#include "base/command_line.h"
#include "base/lazy_instance.h"
#include "base/strings/stringprintf.h"
#include "base/strings/utf_string_conversions.h"
#include "common/version_info.h"
-#include "components/devtools_discovery/devtools_target_descriptor.h"
-#include "components/devtools_http_handler/devtools_http_handler.h"
+#include "content/browser/devtools/devtools_http_handler.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/devtools_agent_host.h"
#include "content/public/browser/devtools_frontend_host.h"
+#include "content/public/browser/devtools_socket_factory.h"
#include "content/public/common/content_client.h"
#include "content/public/common/content_switches.h"
#include "content/public/common/url_constants.h"
#include "content/public/common/user_agent.h"
#include "content/shell/browser/shell.h"
-#include "grit/shell_resources.h"
-#include "grit/devtools_resources.h"
+#include "content/browser/devtools/grit/devtools_resources.h"
+#include "content/shell/grit/shell_resources.h"
#include "net/base/net_errors.h"
#include "net/socket/tcp_server_socket.h"
-#include "net/base/net_errors.h"
#include "ui/base/resource/resource_bundle.h"
-#include <stdlib.h>
-#include <time.h>
-#include <unistd.h>
using content::BrowserThread;
-using devtools_http_handler::DevToolsHttpHandler;
+using content::DevToolsHttpHandler;
namespace {
const uint16_t kMaxTetheringPort = 9444;
const int kBackLog = 10;
-class TCPServerSocketFactory
- : public DevToolsHttpHandler::ServerSocketFactory {
+class TCPServerSocketFactory : public content::DevToolsSocketFactory {
public:
TCPServerSocketFactory(const std::string& address, uint16_t port)
- : address_(address),
- port_(port) {}
+ : address_(address), port_(port) {}
private:
std::unique_ptr<net::ServerSocket> CreateForHttpServer() override {
std::unique_ptr<net::ServerSocket> socket(
- new net::TCPServerSocket(nullptr, net::NetLog::Source()));
+ new net::TCPServerSocket(nullptr, net::NetLogSource()));
if (socket->ListenWithAddressAndPort(address_, port_, kBackLog) != net::OK)
return std::unique_ptr<net::ServerSocket>();
} // namespace
-
-namespace devtools_http_handler {
+namespace content {
DevToolsDelegateEfl::DevToolsDelegateEfl(int port)
- : port_(0)
- , browser_context_(NULL) {
+ : port_(0), browser_context_(NULL) {
// It's a hacky way to early detected if port is available. The problem is
// that the only thing we can do after checking is hope that noone will take
// the port until it's initialized on IO thread again. The best approach would
// be creating async callbacks that would inform when inspector server started
// and on which port.
static std::string addr = "0.0.0.0";
- std::unique_ptr<net::ServerSocket> sock(new net::TCPServerSocket(NULL, net::NetLog::Source()));
+ std::unique_ptr<net::ServerSocket> sock(
+ new net::TCPServerSocket(NULL, net::NetLogSource()));
- const base::CommandLine* const command_line = base::CommandLine::ForCurrentProcess();
+ const base::CommandLine* const command_line =
+ base::CommandLine::ForCurrentProcess();
// See if the user specified a port on the command line (useful for
// automation). If not, use an ephemeral port by specifying 0.
if (!port && command_line->HasSwitch(switches::kRemoteDebuggingPort)) {
int temp_port = 0;
std::string port_str =
- command_line->GetSwitchValueASCII(switches::kRemoteDebuggingPort);
+ command_line->GetSwitchValueASCII(switches::kRemoteDebuggingPort);
base::StringToInt(port_str, &temp_port);
if (temp_port > 0 && temp_port < 65535) {
port = temp_port;
sock->GetLocalAddress(&givenIp);
port_ = givenIp.port();
- std::unique_ptr<DevToolsHttpHandler::ServerSocketFactory> factory(
+#if !defined(EWK_BRINGUP) // FIXME: m67 bringup
+ // FIXME: EWK_BRINGUP definition should be removed.
+ std::unique_ptr<content::DevToolsSocketFactory> factory(
new TCPServerSocketFactory(addr, port_));
- devtools_http_handler_.reset(new devtools_http_handler::DevToolsHttpHandler(
+ devtools_http_handler_.reset(new content::DevToolsHttpHandler(
std::move(factory), std::string(), this, base::FilePath(),
- base::FilePath(), EflWebView::VersionInfo::GetInstance()
- ->ProductNameAndVersionForUserAgent(),
+ base::FilePath(),
+ EflWebView::VersionInfo::GetInstance()
+ ->ProductNameAndVersionForUserAgent(),
EflWebView::VersionInfo::GetInstance()->DefaultUserAgent()));
+#endif // !defined(EWK_BRINGUP)
}
-DevToolsDelegateEfl::~DevToolsDelegateEfl() {
-}
+DevToolsDelegateEfl::~DevToolsDelegateEfl() {}
void DevToolsDelegateEfl::Stop() {
if (devtools_http_handler_) {
}
std::string DevToolsDelegateEfl::GetDiscoveryPageHTML() {
- return ResourceBundle::GetSharedInstance().GetRawDataResource(
- IDR_CONTENT_SHELL_DEVTOOLS_DISCOVERY_PAGE).as_string();
+ return ResourceBundle::GetSharedInstance()
+ .GetRawDataResource(IDR_CONTENT_SHELL_DEVTOOLS_DISCOVERY_PAGE)
+ .as_string();
}
std::string DevToolsDelegateEfl::GetFrontendResource(const std::string& path) {
return content::DevToolsFrontendHost::GetFrontendResource(path).as_string();
}
-std::string DevToolsDelegateEfl::GetPageThumbnailData(const GURL& url) {
- return std::string();
-}
-
-content::DevToolsExternalAgentProxyDelegate*
-DevToolsDelegateEfl::HandleWebSocketConnection(const std::string& path) {
- return nullptr;
-}
-
} // namespace content
#ifndef DEVTOOLS_DELEGATE_EFL_H_
#define DEVTOOLS_DELEGATE_EFL_H_
-
#include "base/compiler_specific.h"
-#include "components/devtools_http_handler/devtools_http_handler_delegate.h"
+#include "content/browser/devtools/devtools_http_handler.h"
+#include "content/public/browser/devtools_manager_delegate.h"
namespace content {
-class BrowserContext;
-}
-
-namespace devtools_http_handler {
+class BrowserContext;
class DevToolsHttpHandler;
// This class is to create RemoteInspector Server(Remote Debugger) and return devtools front resources.
// This class implements DevToolsHttpHandlerDelegate interface.
// This class is similar to ShellDevToolsDelegate, which also implements DevToolsHttpHandlerDelegate interface.
-class DevToolsDelegateEfl : public DevToolsHttpHandlerDelegate {
+class DevToolsDelegateEfl : public DevToolsManagerDelegate {
public:
// explicit ChromiumEflDevToolsDelegate();
explicit DevToolsDelegateEfl(int = 0);
// ChromiumDevToolsHttpHandler::Delegate overrides.
virtual std::string GetDiscoveryPageHTML() override;
virtual std::string GetFrontendResource(const std::string& path) override;
- virtual std::string GetPageThumbnailData(const GURL& url) override;
-
- // Allows embedder to handle custom websocket-based protocol connection
- // pointing remote debugging port. Returns ownership.
- virtual content::DevToolsExternalAgentProxyDelegate*
- HandleWebSocketConnection(const std::string& path) override;
-
DevToolsHttpHandler* devtools_http_handler() {
return devtools_http_handler_.get();
using content::WebContents;
using content::RenderViewHost;
+#if 0
namespace {
const char kTargetTypePage[] = "page";
const char kTargetTypeServiceWorker[] = "service_worker";
const char kTargetTypeOther[] = "other";
-
class Target : public devtools_discovery::DevToolsTargetDescriptor {
public:
web_contents->ClosePage();
return true;
}
-
}
+#endif
namespace content {
DevToolsManagerDelegateEfl::~DevToolsManagerDelegateEfl() {
}
-base::DictionaryValue* DevToolsManagerDelegateEfl::HandleCommand(
+bool DevToolsManagerDelegateEfl::HandleCommand(
content::DevToolsAgentHost* agent_host,
+ int session_id,
base::DictionaryValue* command_dict) {
- return NULL;
+ return false;
}
} // namespace content
#ifndef DEVTOOLS_MANAGER_DELEGATE_EFL_H_
#define DEVTOOLS_MANAGER_DELEGATE_EFL_H_
-#include "components/devtools_discovery/devtools_target_descriptor.h"
#include "content/public/browser/devtools_manager_delegate.h"
namespace content {
virtual ~DevToolsManagerDelegateEfl();
// content::DevToolsManagerDelegate implementation.
- virtual void Inspect(content::BrowserContext* browser_context,
- content::DevToolsAgentHost* agent_host) override {};
- virtual void DevToolsAgentStateChanged(content::DevToolsAgentHost* agent_host,
- bool attached) override {};
- virtual base::DictionaryValue* HandleCommand(
- content::DevToolsAgentHost* agent_host,
- base::DictionaryValue* command_dict) override;
+ virtual void Inspect(content::DevToolsAgentHost* agent_host) override{};
+ virtual bool HandleCommand(DevToolsAgentHost* agent_host,
+ int session_id,
+ base::DictionaryValue* command) override;
private:
DISALLOW_COPY_AND_ASSIGN(DevToolsManagerDelegateEfl);
#include "base/synchronization/waitable_event.h"
#include "components/autofill/content/browser/content_autofill_driver.h"
-#include "content/browser/memory/memory_pressure_controller_impl.h"
+//#include "content/browser/memory/memory_pressure_controller_impl.h"
#include "content/public/browser/appcache_service.h"
#include "content/public/browser/browser_context.h"
#include "content/public/browser/browser_thread.h"
/**
* @brief Helper class for obtaining WebStorage origins
*/
-class WebStorageGetAllOriginsDispatcher: public base::RefCountedThreadSafe<WebStorageGetAllOriginsDispatcher> {
-public:
- WebStorageGetAllOriginsDispatcher(Ewk_Web_Storage_Origins_Get_Callback callback, void* user_data)
- : callback_(callback)
- , user_data_(user_data) {
+class WebStorageGetAllOriginsDispatcher
+ : public base::RefCountedThreadSafe<WebStorageGetAllOriginsDispatcher> {
+ public:
+ WebStorageGetAllOriginsDispatcher(
+ Ewk_Web_Storage_Origins_Get_Callback callback,
+ void* user_data)
+ : callback_(callback), user_data_(user_data) {
DCHECK(callback_);
DCHECK(user_data_);
}
- void Dispatch(const std::vector<content::LocalStorageUsageInfo> &local_storage) {
+ void Dispatch(
+ const std::vector<content::LocalStorageUsageInfo>& local_storage) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
Eina_List* lorigins = NULL;
callback_(lorigins, user_data_);
}
-private:
+ private:
Ewk_Web_Storage_Origins_Get_Callback callback_;
void* user_data_;
};
-void SetProxyConfigCallbackOnIOThread(base::WaitableEvent* done,
- net::URLRequestContextGetter* url_request_context_getter,
- const net::ProxyConfig& proxy_config) {
+void SetProxyConfigCallbackOnIOThread(
+ base::WaitableEvent* done,
+ net::URLRequestContextGetter* url_request_context_getter,
+ const net::ProxyConfig& proxy_config) {
net::ProxyService* proxy_service =
url_request_context_getter->GetURLRequestContext()->proxy_service();
proxy_service->ResetConfigService(
done->Signal();
}
-void OnOriginsWithApplicationCacheObtained(Ewk_Web_Application_Cache_Origins_Get_Callback callback,
- void* user_data,
- scoped_refptr<content::AppCacheInfoCollection> collection,
- int result) {
+void OnOriginsWithApplicationCacheObtained(
+ Ewk_Web_Application_Cache_Origins_Get_Callback callback,
+ void* user_data,
+ scoped_refptr<content::AppCacheInfoCollection> collection,
+ int result) {
Eina_List* origins = 0;
- for (map<GURL, content::AppCacheInfoVector>::iterator iter = collection->infos_by_origin.begin();
- iter != collection->infos_by_origin.end();
- ++iter) {
+ for (map<GURL, content::AppCacheInfoVector>::iterator iter =
+ collection->infos_by_origin.begin();
+ iter != collection->infos_by_origin.end(); ++iter) {
_Ewk_Security_Origin* origin = new _Ewk_Security_Origin(iter->first);
origins = eina_list_append(origins, origin);
}
// We still trigger callback.
usage = 0;
}
- BrowserThread::PostTask(BrowserThread::UI,
- FROM_HERE,
+ BrowserThread::PostTask(BrowserThread::UI, FROM_HERE,
base::Bind(callback, usage, user_data));
}
-void OnGetWebDBOrigins(
- Ewk_Web_Database_Origins_Get_Callback callback,
- void* user_data,
- const std::set<GURL>& origins_ref) {
+void OnGetWebDBOrigins(Ewk_Web_Database_Origins_Get_Callback callback,
+ void* user_data,
+ const std::set<GURL>& origins_ref) {
Eina_List* origins = 0;
- for (std::set<GURL>::iterator iter =
- origins_ref.begin();
- iter != origins_ref.end(); ++iter) {
- _Ewk_Security_Origin* sec_origin = new _Ewk_Security_Origin(*iter);
- origins = eina_list_append(origins, sec_origin);
+ for (std::set<GURL>::iterator iter = origins_ref.begin();
+ iter != origins_ref.end(); ++iter) {
+ _Ewk_Security_Origin* sec_origin = new _Ewk_Security_Origin(*iter);
+ origins = eina_list_append(origins, sec_origin);
}
- BrowserThread::PostTask(BrowserThread::UI,
- FROM_HERE,
+ BrowserThread::PostTask(BrowserThread::UI, FROM_HERE,
base::Bind(callback, origins, user_data));
}
void* user_data,
content::StoragePartition* partition) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::DB));
- storage::DatabaseQuotaClient client(
- base::ThreadTaskRunnerHandle::Get().get(),
- partition->GetDatabaseTracker());
+#if !defined(EWK_BRINGUP) // FIXME: m67 bringup
+ storage::DatabaseQuotaClient client(partition->GetDatabaseTracker());
client.GetOriginsForType(storage::kStorageTypeTemporary,
base::Bind(&OnGetWebDBOrigins, callback, user_data));
+#endif
}
-void OnGetFileSystemOrigins(
- Ewk_Local_File_System_Origins_Get_Callback callback,
- void* user_data,
- const std::set<GURL>& origins_ref) {
+void OnGetFileSystemOrigins(Ewk_Local_File_System_Origins_Get_Callback callback,
+ void* user_data,
+ const std::set<GURL>& origins_ref) {
Eina_List* origins = 0;
- for (std::set<GURL>::iterator iter =
- origins_ref.begin();
- iter != origins_ref.end(); ++iter) {
- _Ewk_Security_Origin* sec_origin = new _Ewk_Security_Origin(*iter);
- origins = eina_list_append(origins, sec_origin);
+ for (std::set<GURL>::iterator iter = origins_ref.begin();
+ iter != origins_ref.end(); ++iter) {
+ _Ewk_Security_Origin* sec_origin = new _Ewk_Security_Origin(*iter);
+ origins = eina_list_append(origins, sec_origin);
}
- BrowserThread::PostTask(BrowserThread::UI,
- FROM_HERE,
+ BrowserThread::PostTask(BrowserThread::UI, FROM_HERE,
base::Bind(callback, origins, user_data));
}
-void GetFileSystemOriginsOnFILEThread(Ewk_Web_Database_Origins_Get_Callback callback,
- void* user_data,
- content::StoragePartition* partition) {
+void GetFileSystemOriginsOnFILEThread(
+ Ewk_Web_Database_Origins_Get_Callback callback,
+ void* user_data,
+ content::StoragePartition* partition) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE));
- std::unique_ptr<storage::FileSystemQuotaClient> client( new storage::FileSystemQuotaClient(partition->GetFileSystemContext(), false));
+ std::unique_ptr<storage::FileSystemQuotaClient> client(
+ new storage::FileSystemQuotaClient(partition->GetFileSystemContext(),
+ false));
- client->GetOriginsForType(storage::kStorageTypeTemporary,
- base::Bind(&OnGetFileSystemOrigins, callback, user_data));
+ client->GetOriginsForType(
+ storage::kStorageTypeTemporary,
+ base::Bind(&OnGetFileSystemOrigins, callback, user_data));
}
-} // namespace
+} // namespace
void EwkDidStartDownloadCallback::TriggerCallback(const string& url) {
- if(callback_)
- (*callback_)(url.c_str(),user_data_);
+ if (callback_)
+ (*callback_)(url.c_str(), user_data_);
}
bool EwkMimeOverrideCallback::TriggerCallback(const std::string& url_spec,
return result;
}
-void EWebContext::SendWidgetInfo(const std::string& tizen_id, double scale, const string &theme, const string &encoded_bundle) {
+void EWebContext::SendWidgetInfo(const std::string& tizen_id,
+ double scale,
+ const string& theme,
+ const string& encoded_bundle) {
tizen_id_ = tizen_id;
widget_scale_ = scale;
widget_theme_ = theme;
}
void EWebContext::SetMimeOverrideCallback(
- Ewk_Context_Override_Mime_For_Url_Callback callback, void* user_data) {
- mime_override_callback_.reset(new EwkMimeOverrideCallback(callback,
- user_data));
+ Ewk_Context_Override_Mime_For_Url_Callback callback,
+ void* user_data) {
+ mime_override_callback_.reset(
+ new EwkMimeOverrideCallback(callback, user_data));
}
bool EWebContext::OverrideMimeForURL(const std::string& url_spec,
std::string& new_mime_type) const {
if (!mime_override_callback_)
return false;
- char *new_mime_type_string = NULL;
+ char* new_mime_type_string = NULL;
bool overridden = mime_override_callback_->TriggerCallback(
url_spec, mime_type, &new_mime_type_string);
if (overridden) {
}
EWebContext::EWebContext(bool incognito)
- : EWebContext(incognito, std::string()) {
-}
+ : EWebContext(incognito, std::string()) {}
EWebContext::EWebContext(const std::string& injectedBundlePath)
- : EWebContext(false, injectedBundlePath) {
-}
+ : EWebContext(false, injectedBundlePath) {}
EWebContext::EWebContext(bool incognito, const std::string& injectedBundlePath)
: injected_bundle_path_(injectedBundlePath),
// there are ewk_cookie_manager APIs that can be called before a
// WebView instance is created. In such circumstances, APIs including
// ewk_cookie_manager_persistent_storage_set fail to execute.
- BrowserContext::GetDefaultStoragePartition(browser_context())->GetURLRequestContext();
+ BrowserContext::GetDefaultStoragePartition(browser_context())
+ ->GetURLRequestContext();
// Notification Service gets init in BrowserMainRunner init,
// so cache manager can register for notifications only after that.
tizen_extensible_.reset(TizenExtensible::create());
}
-EWebContext::~EWebContext() {
-}
+EWebContext::~EWebContext() {}
void EWebContext::ClearNetworkCache() {
- BrowsingDataRemoverEfl* remover = BrowsingDataRemoverEfl::CreateForUnboundedRange(browser_context_.get());
+ BrowsingDataRemoverEfl* remover =
+ BrowsingDataRemoverEfl::CreateForUnboundedRange(browser_context_.get());
remover->ClearNetworkCache();
- //remover deletes itself once it is done with clearing operation.
+ // remover deletes itself once it is done with clearing operation.
return;
}
}
void EWebContext::SetNetworkCacheEnable(bool enable) {
- net::URLRequestContextGetter* url_context = BrowserContext::GetDefaultStoragePartition(browser_context())->GetURLRequestContext();
+ net::URLRequestContextGetter* url_context =
+ BrowserContext::GetDefaultStoragePartition(browser_context())
+ ->GetURLRequestContext();
if (!url_context)
return;
- net::HttpTransactionFactory* transaction_factory = url_context->GetURLRequestContext()->http_transaction_factory();
+ net::HttpTransactionFactory* transaction_factory =
+ url_context->GetURLRequestContext()->http_transaction_factory();
if (!transaction_factory)
return;
}
bool EWebContext::GetNetworkCacheEnable() const {
- net::HttpCache* http_cache = BrowserContext::GetDefaultStoragePartition(browser_context())->GetURLRequestContext()->
- GetURLRequestContext()->http_transaction_factory()->GetCache();
+ net::HttpCache* http_cache =
+ BrowserContext::GetDefaultStoragePartition(browser_context())
+ ->GetURLRequestContext()
+ ->GetURLRequestContext()
+ ->http_transaction_factory()
+ ->GetCache();
if (!http_cache)
return false;
return (http_cache->mode() != net::HttpCache::DISABLE);
}
-void EWebContext::AddExtraPluginDir(const char *path) {
+void EWebContext::AddExtraPluginDir(const char* path) {
#if defined(ENABLE_PLUGINS)
-#if !defined(EWK_BRINGUP)
+#if !defined(EWK_BRINGUP) // FIXME: m67 bringup
// [M51_2704] The AddExtraPluginDir API was removed in content::PluginList
// class. It will be fixed by webview team.
// FIXME: http://suprem.sec.samsung.net/jira/browse/TWF-1132
// Also, newer chromium rebases (m49+) have a new API for this named
// MemoryPressureController::SendPressureNotification. Use it when available.
DLOG(WARNING) << "Releasing as much memory as possible.";
- content::MemoryPressureControllerImpl::GetInstance()->
- SimulatePressureNotificationInAllProcesses(
+#if !defined(EWK_BRINGUP) // FIXME: m67 bringup
+ content::MemoryPressureControllerImpl::GetInstance()
+ ->SimulatePressureNotificationInAllProcesses(
base::MemoryPressureListener::MEMORY_PRESSURE_LEVEL_CRITICAL);
+#endif
}
-bool EWebContext::HTTPCustomHeaderAdd(const std::string& name, const std::string& value) {
- BrowserContextEfl::ResourceContextEfl* rc = browser_context_->GetResourceContextEfl();
+bool EWebContext::HTTPCustomHeaderAdd(const std::string& name,
+ const std::string& value) {
+ BrowserContextEfl::ResourceContextEfl* rc =
+ browser_context_->GetResourceContextEfl();
if (!rc)
return false;
return rc->HTTPCustomHeaderAdd(name, value);
}
bool EWebContext::HTTPCustomHeaderRemove(const std::string& name) {
- BrowserContextEfl::ResourceContextEfl* rc = browser_context_->GetResourceContextEfl();
+ BrowserContextEfl::ResourceContextEfl* rc =
+ browser_context_->GetResourceContextEfl();
if (!rc)
return false;
return rc->HTTPCustomHeaderRemove(name);
}
void EWebContext::HTTPCustomHeaderClear() {
- BrowserContextEfl::ResourceContextEfl* rc = browser_context_->GetResourceContextEfl();
+ BrowserContextEfl::ResourceContextEfl* rc =
+ browser_context_->GetResourceContextEfl();
if (!rc)
return;
rc->HTTPCustomHeaderClear();
BrowserThread::PostTask(
BrowserThread::IO, FROM_HERE,
base::Bind(&SetProxyConfigCallbackOnIOThread, &done,
- base::RetainedRef(BrowserContext::GetDefaultStoragePartition(browser_context())->GetURLRequestContext()),
+ base::RetainedRef(BrowserContext::GetDefaultStoragePartition(
+ browser_context())
+ ->GetURLRequestContext()),
config));
done.Wait();
}
-void EWebContext::SetDidStartDownloadCallback(Ewk_Context_Did_Start_Download_Callback callback,
- void* user_data) {
+void EWebContext::SetDidStartDownloadCallback(
+ Ewk_Context_Did_Start_Download_Callback callback,
+ void* user_data) {
DCHECK(start_download_callback_.get() == NULL);
- start_download_callback_.reset(new EwkDidStartDownloadCallback(callback,user_data));
+ start_download_callback_.reset(
+ new EwkDidStartDownloadCallback(callback, user_data));
}
EwkDidStartDownloadCallback* EWebContext::DidStartDownloadCallback() {
void EWebContext::DeleteAllApplicationCache() {
if (!BrowserThread::CurrentlyOn(BrowserThread::IO)) {
- BrowserThread::PostTask(
- BrowserThread::IO, FROM_HERE,
- base::Bind(&EWebContext::DeleteAllApplicationCache,
- base::Unretained(this)));
+ BrowserThread::PostTask(BrowserThread::IO, FROM_HERE,
+ base::Bind(&EWebContext::DeleteAllApplicationCache,
+ base::Unretained(this)));
return;
}
- BrowsingDataRemoverEfl* remover = BrowsingDataRemoverEfl::CreateForUnboundedRange(browser_context_.get());
+ BrowsingDataRemoverEfl* remover =
+ BrowsingDataRemoverEfl::CreateForUnboundedRange(browser_context_.get());
remover->RemoveImpl(BrowsingDataRemoverEfl::REMOVE_APPCACHE, GURL());
}
void EWebContext::DeleteApplicationCacheForSite(const GURL& site) {
- content::StoragePartition* partition = BrowserContext::GetStoragePartitionForSite(browser_context_.get(),
- site);
- partition->ClearDataForOrigin(content::StoragePartition::REMOVE_DATA_MASK_APPCACHE,
- content::StoragePartition::QUOTA_MANAGED_STORAGE_MASK_ALL,
- site,
- partition->GetURLRequestContext(), base::Bind(&base::DoNothing));
+ content::StoragePartition* partition =
+ BrowserContext::GetStoragePartitionForSite(browser_context_.get(), site);
+ partition->ClearDataForOrigin(
+ content::StoragePartition::REMOVE_DATA_MASK_APPCACHE,
+ content::StoragePartition::QUOTA_MANAGED_STORAGE_MASK_ALL, site,
+ partition->GetURLRequestContext(), base::Bind(&base::DoNothing));
}
-void EWebContext::GetAllOriginsWithApplicationCache(Ewk_Web_Application_Cache_Origins_Get_Callback callback,
- void* user_data) {
+void EWebContext::GetAllOriginsWithApplicationCache(
+ Ewk_Web_Application_Cache_Origins_Get_Callback callback,
+ void* user_data) {
content::StoragePartition* partition =
BrowserContext::GetStoragePartition(browser_context_.get(), NULL);
- scoped_refptr<content::AppCacheInfoCollection> collection(new content::AppCacheInfoCollection());
+ scoped_refptr<content::AppCacheInfoCollection> collection(
+ new content::AppCacheInfoCollection());
// As per comments on AppCacheService,
- // there is only one instance of AppCacheService per profile.(i.e. context in our case).
+ // there is only one instance of AppCacheService per profile.(i.e. context in
+ // our case).
// So, we don't need to iterate over all StoragePartitions.
- partition->GetAppCacheService()->GetAllAppCacheInfo(collection.get(),
- base::Bind(&OnOriginsWithApplicationCacheObtained, callback, user_data, collection));
+ partition->GetAppCacheService()->GetAllAppCacheInfo(
+ collection.get(), base::Bind(&OnOriginsWithApplicationCacheObtained,
+ callback, user_data, collection));
}
void EWebContext::GetApplicationCacheUsage(
Ewk_Web_Application_Cache_Usage_For_Origin_Get_Callback callback,
void* user_data) {
content::StoragePartition* partition =
- BrowserContext::GetStoragePartition(browser_context_.get(), NULL);
+ BrowserContext::GetStoragePartition(browser_context_.get(), NULL);
BrowserThread::PostTask(
- BrowserThread::IO,
- FROM_HERE,
- base::Bind(&storage::QuotaManager::GetUsageAndQuota,
- partition->GetQuotaManager(),
- url,
- storage::kStorageTypeTemporary,
- base::Bind(&OnTemporaryUsageAndQuotaObtained, callback, user_data)));
+ BrowserThread::IO, FROM_HERE,
+ base::Bind(
+ &storage::QuotaManager::GetUsageAndQuota,
+ partition->GetQuotaManager(), url, storage::kStorageTypeTemporary,
+ base::Bind(&OnTemporaryUsageAndQuotaObtained, callback, user_data)));
}
void EWebContext::WebStorageDelete() {
if (!BrowserThread::CurrentlyOn(BrowserThread::UI)) {
BrowserThread::PostTask(
BrowserThread::UI, FROM_HERE,
- base::Bind(&EWebContext::WebStorageDelete,
- base::Unretained(this)));
+ base::Bind(&EWebContext::WebStorageDelete, base::Unretained(this)));
return;
}
- BrowsingDataRemoverEfl* remover = BrowsingDataRemoverEfl::CreateForUnboundedRange(browser_context_.get());
+ BrowsingDataRemoverEfl* remover =
+ BrowsingDataRemoverEfl::CreateForUnboundedRange(browser_context_.get());
remover->RemoveImpl(BrowsingDataRemoverEfl::REMOVE_LOCAL_STORAGE, GURL());
}
void EWebContext::WebStorageDeleteForOrigin(const GURL& origin) {
if (!BrowserThread::CurrentlyOn(BrowserThread::UI)) {
- BrowserThread::PostTask(
- BrowserThread::UI, FROM_HERE,
- base::Bind(&EWebContext::WebStorageDeleteForOrigin,
- base::Unretained(this), origin));
+ BrowserThread::PostTask(BrowserThread::UI, FROM_HERE,
+ base::Bind(&EWebContext::WebStorageDeleteForOrigin,
+ base::Unretained(this), origin));
return;
}
content::StoragePartition* partition =
partition->GetDOMStorageContext()->DeleteLocalStorage(origin);
}
-void EWebContext::WebStorageOriginsAllGet(Ewk_Web_Storage_Origins_Get_Callback callback,
- void* user_data) {
+void EWebContext::WebStorageOriginsAllGet(
+ Ewk_Web_Storage_Origins_Get_Callback callback,
+ void* user_data) {
content::StoragePartition* partition =
BrowserContext::GetStoragePartition(browser_context_.get(), NULL);
- WebStorageGetAllOriginsDispatcher* dispatcher = new WebStorageGetAllOriginsDispatcher(callback, user_data);
+ WebStorageGetAllOriginsDispatcher* dispatcher =
+ new WebStorageGetAllOriginsDispatcher(callback, user_data);
- partition->GetDOMStorageContext()->GetLocalStorageUsage(base::Bind(&WebStorageGetAllOriginsDispatcher::Dispatch, dispatcher));
+ partition->GetDOMStorageContext()->GetLocalStorageUsage(
+ base::Bind(&WebStorageGetAllOriginsDispatcher::Dispatch, dispatcher));
}
void EWebContext::IndexedDBDelete() {
if (!BrowserThread::CurrentlyOn(BrowserThread::UI)) {
BrowserThread::PostTask(
BrowserThread::UI, FROM_HERE,
- base::Bind(&EWebContext::IndexedDBDelete,
- base::Unretained(this)));
+ base::Bind(&EWebContext::IndexedDBDelete, base::Unretained(this)));
return;
}
- BrowsingDataRemoverEfl* remover = BrowsingDataRemoverEfl::CreateForUnboundedRange(browser_context_.get());
+ BrowsingDataRemoverEfl* remover =
+ BrowsingDataRemoverEfl::CreateForUnboundedRange(browser_context_.get());
remover->RemoveImpl(BrowsingDataRemoverEfl::REMOVE_INDEXEDDB, GURL());
}
if (!BrowserThread::CurrentlyOn(BrowserThread::UI)) {
BrowserThread::PostTask(
BrowserThread::UI, FROM_HERE,
- base::Bind(&EWebContext::WebDBDelete,
- base::Unretained(this), host));
+ base::Bind(&EWebContext::WebDBDelete, base::Unretained(this), host));
return;
}
- BrowsingDataRemoverEfl* remover = BrowsingDataRemoverEfl::CreateForUnboundedRange(browser_context_.get());
+ BrowsingDataRemoverEfl* remover =
+ BrowsingDataRemoverEfl::CreateForUnboundedRange(browser_context_.get());
remover->RemoveImpl(BrowsingDataRemoverEfl::REMOVE_WEBSQL, host);
}
-void EWebContext::GetAllOriginsWithWebDB(Ewk_Web_Database_Origins_Get_Callback callback, void* user_data) {
- content::StoragePartition* partition = BrowserContext::GetStoragePartition(browser_context_.get(), NULL);
+void EWebContext::GetAllOriginsWithWebDB(
+ Ewk_Web_Database_Origins_Get_Callback callback,
+ void* user_data) {
+ content::StoragePartition* partition =
+ BrowserContext::GetStoragePartition(browser_context_.get(), NULL);
BrowserThread::PostTask(
- BrowserThread::DB,
- FROM_HERE,
- base::Bind(&GetWebDBOriginsOnDBThread,
- callback, user_data, partition));
+ BrowserThread::DB, FROM_HERE,
+ base::Bind(&GetWebDBOriginsOnDBThread, callback, user_data, partition));
}
void EWebContext::FileSystemDelete(const GURL& host) {
if (!BrowserThread::CurrentlyOn(BrowserThread::UI)) {
- BrowserThread::PostTask(
- BrowserThread::UI, FROM_HERE,
- base::Bind(&EWebContext::FileSystemDelete,
- base::Unretained(this), host));
+ BrowserThread::PostTask(BrowserThread::UI, FROM_HERE,
+ base::Bind(&EWebContext::FileSystemDelete,
+ base::Unretained(this), host));
return;
}
- BrowsingDataRemoverEfl* remover = BrowsingDataRemoverEfl::CreateForUnboundedRange(browser_context_.get());
+ BrowsingDataRemoverEfl* remover =
+ BrowsingDataRemoverEfl::CreateForUnboundedRange(browser_context_.get());
remover->RemoveImpl(BrowsingDataRemoverEfl::REMOVE_FILE_SYSTEMS, host);
}
-void EWebContext::GetAllOriginsWithFileSystem(Ewk_Local_File_System_Origins_Get_Callback callback, void* user_data) const {
- content::StoragePartition* partition = BrowserContext::GetStoragePartition(browser_context_.get(), NULL);
- BrowserThread::PostTask(
- BrowserThread::FILE,
- FROM_HERE,
- base::Bind(&GetFileSystemOriginsOnFILEThread, callback, user_data, partition));
+void EWebContext::GetAllOriginsWithFileSystem(
+ Ewk_Local_File_System_Origins_Get_Callback callback,
+ void* user_data) const {
+ content::StoragePartition* partition =
+ BrowserContext::GetStoragePartition(browser_context_.get(), NULL);
+ BrowserThread::PostTask(BrowserThread::FILE, FROM_HERE,
+ base::Bind(&GetFileSystemOriginsOnFILEThread,
+ callback, user_data, partition));
}
bool EWebContext::SetFaviconDatabasePath(const base::FilePath& path) {
return FaviconDatabase::Instance()->SetPath(path);
}
-Evas_Object *EWebContext::AddFaviconObject(const char* uri, Evas* canvas) const {
+Evas_Object* EWebContext::AddFaviconObject(const char* uri,
+ Evas* canvas) const {
if (uri == NULL || canvas == NULL) {
return NULL;
}
return NULL;
}
- Evas_Object *favicon = evas_object_image_filled_add(canvas);
+ Evas_Object* favicon = evas_object_image_filled_add(canvas);
evas_object_image_size_set(favicon, bitmap.width(), bitmap.height());
evas_object_image_colorspace_set(favicon, EVAS_COLORSPACE_ARGB8888);
evas_object_image_fill_set(favicon, 0, 0, bitmap.width(), bitmap.height());
evas_object_image_filled_set(favicon, EINA_TRUE);
evas_object_image_alpha_set(favicon, EINA_TRUE);
+
+#if !defined(EWK_BRINGUP) // FIXME: m67 bringup
void* pixels = evas_object_image_data_get(favicon, EINA_TRUE);
if (pixels) {
bitmap.copyPixelsTo(pixels, bitmap.getSize());
evas_object_image_data_set(favicon, pixels);
}
+#endif
return favicon;
}
if (!BrowserThread::CurrentlyOn(BrowserThread::UI)) {
BrowserThread::PostTask(
BrowserThread::UI, FROM_HERE,
- base::Bind(&EWebContext::ClearCandidateData,
- base::Unretained(this)));
+ base::Bind(&EWebContext::ClearCandidateData, base::Unretained(this)));
return;
}
WebDataServiceFactory* webDataServiceInstance =
if (autofillWebDataService.get()) {
// RemoveFormElementsAddedBetween will schedule task on proper thread,
// it is done in WebDatabaseService::ScheduleDBTask
- autofillWebDataService->RemoveFormElementsAddedBetween(
- base::Time(),
- base::Time::Max());
+ autofillWebDataService->RemoveFormElementsAddedBetween(base::Time(),
+ base::Time::Max());
} else {
DLOG(WARNING) << "AutofillWebDataService is NULL";
}
scoped_refptr<password_manager::PasswordStore> store =
password_manager::PasswordStoreFactory::GetPasswordStore();
if (store.get())
- store->RemoveLoginsCreatedBetween(base::Time(), base::Time::Max(), base::Closure());
+ store->RemoveLoginsCreatedBetween(base::Time(), base::Time::Max(),
+ base::Closure());
#else
DLOG(WARNING) << "TIZEN_AUTOFILL_SUPPORT is not enabled";
#endif
unsigned int EWebContext::InspectorServerStart(unsigned int port) {
InspectorServerStop();
- inspector_server_ = new devtools_http_handler::DevToolsDelegateEfl(port);
+ inspector_server_ = new content::DevToolsDelegateEfl(port);
return inspector_server_ ? inspector_server_->port() : 0;
}
Ewk_Context_Notification_Show_Callback show_callback,
Ewk_Context_Notification_Cancel_Callback cancel_callback,
void* user_data) {
- notification_cb_.reset(
- new EWebContextNotificationCallback(
- context, show_callback, cancel_callback, user_data));
+ notification_cb_.reset(new EWebContextNotificationCallback(
+ context, show_callback, cancel_callback, user_data));
}
bool EWebContext::HasNotificationCallbacks() const {
return notification_cb_->HasShowCallback() &&
- notification_cb_->HasCancelCallback();
+ notification_cb_->HasCancelCallback();
}
bool EWebContext::NotificationShowCallback(Ewk_Notification* notification) {
std::unique_ptr<EwkDidStartDownloadCallback> start_download_callback_;
std::unique_ptr<EwkMimeOverrideCallback> mime_override_callback_;
int m_pixmap;
- devtools_http_handler::DevToolsDelegateEfl* inspector_server_;
+ content::DevToolsDelegateEfl* inspector_server_;
std::unique_ptr<EWebContextNotificationCallback> notification_cb_;
};
// found in the LICENSE file.
#include "eweb_view.h"
-//#include <config.h>
#include "base/pickle.h"
#include "browser/navigation_policy_handler_efl.h"
#include "browser/quota_permission_context_efl.h"
-#include "browser/scoped_allow_wait_for_legacy_web_view_api.h"
#include "browser/web_view_browser_message_filter.h"
#include "common/content_client_efl.h"
#include "common/render_messages_ewk.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/host_zoom_map.h"
#include "skia/ext/platform_canvas.h"
-#include "third_party/WebKit/public/web/WebFindOptions.h"
+#include "third_party/blink/public/web/WebFindOptions.h"
#include "ui/events/event_switches.h"
#include "web_contents_efl_delegate_ewk.h"
#include "web_contents_view_efl_delegate_ewk.h"
}
}
-void GetEinaRectFromGfxRect(const gfx::Rect& gfx_rect, Eina_Rectangle* eina_rect)
-{
+void GetEinaRectFromGfxRect(const gfx::Rect& gfx_rect,
+ Eina_Rectangle* eina_rect) {
eina_rect->x = gfx_rect.x();
eina_rect->y = gfx_rect.y();
eina_rect->w = gfx_rect.width();
return NULL;
}
-} // namespace
+} // namespace
-class WebViewAsyncRequestHitTestDataCallback
-{
+class WebViewAsyncRequestHitTestDataCallback {
public:
WebViewAsyncRequestHitTestDataCallback(int x, int y, Ewk_Hit_Test_Mode mode)
- : x_(x)
- , y_(y)
- , mode_(mode) {
- }
- virtual ~WebViewAsyncRequestHitTestDataCallback() {};
+ : x_(x), y_(y), mode_(mode) {}
+ virtual ~WebViewAsyncRequestHitTestDataCallback(){};
- virtual void Run(_Ewk_Hit_Test *hit_test, EWebView* web_view) = 0;
+ virtual void Run(_Ewk_Hit_Test* hit_test, EWebView* web_view) = 0;
protected:
int GetX() const { return x_; }
Ewk_Hit_Test_Mode mode_;
};
-class WebViewAsyncRequestHitTestDataUserCallback: public WebViewAsyncRequestHitTestDataCallback
-{
+class WebViewAsyncRequestHitTestDataUserCallback
+ : public WebViewAsyncRequestHitTestDataCallback {
public:
- WebViewAsyncRequestHitTestDataUserCallback(int x,
- int y,
- Ewk_Hit_Test_Mode mode,
- Ewk_View_Hit_Test_Request_Callback callback,
- void* user_data)
- : WebViewAsyncRequestHitTestDataCallback(x, y, mode)
- , callback_(callback)
- , user_data_(user_data) {
- }
-
- void Run(_Ewk_Hit_Test *hit_test, EWebView* web_view) override {
+ WebViewAsyncRequestHitTestDataUserCallback(
+ int x,
+ int y,
+ Ewk_Hit_Test_Mode mode,
+ Ewk_View_Hit_Test_Request_Callback callback,
+ void* user_data)
+ : WebViewAsyncRequestHitTestDataCallback(x, y, mode),
+ callback_(callback),
+ user_data_(user_data) {}
+
+ void Run(_Ewk_Hit_Test* hit_test, EWebView* web_view) override {
DCHECK(callback_);
- callback_(web_view->evas_object(), GetX(), GetY(), GetMode(), hit_test, user_data_);
+ callback_(web_view->evas_object(), GetX(), GetY(), GetMode(), hit_test,
+ user_data_);
}
private:
base::Bind(&NullCreateWebContents);
EWebView* EWebView::FromEvasObject(Evas_Object* eo) {
- return WebViewDelegateEwk::GetInstance().
- GetWebViewFromEvasObject(eo);
+ return WebViewDelegateEwk::GetInstance().GetWebViewFromEvasObject(eo);
}
RenderWidgetHostViewEfl* EWebView::rwhv() const {
- return static_cast<RenderWidgetHostViewEfl*>(web_contents_->GetRenderWidgetHostView());
+ return static_cast<RenderWidgetHostViewEfl*>(
+ web_contents_->GetRenderWidgetHostView());
}
EWebView::EWebView(Ewk_Context* context, Evas_Object* object)
hit_test_completion_(base::WaitableEvent::ResetPolicy::AUTOMATIC,
base::WaitableEvent::InitialState::NOT_SIGNALED),
page_scale_factor_(1.0),
- is_initialized_(false) {
-}
+ is_initialized_(false) {}
void EWebView::Initialize() {
if (is_initialized_) {
web_contents_delegate_.reset(new WebContentsDelegateEfl(this));
web_contents_->SetDelegate(web_contents_delegate_.get());
- back_forward_list_.reset(new _Ewk_Back_Forward_List(
- web_contents_->GetController()));
+ back_forward_list_.reset(
+ new _Ewk_Back_Forward_List(web_contents_->GetController()));
DCHECK(web_contents_->GetRenderViewHost());
// Settings (content::WebPreferences) will be initalized by
// RenderViewHostImpl::ComputeWebkitPrefs() based on command line switches.
- settings_.reset(new Ewk_Settings(evas_object_,
- web_contents_->GetRenderViewHost()->GetWebkitPreferences()));
+ settings_.reset(new Ewk_Settings(
+ evas_object_,
+ web_contents_->GetRenderViewHost()->GetWebkitPreferences()));
- base::CommandLine *cmdline = base::CommandLine::ForCurrentProcess();
+ base::CommandLine* cmdline = base::CommandLine::ForCurrentProcess();
if (cmdline->HasSwitch(switches::kTouchEvents))
SetTouchEventsEnabled(true);
else
formNavigation_.prevState = false;
formNavigation_.nextState = false;
- //allow this object and its children to get a focus
+ // allow this object and its children to get a focus
elm_object_tree_focus_allow_set(native_view_, EINA_TRUE);
is_initialized_ = true;
}
-EWebView::~EWebView()
-{
- std::map<int64_t, WebViewAsyncRequestHitTestDataCallback*>::iterator hit_test_callback_iterator;
+EWebView::~EWebView() {
+ std::map<int64_t, WebViewAsyncRequestHitTestDataCallback*>::iterator
+ hit_test_callback_iterator;
for (hit_test_callback_iterator = hit_test_callback_.begin();
- hit_test_callback_iterator != hit_test_callback_.end();
- hit_test_callback_iterator++)
+ hit_test_callback_iterator != hit_test_callback_.end();
+ hit_test_callback_iterator++)
delete hit_test_callback_iterator->second;
hit_test_callback_.clear();
- for (auto iter = delayed_messages_.begin(); iter != delayed_messages_.end(); ++iter)
+ for (auto iter = delayed_messages_.begin(); iter != delayed_messages_.end();
+ ++iter)
delete *iter;
delayed_messages_.clear();
formNavigation_.prevState = false;
formNavigation_.nextState = false;
-// evas_object_del(evas_object());
+ // evas_object_del(evas_object());
// Release manually those scoped pointers to
// make sure they are released in correct order
return context_menu_.reset();
}
-void EWebView::SetFocus(Eina_Bool focus)
-{
+void EWebView::SetFocus(Eina_Bool focus) {
if (HasFocus() != focus)
elm_object_focus_set(native_view_, focus);
}
DCHECK(new_object);
}
-//static
-Evas_Object* EWebView::GetHostWindowDelegate(
- const content::WebContents* wc) {
+// static
+Evas_Object* EWebView::GetHostWindowDelegate(const content::WebContents* wc) {
EWebView* thiz = WebViewFromWebContents(wc);
DCHECK(thiz->evas_object_);
Evas_Object* parent = evas_object_above_get(thiz->evas_object_);
}
void EWebView::Reload() {
- web_contents_->GetController().Reload(true);
+ web_contents_->GetController().Reload(content::ReloadType::NORMAL, true);
}
void EWebView::ReloadBypassingCache() {
- web_contents_->GetController().ReloadBypassingCache(true);
+ web_contents_->GetController().Reload(content::ReloadType::BYPASSING_CACHE, true);
}
Eina_Bool EWebView::CanGoBack() {
void EWebView::Suspend() {
CHECK(web_contents_);
- RenderViewHost *rvh = web_contents_->GetRenderViewHost();
+ RenderViewHost* rvh = web_contents_->GetRenderViewHost();
RenderFrameHost* rfh = web_contents_->GetMainFrame();
CHECK(rvh);
CHECK(rfh);
+ rfh->BlockRequestsForFrame();
+#if 0
content::BrowserThread::PostTask(
- content::BrowserThread::IO, FROM_HERE,
- base::Bind(&content::ResourceDispatcherHost::BlockRequestsForFrameFromUI, rfh));
+ content::BrowserThread::IO, FROM_HERE,
+ base::Bind(&content::ResourceDispatcherHost::BlockRequestsForFrameFromUI,
+ rfh));
if (rvh)
rvh->Send(new EwkViewMsg_SuspendScheduledTask(rvh->GetRoutingID()));
+#endif
}
void EWebView::Resume() {
CHECK(web_contents_);
- RenderViewHost *rvh = web_contents_->GetRenderViewHost();
- RenderFrameHost *rfh = web_contents_->GetMainFrame();
+ RenderViewHost* rvh = web_contents_->GetRenderViewHost();
+ RenderFrameHost* rfh = web_contents_->GetMainFrame();
CHECK(rvh);
CHECK(rfh);
+ rfh->ResumeBlockedRequestsForFrame();
+#if 0
content::BrowserThread::PostTask(
- content::BrowserThread::IO, FROM_HERE,
- base::Bind(&content::ResourceDispatcherHost::ResumeBlockedRequestsForFrameFromUI, rfh));
+ content::BrowserThread::IO, FROM_HERE,
+ base::Bind(
+ &content::ResourceDispatcherHost::ResumeBlockedRequestsForFrameFromUI,
+ rfh));
if (rvh)
rvh->Send(new EwkViewMsg_ResumeScheduledTasks(rvh->GetRoutingID()));
+#endif
}
double EWebView::GetTextZoomFactor() const {
RenderWidgetHostImpl* rwhi = static_cast<RenderWidgetHostImpl*>(
web_contents_->GetRenderViewHost()->GetWidget());
+
+#if !defined(EWK_BRINGUP) // FIXME: m67 bringup
+ // This is moved to mojo in upstream. Change it.
+ // https://chromium-review.googlesource.com/c/chromium/src/+/541036
rwhi->ExecuteEditCommand(command, value);
+#endif
// This is workaround for rich text toolbar buttons in email application
- if ( !strcmp(command, "InsertOrderedList")
- || !strcmp(command, "InsertUnorderedList")
- || !strcmp(command, "AlignCenter")
- || !strcmp(command, "AlignJustified")
- || !strcmp(command, "AlignLeft")
- || !strcmp(command, "AlignRight") ) {
+ if (!strcmp(command, "InsertOrderedList") ||
+ !strcmp(command, "InsertUnorderedList") ||
+ !strcmp(command, "AlignCenter") || !strcmp(command, "AlignJustified") ||
+ !strcmp(command, "AlignLeft") || !strcmp(command, "AlignRight")) {
QuerySelectionStyle();
}
}
orientation = 270;
screen_orientation_ = orientation;
- if (screen_orientation_ == 0 ||
- screen_orientation_ == 90 ||
- screen_orientation_ == 180 ||
- screen_orientation_ == 270) {
+ if (screen_orientation_ == 0 || screen_orientation_ == 90 ||
+ screen_orientation_ == 180 || screen_orientation_ == 270) {
GetWebContentsViewEfl()->SetOrientation(screen_orientation_);
// workaround for platform issue not resizing popup after rotation
int width = 0;
int height = 0;
#if defined(USE_WAYLAND)
- // Screen orientation is already considered in ecore_wl_screen_size_get function.
+ // Screen orientation is already considered in ecore_wl_screen_size_get
+ // function.
ecore_wl_screen_size_get(&width, &height);
#else
if (orientation == 0 || orientation == 180) {
}
}
-void EWebView::InvokePolicyResponseCallback(_Ewk_Policy_Decision* policy_decision) {
- SmartCallback<EWebViewCallbacks::PolicyResponseDecide>().call(policy_decision);
+void EWebView::InvokePolicyResponseCallback(
+ _Ewk_Policy_Decision* policy_decision) {
+ SmartCallback<EWebViewCallbacks::PolicyResponseDecide>().call(
+ policy_decision);
if (policy_decision->isSuspended())
return;
delete policy_decision;
}
-void EWebView::InvokePolicyNavigationCallback(RenderViewHost* rvh,
- const NavigationPolicyParams params, bool* handled) {
+void EWebView::InvokePolicyNavigationCallback(
+ RenderViewHost* rvh,
+ const NavigationPolicyParams params,
+ bool* handled) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
SmartCallback<EWebViewCallbacks::SaveSessionData>().call();
- std::unique_ptr<_Ewk_Policy_Decision> policy_decision(new _Ewk_Policy_Decision(params, rvh));
+ std::unique_ptr<_Ewk_Policy_Decision> policy_decision(
+ new _Ewk_Policy_Decision(params, rvh));
- SmartCallback<EWebViewCallbacks::NavigationPolicyDecision>().call(policy_decision.get());
+ SmartCallback<EWebViewCallbacks::NavigationPolicyDecision>().call(
+ policy_decision.get());
CHECK(!policy_decision->isSuspended());
// TODO: Navigation can't be suspended
// this aproach is synchronous and requires immediate response
- // Maybe there is different approach (like resource throttle response mechanism) that allows us to
+ // Maybe there is different approach (like resource throttle response
+ // mechanism) that allows us to
// suspend navigation
if (!policy_decision->isDecided())
policy_decision->Use();
- *handled = policy_decision->GetNavigationPolicyHandler()->GetDecision() == NavigationPolicyHandlerEfl::Handled;
+ *handled = policy_decision->GetNavigationPolicyHandler()->GetDecision() ==
+ NavigationPolicyHandlerEfl::Handled;
}
-void EWebView::HandleTouchEvents(Ewk_Touch_Event_Type type, const Eina_List *points, const Evas_Modifier *modifiers)
-{
+void EWebView::HandleTouchEvents(Ewk_Touch_Event_Type type,
+ const Eina_List* points,
+ const Evas_Modifier* modifiers) {
const Eina_List* l;
void* data;
EINA_LIST_FOREACH(points, l, data) {
Evas_Coord_Point pt;
pt.x = point->x;
pt.y = point->y;
- ui::TouchEvent touch_event = MakeTouchEvent(
- pt, point->state, point->id, evas_object());
+ ui::TouchEvent touch_event =
+ MakeTouchEvent(pt, point->state, point->id, evas_object());
rwhv()->HandleTouchEvent(&touch_event);
}
}
touch_events_enabled_ = enabled;
GetWebContentsViewEfl()->SetTouchEventsEnabled(enabled);
+#if !defined(EWK_BRINGUP) // FIXME: m67 bringup
+ // there is no flag touch_enabled in web preferences
GetSettings()->getPreferences().touch_enabled = enabled;
+#endif
GetSettings()->getPreferences().double_tap_to_zoom_enabled = enabled;
GetSettings()->getPreferences().editing_behavior =
- enabled ? content::EDITING_BEHAVIOR_ANDROID :
- content::EDITING_BEHAVIOR_UNIX;
+ enabled ? content::EDITING_BEHAVIOR_ANDROID
+ : content::EDITING_BEHAVIOR_UNIX;
UpdateWebKitPreferences();
}
class JavaScriptCallbackDetails {
public:
- JavaScriptCallbackDetails(Ewk_View_Script_Execute_Callback callback_func, void *user_data, Evas_Object* view)
- : callback_func_(callback_func)
- , user_data_(user_data)
- , view_(view) {}
+ JavaScriptCallbackDetails(Ewk_View_Script_Execute_Callback callback_func,
+ void* user_data,
+ Evas_Object* view)
+ : callback_func_(callback_func), user_data_(user_data), view_(view) {}
Ewk_View_Script_Execute_Callback callback_func_;
- void *user_data_;
+ void* user_data_;
Evas_Object* view_;
};
-void JavaScriptComplete(JavaScriptCallbackDetails* script_callback_data, const base::Value* result) {
+void JavaScriptComplete(JavaScriptCallbackDetails* script_callback_data,
+ const base::Value* result) {
if (!script_callback_data->callback_func_)
return;
std::string return_string;
result->GetAsString(&return_string);
- script_callback_data->callback_func_(script_callback_data->view_, return_string.c_str(), script_callback_data->user_data_);
+ script_callback_data->callback_func_(script_callback_data->view_,
+ return_string.c_str(),
+ script_callback_data->user_data_);
}
-} //namespace
+} // namespace
-bool EWebView::ExecuteJavaScript(const char* script, Ewk_View_Script_Execute_Callback callback, void* userdata) {
+bool EWebView::ExecuteJavaScript(const char* script,
+ Ewk_View_Script_Execute_Callback callback,
+ void* userdata) {
if (!script)
return false;
- if (!web_contents_delegate_) // question, can I remove this check?
+ if (!web_contents_delegate_) // question, can I remove this check?
return false;
if (!web_contents_)
if (!render_frame_host)
return false;
- // Note: M37. Execute JavaScript, |script| with |RenderFrameHost::ExecuteJavaScript|.
+ // Note: M37. Execute JavaScript, |script| with
+ // |RenderFrameHost::ExecuteJavaScript|.
// @see also https://codereview.chromium.org/188893005 for more details.
base::string16 js_script;
base::UTF8ToUTF16(script, strlen(script), &js_script);
if (callback) {
- JavaScriptCallbackDetails* script_callback_data = new JavaScriptCallbackDetails(callback, userdata, evas_object_);
+ JavaScriptCallbackDetails* script_callback_data =
+ new JavaScriptCallbackDetails(callback, userdata, evas_object_);
// In M47, it isn't possible anymore to execute javascript in the generic
// case. We need to call ExecuteJavaScriptForTests to keep the behaviour
// unchanged @see https://codereview.chromium.org/1123783002
render_frame_host->ExecuteJavaScriptWithUserGestureForTests(
- js_script, base::Bind(&JavaScriptComplete, base::Owned(script_callback_data)));
+ js_script,
+ base::Bind(&JavaScriptComplete, base::Owned(script_callback_data)));
} else {
- // We use ExecuteJavaScriptWithUserGestureForTests instead of ExecuteJavaScript because
- // ExecuteJavaScriptWithUserGestureForTests sets user_gesture to true. This was the
+ // We use ExecuteJavaScriptWithUserGestureForTests instead of
+ // ExecuteJavaScript because
+ // ExecuteJavaScriptWithUserGestureForTests sets user_gesture to true. This
+ // was the
// behaviour is m34, and we want to keep it that way.
render_frame_host->ExecuteJavaScriptWithUserGestureForTests(js_script);
}
}
bool EWebView::SetUserAgentAppName(const char* application_name) {
- EflWebView::VersionInfo::GetInstance()->
- SetProductName(application_name ? application_name : "");
+ EflWebView::VersionInfo::GetInstance()->SetProductName(
+ application_name ? application_name : "");
return true;
}
if (!rwhv())
return "";
- return UTF16ToUTF8(rwhv()->GetSelectedText()).c_str();
+ return base::UTF16ToUTF8(rwhv()->GetSelectedText()).c_str();
}
_Ewk_Frame* EWebView::GetMainFrame() {
void EWebView::UpdateWebkitPreferencesEfl(RenderViewHost* render_view_host) {
DCHECK(render_view_host);
- IPC::Message* message =
- new EwkSettingsMsg_UpdateWebKitPreferencesEfl(render_view_host->GetRoutingID(),
- settings_->getPreferencesEfl());
+ IPC::Message* message = new EwkSettingsMsg_UpdateWebKitPreferencesEfl(
+ render_view_host->GetRoutingID(), settings_->getPreferencesEfl());
if (render_view_host->IsRenderViewLive()) {
render_view_host->Send(message);
}
}
-void EWebView::SetContentSecurityPolicy(const char* policy, Ewk_CSP_Header_Type type) {
- web_contents_delegate_->SetContentSecurityPolicy((policy ? policy : std::string()), type);
+void EWebView::SetContentSecurityPolicy(const char* policy,
+ Ewk_CSP_Header_Type type) {
+ web_contents_delegate_->SetContentSecurityPolicy(
+ (policy ? policy : std::string()), type);
}
-void EWebView::LoadHTMLString(const char* html, const char* base_uri, const char* unreachable_uri) {
+void EWebView::LoadHTMLString(const char* html,
+ const char* base_uri,
+ const char* unreachable_uri) {
LoadData(html, std::string::npos, NULL, NULL, base_uri, unreachable_uri);
}
LoadData(plain_text, std::string::npos, "text/plain", NULL, NULL, NULL);
}
-void EWebView::LoadData(const char* data, size_t size, const char* mime_type, const char* encoding, const char* base_uri, const char* unreachable_uri)
-{
+void EWebView::LoadData(const char* data,
+ size_t size,
+ const char* mime_type,
+ const char* encoding,
+ const char* base_uri,
+ const char* unreachable_uri) {
SetDefaultStringIfNull(mime_type, "text/html");
SetDefaultStringIfNull(encoding, "utf-8");
SetDefaultStringIfNull(base_uri, "about:blank"); // Webkit2 compatible
web_contents_->GetController().LoadURLWithParams(data_params);
}
-void EWebView::InvokeLoadError(const GURL& url, int error_code,
- const std::string& error_description, bool is_main_frame) {
+void EWebView::InvokeLoadError(const GURL& url,
+ int error_code,
+ const std::string& error_description,
+ bool is_main_frame) {
if (!is_main_frame)
return;
- std::unique_ptr<_Ewk_Error> err(new _Ewk_Error(error_code,
- url.possibly_invalid_spec().c_str(), error_description.c_str()));
+ std::unique_ptr<_Ewk_Error> err(
+ new _Ewk_Error(error_code, url.possibly_invalid_spec().c_str(),
+ error_description.c_str()));
SmartCallback<EWebViewCallbacks::LoadError>().call(err.get());
}
void EWebView::ShowPopupMenu(const std::vector<content::MenuItem>& items,
- int selectedIndex, bool multiple) {
-
+ int selectedIndex,
+ bool multiple) {
// Request form navigation information as early as possible,
// given that is renderer will ping-back with actual requested data.
- RenderFrameHostImpl* render_frame_host = static_cast<RenderFrameHostImpl*>(
- web_contents_->GetMainFrame());
+ RenderFrameHostImpl* render_frame_host =
+ static_cast<RenderFrameHostImpl*>(web_contents_->GetMainFrame());
if (render_frame_host)
render_frame_host->Send(new EwkFrameMsg_RequestSelectCollectionInformation(
render_frame_host->GetRoutingID()));
popupPicker_ = 0;
if (multiple)
- popupPicker_ = popup_picker_new(this, evas_object(), popupMenuItems_, 0, multiple);
+ popupPicker_ =
+ popup_picker_new(this, evas_object(), popupMenuItems_, 0, multiple);
else
- popupPicker_ = popup_picker_new(this, evas_object(), popupMenuItems_, selectedIndex, multiple);
+ popupPicker_ = popup_picker_new(this, evas_object(), popupMenuItems_,
+ selectedIndex, multiple);
- popup_picker_buttons_update(popupPicker_, formNavigation_.position, formNavigation_.count, false);
+ popup_picker_buttons_update(popupPicker_, formNavigation_.position,
+ formNavigation_.count, false);
}
Eina_Bool EWebView::HidePopupMenu() {
return true;
}
-void EWebView::UpdateFormNavigation(int formElementCount, int currentNodeIndex,
- bool prevState, bool nextState) {
+void EWebView::UpdateFormNavigation(int formElementCount,
+ int currentNodeIndex,
+ bool prevState,
+ bool nextState) {
formNavigation_.count = formElementCount;
formNavigation_.position = currentNodeIndex;
formNavigation_.prevState = prevState;
return false;
popup_picker_update(evas_object(), popupPicker_, items, selectedIndex);
- popup_picker_buttons_update(popupPicker_, formNavigation_.position, formNavigation_.count, false);
+ popup_picker_buttons_update(popupPicker_, formNavigation_.position,
+ formNavigation_.count, false);
return true;
}
void EWebView::FormNavigate(bool direction) {
- RenderFrameHostImpl* render_frame_host = static_cast<RenderFrameHostImpl*>(
- web_contents_->GetMainFrame());
+ RenderFrameHostImpl* render_frame_host =
+ static_cast<RenderFrameHostImpl*>(web_contents_->GetMainFrame());
if (!render_frame_host)
return;
- popup_picker_buttons_update(popupPicker_, formNavigation_.position, formNavigation_.count, true);
+ popup_picker_buttons_update(popupPicker_, formNavigation_.position,
+ formNavigation_.count, true);
- if ((direction && formNavigation_.nextState) || (!direction && formNavigation_.prevState))
+ if ((direction && formNavigation_.nextState) ||
+ (!direction && formNavigation_.prevState))
SetFormIsNavigating(true);
listClosed(popupPicker_, 0, 0, 0);
}
Eina_Bool EWebView::DidSelectPopupMenuItem(int selectedIndex) {
- RenderFrameHostImpl* render_frame_host = static_cast<RenderFrameHostImpl*>(web_contents_->GetMainFrame());
+ RenderFrameHostImpl* render_frame_host =
+ static_cast<RenderFrameHostImpl*>(web_contents_->GetMainFrame());
if (!render_frame_host)
return false;
if (!popupMenuItems_)
return false;
- // When user select empty space then no index is selected, so selectedIndex value is -1
- // In that case we should call valueChanged() with -1 index.That in turn call popupDidHide()
- // in didChangeSelectedIndex() for reseting the value of m_popupIsVisible in RenderMenuList.
- if (selectedIndex != -1 && selectedIndex >= (int)eina_list_count(popupMenuItems_))
+ // When user select empty space then no index is selected, so selectedIndex
+ // value is -1
+ // In that case we should call valueChanged() with -1 index.That in turn call
+ // popupDidHide()
+ // in didChangeSelectedIndex() for reseting the value of m_popupIsVisible in
+ // RenderMenuList.
+ if (selectedIndex != -1 &&
+ selectedIndex >= (int)eina_list_count(popupMenuItems_))
return false;
- // In order to reuse RenderFrameHostImpl::DidSelectPopupMenuItems() method in Android,
+ // In order to reuse RenderFrameHostImpl::DidSelectPopupMenuItems() method in
+ // Android,
// put selectedIndex into std::vector<int>.
std::vector<int> selectedIndices;
selectedIndices.push_back(selectedIndex);
return true;
}
-Eina_Bool EWebView::DidMultipleSelectPopupMenuItem(std::vector<int>& selectedIndices) {
- RenderFrameHostImpl* render_frame_host = static_cast<RenderFrameHostImpl*>(web_contents_->GetMainFrame());
+Eina_Bool EWebView::DidMultipleSelectPopupMenuItem(
+ std::vector<int>& selectedIndices) {
+ RenderFrameHostImpl* render_frame_host =
+ static_cast<RenderFrameHostImpl*>(web_contents_->GetMainFrame());
if (!render_frame_host)
return false;
delete static_cast<Popup_Menu_Item*>(item);
popupMenuItems_ = 0;
- RenderFrameHostImpl* render_frame_host = static_cast<RenderFrameHostImpl*>(web_contents_->GetMainFrame());
+ RenderFrameHostImpl* render_frame_host =
+ static_cast<RenderFrameHostImpl*>(web_contents_->GetMainFrame());
if (!render_frame_host)
return false;
return true;
}
-void EWebView::HandleLongPressGesture(const content::ContextMenuParams& params) {
+void EWebView::HandleLongPressGesture(
+ const content::ContextMenuParams& params) {
// This menu is created in renderer process and it does not now anything about
- // view scaling factor and it has another calling sequence, so coordinates is not updated.
+ // view scaling factor and it has another calling sequence, so coordinates is
+ // not updated.
content::ContextMenuParams convertedParams = params;
- gfx::Point convertedPoint = rwhv()->ConvertPointInViewPix(gfx::Point(params.x, params.y));
+ gfx::Point convertedPoint =
+ rwhv()->ConvertPointInViewPix(gfx::Point(params.x, params.y));
convertedParams.x = convertedPoint.x();
convertedParams.y = convertedPoint.y();
if (GetSelectionController() && GetSelectionController()->GetLongPressed()) {
bool show_context_menu_now =
- !GetSelectionController()->HandleLongPressEvent(convertedPoint, convertedParams);
+ !GetSelectionController()->HandleLongPressEvent(convertedPoint,
+ convertedParams);
if (show_context_menu_now)
ShowContextMenuInternal(convertedParams);
}
void EWebView::ShowContextMenu(const content::ContextMenuParams& params) {
// This menu is created in renderer process and it does not now anything about
- // view scaling factor and it has another calling sequence, so coordinates is not updated.
+ // view scaling factor and it has another calling sequence, so coordinates is
+ // not updated.
content::ContextMenuParams convertedParams = params;
- gfx::Point convertedPoint = rwhv()->ConvertPointInViewPix(gfx::Point(params.x, params.y));
+ gfx::Point convertedPoint =
+ rwhv()->ConvertPointInViewPix(gfx::Point(params.x, params.y));
convertedParams.x = convertedPoint.x();
convertedParams.y = convertedPoint.y();
ShowContextMenuInternal(convertedParams);
}
-void EWebView::ShowContextMenuInternal(const content::ContextMenuParams& params) {
- context_menu_.reset(new content::ContextMenuControllerEfl(this, *web_contents_.get()));
+void EWebView::ShowContextMenuInternal(
+ const content::ContextMenuParams& params) {
+ context_menu_.reset(
+ new content::ContextMenuControllerEfl(this, *web_contents_.get()));
if (!context_menu_->PopulateAndShowContextMenu(params)) {
context_menu_.reset();
if (GetSelectionController())
blink::WebFindOptions web_find_options;
web_find_options.forward = !(find_options & EWK_FIND_OPTIONS_BACKWARDS);
- web_find_options.matchCase = !(find_options & EWK_FIND_OPTIONS_CASE_INSENSITIVE);
- web_find_options.findNext = find_next;
+ web_find_options.match_case =
+ !(find_options & EWK_FIND_OPTIONS_CASE_INSENSITIVE);
+ web_find_options.find_next = find_next;
web_contents_->Find(current_find_request_id_, find_text, web_find_options);
}
// Do not cache |scale_factor| here as it may be discarded by Blink's
// minimumPageScaleFactor and maximumPageScaleFactor.
// |scale_factor| is cached as responde to DidChangePageScaleFactor.
- render_view_host->Send(new EwkViewMsg_Scale(render_view_host->GetRoutingID(), scale_factor, x, y));
+ render_view_host->Send(new EwkViewMsg_Scale(render_view_host->GetRoutingID(),
+ scale_factor, x, y));
}
bool EWebView::GetScrollPosition(int* x, int* y) const {
*x = previous_scroll_position_.x();
*y = previous_scroll_position_.y();
} else {
- const gfx::Vector2d scroll_position = scroll_detector_->GetLastScrollPosition();
+ const gfx::Vector2d scroll_position =
+ scroll_detector_->GetLastScrollPosition();
*x = scroll_position.x();
*y = scroll_position.y();
}
scroll_detector_->SetScrollOffsetChanged();
- render_view_host->Send(new EwkViewMsg_SetScroll(render_view_host->GetRoutingID(), x, y));
+ render_view_host->Send(
+ new EwkViewMsg_SetScroll(render_view_host->GetRoutingID(), x, y));
}
void EWebView::UseSettingsFont() {
RenderViewHost* render_view_host = web_contents_->GetRenderViewHost();
if (render_view_host)
- render_view_host->Send(new EwkViewMsg_UseSettingsFont(render_view_host->GetRoutingID()));
+ render_view_host->Send(
+ new EwkViewMsg_UseSettingsFont(render_view_host->GetRoutingID()));
}
void EWebView::DidChangeContentsSize(int width, int height) {
const Eina_Rectangle EWebView::GetContentsSize() const {
Eina_Rectangle rect;
- EINA_RECTANGLE_SET(&rect, 0, 0, contents_size_.width(), contents_size_.height());
+ EINA_RECTANGLE_SET(&rect, 0, 0, contents_size_.width(),
+ contents_size_.height());
return rect;
}
Eina_Rectangle last_view_port =
WebViewDelegateEwk::GetInstance().GetLastUsedViewPortArea(evas_object());
- int scaled_content_width = static_cast<int>(contents_size_.width() * page_scale_factor_);
- int scaled_content_height = static_cast<int>(contents_size_.height() * page_scale_factor_);
+ int scaled_content_width =
+ static_cast<int>(contents_size_.width() * page_scale_factor_);
+ int scaled_content_height =
+ static_cast<int>(contents_size_.height() * page_scale_factor_);
if (width && scaled_content_width > last_view_port.w)
*width = scaled_content_width - last_view_port.w;
void EWebView::QuerySelectionStyle() {
if (GetSettings()->textStyleStateState()) {
RenderViewHost* render_view_host = web_contents_->GetRenderViewHost();
- render_view_host->Send(new EwkViewMsg_GetSelectionStyle(render_view_host->GetRoutingID()));
+ render_view_host->Send(
+ new EwkViewMsg_GetSelectionStyle(render_view_host->GetRoutingID()));
}
}
gfx::Rect left_rect, right_rect;
if (GetSelectionController()) {
GetSelectionController()->GetSelectionBounds(&left_rect, &right_rect);
- _Ewk_Text_Style style_data(params, left_rect.origin(), right_rect.bottom_right());
+ _Ewk_Text_Style style_data(params, left_rect.origin(),
+ right_rect.bottom_right());
SmartCallback<EWebViewCallbacks::TextStyleState>().call(&style_data);
}
}
SelectionControllerEfl* EWebView::GetSelectionController() const {
RenderViewHost* render_view_host = web_contents_->GetRenderViewHost();
- RenderWidgetHostViewEfl* view =
- static_cast<RenderWidgetHostViewEfl*>(render_view_host->GetWidget()->GetView());
+ RenderWidgetHostViewEfl* view = static_cast<RenderWidgetHostViewEfl*>(
+ render_view_host->GetWidget()->GetView());
return view ? view->GetSelectionController() : 0;
}
void EWebView::SelectLinkText(const gfx::Point& touch_point) {
- float device_scale_factor = display::Screen::GetScreen()->
- GetPrimaryDisplay().device_scale_factor();
+ float device_scale_factor =
+ display::Screen::GetScreen()->GetPrimaryDisplay().device_scale_factor();
RenderViewHost* render_view_host = web_contents_->GetRenderViewHost();
render_view_host->Send(new ViewMsg_SelectLinkText(
render_view_host->GetRoutingID(),
touch_point.y() / device_scale_factor)));
}
-bool EWebView::GetSelectionRange(Eina_Rectangle* left_rect, Eina_Rectangle* right_rect) {
+bool EWebView::GetSelectionRange(Eina_Rectangle* left_rect,
+ Eina_Rectangle* right_rect) {
if (left_rect && right_rect) {
gfx::Rect left, right;
if (GetSelectionController()) {
return EINA_FALSE;
}
-_Ewk_Hit_Test* EWebView::RequestHitTestDataAt(int x, int y,
- Ewk_Hit_Test_Mode mode) {
+_Ewk_Hit_Test* EWebView::RequestHitTestDataAt(int x,
+ int y,
+ Ewk_Hit_Test_Mode mode) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
int view_x, view_y;
return RequestHitTestDataAtBlinkCoords(view_x, view_y, mode);
}
-Eina_Bool EWebView::AsyncRequestHitTestDataAt(int x, int y,
+Eina_Bool EWebView::AsyncRequestHitTestDataAt(
+ int x,
+ int y,
Ewk_Hit_Test_Mode mode,
Ewk_View_Hit_Test_Request_Callback callback,
void* user_data) {
int view_x, view_y;
EvasToBlinkCords(x, y, &view_x, &view_y);
return AsyncRequestHitTestDataAtBlinkCords(
- view_x,
- view_y,
- mode,
- new WebViewAsyncRequestHitTestDataUserCallback(x, y, mode, callback, user_data));
+ view_x, view_y, mode, new WebViewAsyncRequestHitTestDataUserCallback(
+ x, y, mode, callback, user_data));
}
-Eina_Bool EWebView::AsyncRequestHitTestDataAtBlinkCords(int x, int y,
+Eina_Bool EWebView::AsyncRequestHitTestDataAtBlinkCords(
+ int x,
+ int y,
Ewk_Hit_Test_Mode mode,
Ewk_View_Hit_Test_Request_Callback callback,
void* user_data) {
return AsyncRequestHitTestDataAtBlinkCords(
- x,
- y,
- mode,
- new WebViewAsyncRequestHitTestDataUserCallback(x, y, mode, callback, user_data));
+ x, y, mode, new WebViewAsyncRequestHitTestDataUserCallback(
+ x, y, mode, callback, user_data));
}
-Eina_Bool EWebView::AsyncRequestHitTestDataAtBlinkCords(int x, int y,
+Eina_Bool EWebView::AsyncRequestHitTestDataAtBlinkCords(
+ int x,
+ int y,
Ewk_Hit_Test_Mode mode,
- WebViewAsyncRequestHitTestDataCallback *cb) {
+ WebViewAsyncRequestHitTestDataCallback* cb) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
DCHECK(cb);
if (cb) {
RenderViewHost* render_view_host = web_contents_->GetRenderViewHost();
- content::RenderProcessHost* render_process_host =
- web_contents_->GetRenderProcessHost();
DCHECK(render_view_host);
- DCHECK(render_process_host);
- if (render_view_host && render_process_host) {
+ if (render_view_host) {
render_view_host->Send(new EwkViewMsg_DoHitTestAsync(
render_view_host->GetRoutingID(), x, y, mode, request_id));
hit_test_callback_[request_id] = cb;
return EINA_FALSE;
}
-void EWebView::DispatchAsyncHitTestData(const Hit_Test_Params& params, int64_t request_id) {
+void EWebView::DispatchAsyncHitTestData(const Hit_Test_Params& params,
+ int64_t request_id) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
std::map<int64_t, WebViewAsyncRequestHitTestDataCallback*>::iterator it =
hit_test_callback_.erase(it);
}
-_Ewk_Hit_Test* EWebView::RequestHitTestDataAtBlinkCoords(int x, int y, Ewk_Hit_Test_Mode mode) {
+_Ewk_Hit_Test* EWebView::RequestHitTestDataAtBlinkCoords(
+ int x,
+ int y,
+ Ewk_Hit_Test_Mode mode) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
RenderViewHost* render_view_host = web_contents_->GetRenderViewHost();
- content::RenderProcessHost* render_process_host = web_contents_->GetRenderProcessHost();
DCHECK(render_view_host);
- DCHECK(render_process_host);
- if (render_view_host && render_process_host && rwhv()) {
+ if (render_view_host) {
// We wait on UI thread till hit test data is updated.
- ScopedAllowWaitForLegacyWebViewApi allow_wait;
- render_view_host->Send(new EwkViewMsg_DoHitTest(render_view_host->GetRoutingID(), x, y, mode));
+ render_view_host->Send(
+ new EwkViewMsg_DoHitTest(render_view_host->GetRoutingID(), x, y, mode));
hit_test_completion_.Wait();
return new _Ewk_Hit_Test(hit_test_params_);
}
if (view_x) {
*view_x = x - tmpX;
- *view_x /= display::Screen::GetScreen()->
- GetPrimaryDisplay().device_scale_factor();
+ *view_x /=
+ display::Screen::GetScreen()->GetPrimaryDisplay().device_scale_factor();
}
if (view_y) {
*view_y = y - tmpY;
- *view_y /= display::Screen::GetScreen()->
- GetPrimaryDisplay().device_scale_factor();
+ *view_y /=
+ display::Screen::GetScreen()->GetPrimaryDisplay().device_scale_factor();
}
}
hit_test_completion_.Signal();
}
-void EWebView::OnCopyFromBackingStore(bool success, const SkBitmap& bitmap) {
-}
+void EWebView::OnCopyFromBackingStore(bool success, const SkBitmap& bitmap) {}
void EWebView::RenderViewCreated(RenderViewHost* render_view_host) {
SendDelayedMessages(render_view_host);
UpdateWebkitPreferencesEfl(render_view_host);
- RenderWidgetHostViewEfl* view =
- static_cast<RenderWidgetHostViewEfl*>(render_view_host->GetWidget()->GetView());
+ RenderWidgetHostViewEfl* view = static_cast<RenderWidgetHostViewEfl*>(
+ render_view_host->GetWidget()->GetView());
if (view)
view->SetEvasHandler(evas_event_handler_);
}
void EWebView::SetOverrideEncoding(const std::string& encoding) {
+ // EWK_BRINGUP definition should be removed.
+#if !defined(EWK_BRINGUP) // FIXME: m67 bringup
web_contents_->SetOverrideEncoding(encoding);
+#endif // !defined(EWK_BRINGUP)
}
-void EWebView::SetQuotaPermissionRequestCallback(Ewk_Quota_Permission_Request_Callback callback, void *user_data) {
+void EWebView::SetQuotaPermissionRequestCallback(
+ Ewk_Quota_Permission_Request_Callback callback,
+ void* user_data) {
quota_request_callback_.Set(callback, user_data);
}
-void EWebView::InvokeQuotaPermissionRequest(_Ewk_Quota_Permission_Request* request,
- const content::QuotaPermissionContext::PermissionCallback& cb) {
+void EWebView::InvokeQuotaPermissionRequest(
+ _Ewk_Quota_Permission_Request* request,
+ const content::QuotaPermissionContext::PermissionCallback& cb) {
quota_permission_request_map_[request] = cb;
request->setView(evas_object());
if (quota_request_callback_.IsCallbackSet())
QuotaRequestCancel(request);
}
-void EWebView::QuotaRequestReply(const _Ewk_Quota_Permission_Request *request,
+void EWebView::QuotaRequestReply(const _Ewk_Quota_Permission_Request* request,
bool allow) {
- DCHECK(quota_permission_request_map_.find(request) != quota_permission_request_map_.end());
+ DCHECK(quota_permission_request_map_.find(request) !=
+ quota_permission_request_map_.end());
- QuotaPermissionContext::PermissionCallback cb = quota_permission_request_map_[request];
+ QuotaPermissionContext::PermissionCallback cb =
+ quota_permission_request_map_[request];
if (allow)
- QuotaPermissionContextEfl::DispatchCallback(cb, QuotaPermissionContext::QUOTA_PERMISSION_RESPONSE_ALLOW);
+ QuotaPermissionContextEfl::DispatchCallback(
+ cb, QuotaPermissionContext::QUOTA_PERMISSION_RESPONSE_ALLOW);
else
- QuotaPermissionContextEfl::DispatchCallback(cb, QuotaPermissionContext::QUOTA_PERMISSION_RESPONSE_DISALLOW);
+ QuotaPermissionContextEfl::DispatchCallback(
+ cb, QuotaPermissionContext::QUOTA_PERMISSION_RESPONSE_DISALLOW);
quota_permission_request_map_.erase(request);
delete request;
}
-void EWebView::QuotaRequestCancel(const _Ewk_Quota_Permission_Request *request) {
- DCHECK(quota_permission_request_map_.find(request) != quota_permission_request_map_.end());
+void EWebView::QuotaRequestCancel(
+ const _Ewk_Quota_Permission_Request* request) {
+ DCHECK(quota_permission_request_map_.find(request) !=
+ quota_permission_request_map_.end());
- QuotaPermissionContext::PermissionCallback cb = quota_permission_request_map_[request];
- QuotaPermissionContextEfl::DispatchCallback(cb, QuotaPermissionContext::QUOTA_PERMISSION_RESPONSE_CANCELLED);
+ QuotaPermissionContext::PermissionCallback cb =
+ quota_permission_request_map_[request];
+ QuotaPermissionContextEfl::DispatchCallback(
+ cb, QuotaPermissionContext::QUOTA_PERMISSION_RESPONSE_CANCELLED);
quota_permission_request_map_.erase(request);
delete request;
}
bool EWebView::GetLinkMagnifierEnabled() const {
- return web_contents_->GetMutableRendererPrefs()->tap_multiple_targets_strategy == TAP_MULTIPLE_TARGETS_STRATEGY_POPUP;
+ return web_contents_->GetMutableRendererPrefs()
+ ->tap_multiple_targets_strategy ==
+ TAP_MULTIPLE_TARGETS_STRATEGY_POPUP;
}
void EWebView::SetLinkMagnifierEnabled(bool enabled) {
web_contents_->GetRenderViewHost()->SyncRendererPrefs();
}
-bool EWebView::GetSnapshotAsync(Eina_Rectangle rect,
+bool EWebView::GetSnapshotAsync(
+ Eina_Rectangle rect,
Ewk_Web_App_Screenshot_Captured_Callback callback,
void* user_data) {
if (!rwhv())
Evas_GL_API* gl_api = rwhv()->evasGlApi();
DCHECK(gl_api);
- int size = width * height * sizeof(GLuint);
+ int size = width * height * sizeof(GLuint);
GLuint* tmp = (GLuint*)malloc(size);
if (!tmp)
return NULL;
}
- gl_api->glReadPixels(x, y, width, height, GL_RGBA, GL_UNSIGNED_BYTE, (GLubyte*)bits);
+ gl_api->glReadPixels(x, y, width, height, GL_RGBA, GL_UNSIGNED_BYTE,
+ (GLubyte*)bits);
// flip the Y axis and change color format from RGBA to BGRA
int i, j, idx1, idx2;
idx1 = (j * width) + i;
idx2 = ((height - 1) - j) * width + i;
d = bits[idx1];
- tmp[idx2] = ((d & 0x000000ff) << 16) + ((d & 0x00ff0000) >> 16) + ((d & 0xff00ff00));
+ tmp[idx2] = ((d & 0x000000ff) << 16) + ((d & 0x00ff0000) >> 16) +
+ ((d & 0xff00ff00));
}
}
return new _Ewk_History(web_contents_->GetController());
}
-bool EWebView::WebAppCapableGet(Ewk_Web_App_Capable_Get_Callback callback, void *userData) {
- RenderViewHost *renderViewHost = web_contents_->GetRenderViewHost();
+bool EWebView::WebAppCapableGet(Ewk_Web_App_Capable_Get_Callback callback,
+ void* userData) {
+ RenderViewHost* renderViewHost = web_contents_->GetRenderViewHost();
if (!renderViewHost) {
return false;
}
- WebApplicationCapableGetCallback *cb = new WebApplicationCapableGetCallback(callback, userData);
+ WebApplicationCapableGetCallback* cb =
+ new WebApplicationCapableGetCallback(callback, userData);
int callbackId = web_app_capable_get_callback_map_.Add(cb);
- return renderViewHost->Send(new EwkViewMsg_WebAppCapableGet(renderViewHost->GetRoutingID(), callbackId));
+ return renderViewHost->Send(new EwkViewMsg_WebAppCapableGet(
+ renderViewHost->GetRoutingID(), callbackId));
}
-bool EWebView::WebAppIconUrlGet(Ewk_Web_App_Icon_URL_Get_Callback callback, void *userData) {
+bool EWebView::WebAppIconUrlGet(Ewk_Web_App_Icon_URL_Get_Callback callback,
+ void* userData) {
RenderViewHost* renderViewHost = web_contents_->GetRenderViewHost();
if (!renderViewHost) {
return false;
}
- WebApplicationIconUrlGetCallback *cb = new WebApplicationIconUrlGetCallback(callback, userData);
+ WebApplicationIconUrlGetCallback* cb =
+ new WebApplicationIconUrlGetCallback(callback, userData);
int callbackId = web_app_icon_url_get_callback_map_.Add(cb);
- return renderViewHost->Send(new EwkViewMsg_WebAppIconUrlGet(renderViewHost->GetRoutingID(), callbackId));
+ return renderViewHost->Send(new EwkViewMsg_WebAppIconUrlGet(
+ renderViewHost->GetRoutingID(), callbackId));
}
-bool EWebView::WebAppIconUrlsGet(Ewk_Web_App_Icon_URLs_Get_Callback callback, void *userData) {
+bool EWebView::WebAppIconUrlsGet(Ewk_Web_App_Icon_URLs_Get_Callback callback,
+ void* userData) {
RenderViewHost* renderViewHost = web_contents_->GetRenderViewHost();
if (!renderViewHost) {
return false;
}
- WebApplicationIconUrlsGetCallback *cb = new WebApplicationIconUrlsGetCallback(callback, userData);
+ WebApplicationIconUrlsGetCallback* cb =
+ new WebApplicationIconUrlsGetCallback(callback, userData);
int callbackId = web_app_icon_urls_get_callback_map_.Add(cb);
- return renderViewHost->Send(new EwkViewMsg_WebAppIconUrlsGet(renderViewHost->GetRoutingID(), callbackId));
+ return renderViewHost->Send(new EwkViewMsg_WebAppIconUrlsGet(
+ renderViewHost->GetRoutingID(), callbackId));
}
void EWebView::InvokeWebAppCapableGetCallback(bool capable, int callbackId) {
- WebApplicationCapableGetCallback *callback = web_app_capable_get_callback_map_.Lookup(callbackId);
+ WebApplicationCapableGetCallback* callback =
+ web_app_capable_get_callback_map_.Lookup(callbackId);
if (!callback)
return;
callback->Run(capable);
}
-void EWebView::InvokeWebAppIconUrlGetCallback(const std::string& iconUrl, int callbackId) {
- WebApplicationIconUrlGetCallback *callback = web_app_icon_url_get_callback_map_.Lookup(callbackId);
+void EWebView::InvokeWebAppIconUrlGetCallback(const std::string& iconUrl,
+ int callbackId) {
+ WebApplicationIconUrlGetCallback* callback =
+ web_app_icon_url_get_callback_map_.Lookup(callbackId);
if (!callback)
return;
callback->Run(iconUrl);
}
-void EWebView::InvokeWebAppIconUrlsGetCallback(const StringMap &iconUrls, int callbackId) {
- WebApplicationIconUrlsGetCallback *callback = web_app_icon_urls_get_callback_map_.Lookup(callbackId);
+void EWebView::InvokeWebAppIconUrlsGetCallback(const StringMap& iconUrls,
+ int callbackId) {
+ WebApplicationIconUrlsGetCallback* callback =
+ web_app_icon_urls_get_callback_map_.Lookup(callbackId);
if (!callback) {
return;
}
}
void EWebView::SetNotificationPermissionCallback(
- Ewk_View_Notification_Permission_Callback callback, void *user_data) {
+ Ewk_View_Notification_Permission_Callback callback,
+ void* user_data) {
notification_permission_callback_.Set(callback, user_data);
}
}
bool EWebView::InvokeNotificationPermissionCallback(
- Ewk_Notification_Permission_Request *request) {
+ Ewk_Notification_Permission_Request* request) {
Eina_Bool ret = EINA_FALSE;
notification_permission_callback_.Run(evas_object_, request, &ret);
return ret;
}
-int EWebView::SetEwkViewPlainTextGetCallback(Ewk_View_Plain_Text_Get_Callback callback, void* user_data) {
- EwkViewPlainTextGetCallback* view_plain_text_callback_ptr = new EwkViewPlainTextGetCallback;
+int EWebView::SetEwkViewPlainTextGetCallback(
+ Ewk_View_Plain_Text_Get_Callback callback,
+ void* user_data) {
+ EwkViewPlainTextGetCallback* view_plain_text_callback_ptr =
+ new EwkViewPlainTextGetCallback;
view_plain_text_callback_ptr->Set(callback, user_data);
return plain_text_get_callback_map_.Add(view_plain_text_callback_ptr);
}
-bool EWebView::PlainTextGet(Ewk_View_Plain_Text_Get_Callback callback, void* user_data) {
+bool EWebView::PlainTextGet(Ewk_View_Plain_Text_Get_Callback callback,
+ void* user_data) {
RenderViewHost* render_view_host = web_contents_->GetRenderViewHost();
if (!render_view_host)
return false;
- int plain_text_get_callback_id = SetEwkViewPlainTextGetCallback(callback, user_data);
- return render_view_host->Send(new EwkViewMsg_PlainTextGet(render_view_host->GetRoutingID(), plain_text_get_callback_id));
+ int plain_text_get_callback_id =
+ SetEwkViewPlainTextGetCallback(callback, user_data);
+ return render_view_host->Send(new EwkViewMsg_PlainTextGet(
+ render_view_host->GetRoutingID(), plain_text_get_callback_id));
}
-void EWebView::InvokePlainTextGetCallback(const std::string& content_text, int plain_text_get_callback_id) {
- EwkViewPlainTextGetCallback* view_plain_text_callback_invoke_ptr = plain_text_get_callback_map_.Lookup(plain_text_get_callback_id);
+void EWebView::InvokePlainTextGetCallback(const std::string& content_text,
+ int plain_text_get_callback_id) {
+ EwkViewPlainTextGetCallback* view_plain_text_callback_invoke_ptr =
+ plain_text_get_callback_map_.Lookup(plain_text_get_callback_id);
view_plain_text_callback_invoke_ptr->Run(evas_object(), content_text.c_str());
plain_text_get_callback_map_.Remove(plain_text_get_callback_id);
}
-void EWebView::SetViewGeolocationPermissionCallback(Ewk_View_Geolocation_Permission_Callback callback, void* user_data) {
+void EWebView::SetViewGeolocationPermissionCallback(
+ Ewk_View_Geolocation_Permission_Callback callback,
+ void* user_data) {
geolocation_permission_cb_.Set(callback, user_data);
}
-bool EWebView::InvokeViewGeolocationPermissionCallback(_Ewk_Geolocation_Permission_Request* permission_context, Eina_Bool* callback_result) {
- return geolocation_permission_cb_.Run(evas_object_, permission_context, callback_result);
+bool EWebView::InvokeViewGeolocationPermissionCallback(
+ _Ewk_Geolocation_Permission_Request* permission_context,
+ Eina_Bool* callback_result) {
+ return geolocation_permission_cb_.Run(evas_object_, permission_context,
+ callback_result);
}
void EWebView::SetViewUserMediaPermissionCallback(
- Ewk_View_User_Media_Permission_Callback callback, void* user_data) {
+ Ewk_View_User_Media_Permission_Callback callback,
+ void* user_data) {
user_media_permission_cb_.Set(callback, user_data);
}
_Ewk_User_Media_Permission_Request* permission_context,
Eina_Bool* callback_result) {
return user_media_permission_cb_.Run(evas_object_, permission_context,
- callback_result);
+ callback_result);
}
void EWebView::SetViewUnfocusAllowCallback(
- Ewk_View_Unfocus_Allow_Callback callback, void* user_data) {
+ Ewk_View_Unfocus_Allow_Callback callback,
+ void* user_data) {
unfocus_allow_cb_.Set(callback, user_data);
}
-bool EWebView::InvokeViewUnfocusAllowCallback(
- Ewk_Unfocus_Direction direction, Eina_Bool* callback_result) {
+bool EWebView::InvokeViewUnfocusAllowCallback(Ewk_Unfocus_Direction direction,
+ Eina_Bool* callback_result) {
return unfocus_allow_cb_.Run(evas_object_, direction, callback_result);
}
}
const char* EWebView::GetTitle() {
- title_ = UTF16ToUTF8(web_contents_->GetTitle());
+ title_ = base::UTF16ToUTF8(web_contents_->GetTitle());
return title_.c_str();
}
if (!render_view_host)
return false;
- return render_view_host->Send(new EwkViewMsg_PrintToPdf(render_view_host->GetRoutingID(),
- width, height, base::FilePath(filename)));
+ return render_view_host->Send(
+ new EwkViewMsg_PrintToPdf(render_view_host->GetRoutingID(), width, height,
+ base::FilePath(filename)));
}
-bool EWebView::GetMHTMLData(Ewk_View_MHTML_Data_Get_Callback callback, void* user_data) {
+bool EWebView::GetMHTMLData(Ewk_View_MHTML_Data_Get_Callback callback,
+ void* user_data) {
RenderViewHost* render_view_host = web_contents_->GetRenderViewHost();
if (!render_view_host)
return false;
MHTMLCallbackDetails* callback_details = new MHTMLCallbackDetails;
callback_details->Set(callback, user_data);
int mhtml_callback_id = mhtml_callback_map_.Add(callback_details);
- return render_view_host->Send(new EwkViewMsg_GetMHTMLData(render_view_host->GetRoutingID(), mhtml_callback_id));
+ return render_view_host->Send(new EwkViewMsg_GetMHTMLData(
+ render_view_host->GetRoutingID(), mhtml_callback_id));
}
-void EWebView::OnMHTMLContentGet(const std::string& mhtml_content, int callback_id) {
- MHTMLCallbackDetails* callback_details = mhtml_callback_map_.Lookup(callback_id);
+void EWebView::OnMHTMLContentGet(const std::string& mhtml_content,
+ int callback_id) {
+ MHTMLCallbackDetails* callback_details =
+ mhtml_callback_map_.Lookup(callback_id);
callback_details->Run(evas_object(), mhtml_content.c_str());
mhtml_callback_map_.Remove(callback_id);
}
bool EWebView::IsFullscreen() {
- return web_contents_delegate_->IsFullscreenForTabOrPending(web_contents_.get());
+ return web_contents_delegate_->IsFullscreenForTabOrPending(
+ web_contents_.get());
}
void EWebView::ExitFullscreen() {
web_contents_delegate_->GetJavaScriptDialogManager(web_contents_.get()));
}
-void EWebView::SetJavaScriptAlertCallback(Ewk_View_JavaScript_Alert_Callback callback, void* user_data) {
+void EWebView::SetJavaScriptAlertCallback(
+ Ewk_View_JavaScript_Alert_Callback callback,
+ void* user_data) {
GetJavaScriptDialogManagerEfl()->SetAlertCallback(callback, user_data);
}
void EWebView::JavaScriptAlertReply() {
- GetJavaScriptDialogManagerEfl()->ExecuteDialogClosedCallBack(true, std::string());
+ GetJavaScriptDialogManagerEfl()->ExecuteDialogClosedCallBack(true,
+ std::string());
SmartCallback<EWebViewCallbacks::PopupReplyWaitFinish>().call(0);
}
-void EWebView::SetJavaScriptConfirmCallback(Ewk_View_JavaScript_Confirm_Callback callback, void* user_data) {
+void EWebView::SetJavaScriptConfirmCallback(
+ Ewk_View_JavaScript_Confirm_Callback callback,
+ void* user_data) {
GetJavaScriptDialogManagerEfl()->SetConfirmCallback(callback, user_data);
}
void EWebView::JavaScriptConfirmReply(bool result) {
- GetJavaScriptDialogManagerEfl()->ExecuteDialogClosedCallBack(result, std::string());
+ GetJavaScriptDialogManagerEfl()->ExecuteDialogClosedCallBack(result,
+ std::string());
SmartCallback<EWebViewCallbacks::PopupReplyWaitFinish>().call(0);
}
-void EWebView::SetJavaScriptPromptCallback(Ewk_View_JavaScript_Prompt_Callback callback, void* user_data) {
+void EWebView::SetJavaScriptPromptCallback(
+ Ewk_View_JavaScript_Prompt_Callback callback,
+ void* user_data) {
GetJavaScriptDialogManagerEfl()->SetPromptCallback(callback, user_data);
}
void EWebView::JavaScriptPromptReply(const char* result) {
- GetJavaScriptDialogManagerEfl()->ExecuteDialogClosedCallBack(true, (std::string(result)));
+ GetJavaScriptDialogManagerEfl()->ExecuteDialogClosedCallBack(
+ true, (std::string(result)));
SmartCallback<EWebViewCallbacks::PopupReplyWaitFinish>().call(0);
}
-void EWebView::GetPageScaleRange(double *min_scale, double *max_scale) {
+void EWebView::GetPageScaleRange(double* min_scale, double* max_scale) {
RenderViewHost* render_view_host = web_contents_->GetRenderViewHost();
if (!render_view_host) {
if (min_scale)
if (!render_view_host)
return;
- render_view_host->Send(new EwkViewMsg_SetDrawsTransparentBackground(render_view_host->GetRoutingID(), enabled));
+ render_view_host->Send(new EwkViewMsg_SetDrawsTransparentBackground(
+ render_view_host->GetRoutingID(), enabled));
}
-void EWebView::GetSessionData(const char **data, unsigned *length) const {
+void EWebView::GetSessionData(const char** data, unsigned* length) const {
static const int MAX_SESSION_ENTRY_SIZE = std::numeric_limits<int>::max();
- NavigationController &navigationController = web_contents_->GetController();
+ NavigationController& navigationController = web_contents_->GetController();
base::Pickle sessionPickle;
const int itemCount = navigationController.GetEntryCount();
sessionPickle.WriteInt(navigationController.GetCurrentEntryIndex());
for (int i = 0; i < itemCount; i++) {
- NavigationEntry *navigationEntry = navigationController.GetEntryAtIndex(i);
+ NavigationEntry* navigationEntry = navigationController.GetEntryAtIndex(i);
sessions::SerializedNavigationEntry serializedEntry =
- sessions::ContentSerializedNavigationBuilder::FromNavigationEntry(i, *navigationEntry);
+ sessions::ContentSerializedNavigationBuilder::FromNavigationEntry(
+ i, *navigationEntry);
serializedEntry.WriteToPickle(MAX_SESSION_ENTRY_SIZE, &sessionPickle);
}
- *data = static_cast<char *>(malloc(sizeof(char) * sessionPickle.size()));
- memcpy(const_cast<char *>(*data), sessionPickle.data(), sessionPickle.size());
+ *data = static_cast<char*>(malloc(sizeof(char) * sessionPickle.size()));
+ memcpy(const_cast<char*>(*data), sessionPickle.data(), sessionPickle.size());
*length = sessionPickle.size();
}
-bool EWebView::RestoreFromSessionData(const char *data, unsigned length) {
+bool EWebView::RestoreFromSessionData(const char* data, unsigned length) {
base::Pickle sessionPickle(data, length);
base::PickleIterator pickleIterator(sessionPickle);
int entryCount;
sessions::ContentSerializedNavigationBuilder::ToNavigationEntries(
serializedEntries, context()->browser_context());
- NavigationController &navigationController = web_contents_->GetController();
+ NavigationController& navigationController = web_contents_->GetController();
if (currentEntry < 0)
currentEntry = 0;
if (currentEntry >= static_cast<int>(scopedEntries.size()))
currentEntry = scopedEntries.size() - 1;
- navigationController.Restore(currentEntry,
- NavigationController::RESTORE_LAST_SESSION_EXITED_CLEANLY,
- &scopedEntries);
+#if !defined(EWK_BRINGUP) // FIXME: m67 bringup
+ // FIXME: EWK_BRINGUP definition should be removed.
+ navigationController.Restore(
+ currentEntry, NavigationController::RESTORE_LAST_SESSION_EXITED_CLEANLY,
+ &scopedEntries);
+#endif // !defined(EWK_BRINGUP)
return true;
}
void EWebView::SetBrowserFont() {
RenderViewHost* render_view_host = web_contents_->GetRenderViewHost();
if (render_view_host)
- render_view_host->Send(new EwkViewMsg_SetBrowserFont(render_view_host->GetRoutingID()));
+ render_view_host->Send(
+ new EwkViewMsg_SetBrowserFont(render_view_host->GetRoutingID()));
}
void EWebView::SetCertificatePem(const std::string& certificate) {
pem_certificate_ = certificate;
- SmartCallback<EWebViewCallbacks::SetCertificatePem>().call(pem_certificate_.c_str());
+ SmartCallback<EWebViewCallbacks::SetCertificatePem>().call(
+ pem_certificate_.c_str());
}
bool EWebView::IsDragging() const {
void EWebView::ShowFileChooser(content::RenderFrameHost* render_frame_host,
const content::FileChooserParams& params) {
#if defined(OS_TIZEN_MOBILE)
-#if !defined(EWK_BRINGUP)
+#if !defined(EWK_BRINGUP) // FIXME: m67 bringup
if (params.capture) {
const std::string capture_types[] = {"video/*", "audio/*", "image/*"};
- unsigned int capture_types_num = sizeof(capture_types)/sizeof(*capture_types);
+ unsigned int capture_types_num =
+ sizeof(capture_types) / sizeof(*capture_types);
for (unsigned int i = 0; i < capture_types_num; ++i) {
for (unsigned int j = 0; j < params.accept_types.size(); ++j) {
if (UTF16ToUTF8(params.accept_types[j]) == capture_types[i]) {
}
#endif
#endif
- file_chooser_.reset(new content::FileChooserControllerEfl(render_frame_host, ¶ms));
+ file_chooser_.reset(
+ new content::FileChooserControllerEfl(render_frame_host, ¶ms));
file_chooser_->Open();
}
if (!render_view_host)
return;
- IPC::Message* message = new ViewMsg_SetViewMode(render_view_host->GetRoutingID(), view_mode);
+ IPC::Message* message =
+ new ViewMsg_SetViewMode(render_view_host->GetRoutingID(), view_mode);
if (render_view_host->IsRenderViewLive()) {
render_view_host->Send(message);
} else {
return true;
}
-void EWebView::InputPickerShow(ui::TextInputType input_type, double input_value)
-{
+void EWebView::InputPickerShow(ui::TextInputType input_type,
+ double input_value) {
inputPicker_.reset(new InputPicker(*this));
inputPicker_->showDatePicker(input_type, input_value);
}
RenderFrameHost* render_frame_host = web_contents_->GetMainFrame();
if (render_frame_host)
render_frame_host->Send(new EwkFrameMsg_LoadNotFoundErrorPage(
- render_frame_host->GetRoutingID(), invalidUrl));
+ render_frame_host->GetRoutingID(), invalidUrl));
}
std::string EWebView::GetPlatformLocale() {
bool callback_handled = false;
SmartCallback<EWebViewCallbacks::WebProcessCrashed>().call(&callback_handled);
if (!callback_handled)
- LoadHTMLString(kRendererCrashedHTMLMessage, NULL, last_url.possibly_invalid_spec().c_str());
+ LoadHTMLString(kRendererCrashedHTMLMessage, NULL,
+ last_url.possibly_invalid_spec().c_str());
}
void EWebView::HandleRendererProcessCrash() {
BrowserThread::PostTask(BrowserThread::UI, FROM_HERE,
- base::Bind(&EWebView::InvokeWebProcessCrashedCallback,
- base::Unretained(this)));
+ base::Bind(&EWebView::InvokeWebProcessCrashedCallback,
+ base::Unretained(this)));
}
void EWebView::InitializeContent() {
if (!new_contents) {
WebContents::CreateParams params(context_->browser_context());
params.initial_size = gfx::Size(width, height);
- web_contents_.reset(new WebContentsImplEfl(
- context_->browser_context(), this));
+ web_contents_.reset(
+ new WebContentsImplEfl(context_->browser_context(), this));
static_cast<WebContentsImpl*>(web_contents_.get())->Init(params);
VLOG(1) << "Initial WebContents size: " << params.initial_size.ToString();
} else {
//
// void OnNewWindowRequest(void *data, Evas_Object*, void* out_view) {
// (..)
- // EvasObject* new_web_view = ewk_view_add_with_context(GetEvas(), ewk_context_new());
+ // EvasObject* new_web_view = ewk_view_add_with_context(GetEvas(),
+ // ewk_context_new());
// *static_cast<Evas_Object**>(out_view) = new_web_view;
// (..)
// }
// than the one the new WebContents object will hold.
//
// CHECK below aims at catching misuse of this API.
- bool should_crash =
- context_->GetImpl()->browser_context() != web_contents_->GetBrowserContext();
+ bool should_crash = context_->GetImpl()->browser_context() !=
+ web_contents_->GetBrowserContext();
if (should_crash) {
- CHECK(false) << "BrowserContext of new WebContents does not match EWebView's. "
- << "Please see 'ewk_view_add*' documentation. "
- << "Aborting execution ...";
+ CHECK(false)
+ << "BrowserContext of new WebContents does not match EWebView's. "
+ << "Please see 'ewk_view_add*' documentation. "
+ << "Aborting execution ...";
}
}
web_contents_delegate_.reset(new WebContentsDelegateEfl(this));
web_contents_->SetDelegate(web_contents_delegate_.get());
GetWebContentsViewEfl()->SetEflDelegate(
new WebContentsViewEflDelegateEwk(this));
- WebContentsImplEfl* wc_efl = static_cast<WebContentsImplEfl*>(
- web_contents_.get());
+ WebContentsImplEfl* wc_efl =
+ static_cast<WebContentsImplEfl*>(web_contents_.get());
wc_efl->SetEflDelegate(new WebContentsEflDelegateEwk(this));
- back_forward_list_.reset(new _Ewk_Back_Forward_List(
- web_contents_->GetController()));
back_forward_list_.reset(
- new _Ewk_Back_Forward_List(web_contents_->GetController()));
+ new _Ewk_Back_Forward_List(web_contents_->GetController()));
+ back_forward_list_.reset(
+ new _Ewk_Back_Forward_List(web_contents_->GetController()));
permission_popup_manager_.reset(new PermissionPopupManager(evas_object_));
void EWebView::cameraResultCb(service_h request,
service_h reply,
service_result_e result,
- void* data)
-{
+ void* data) {
EWebView* webview = static_cast<EWebView*>(data);
- RenderViewHost* render_view_host = webview->web_contents_->GetRenderViewHost();
+ RenderViewHost* render_view_host =
+ webview->web_contents_->GetRenderViewHost();
if (result == SERVICE_RESULT_SUCCEEDED) {
int ret = -1;
char** filesarray;
int number;
- ret =service_get_extra_data_array(reply, SERVICE_DATA_SELECTED,
- &filesarray,&number);
+ ret = service_get_extra_data_array(reply, SERVICE_DATA_SELECTED,
+ &filesarray, &number);
if (filesarray) {
- for(int i =0; i< number;i++) {
+ for (int i = 0; i < number; i++) {
std::vector<ui::SelectedFileInfo> files;
if (!render_view_host) {
return;
if (filesarray[i]) {
GURL url(filesarray[i]);
if (!url.is_valid()) {
- base::FilePath path(url.SchemeIsFile() ? url.path() :
- filesarray[i]);
+ base::FilePath path(url.SchemeIsFile() ? url.path()
+ : filesarray[i]);
files.push_back(ui::SelectedFileInfo(path, base::FilePath()));
}
}
render_view_host->FilesSelectedInChooser(files,
- webview->filechooser_mode_);
+ webview->filechooser_mode_);
}
}
} else {
std::vector<ui::SelectedFileInfo> files;
if (render_view_host) {
render_view_host->FilesSelectedInChooser(files,
- webview->filechooser_mode_);
+ webview->filechooser_mode_);
}
}
}
-bool EWebView::LaunchCamera(base::string16 mimetype)
-{
+bool EWebView::LaunchCamera(base::string16 mimetype) {
service_h svcHandle = 0;
if (service_create(&svcHandle) < 0 || !svcHandle) {
LOG(ERROR) << __FUNCTION__ << " Service Creation Failed ";
}
#endif
-void EWebView::UrlRequestSet(const char* url,
+void EWebView::UrlRequestSet(
+ const char* url,
content::NavigationController::LoadURLType loadtype,
- Eina_Hash* headers, const char* body) {
+ Eina_Hash* headers,
+ const char* body) {
content::NavigationController::LoadURLParams params =
content::NavigationController::LoadURLParams(GURL(url));
params.load_type = loadtype;
if (body) {
std::string s(body);
- params.post_data = content::ResourceRequestBody::CreateFromBytes(
- s.data(), s.size());
+ params.post_data =
+ content::ResourceRequestBody::CreateFromBytes(s.data(), s.size());
}
net::HttpRequestHeaders header;
base::StringPiece name = static_cast<const char*>(t->key);
base::StringPiece value = value_str;
header.SetHeader(name, value);
- //net::HttpRequestHeaders.ToString() returns string with newline
+ // net::HttpRequestHeaders.ToString() returns string with newline
params.extra_headers += header.ToString();
}
}
}
void EWebView::HandleZoomGesture(blink::WebGestureEvent& event) {
- if (event.type == blink::WebInputEvent::GestureDoubleTap ||
- event.type == blink::WebInputEvent::GesturePinchBegin) {
+ blink::WebInputEvent::Type event_type = event.GetType();
+ if (event_type == blink::WebInputEvent::kGestureDoubleTap ||
+ event_type == blink::WebInputEvent::kGesturePinchBegin) {
SmartCallback<EWebViewCallbacks::ZoomStarted>().call();
}
- if (event.type == blink::WebInputEvent::GestureDoubleTap ||
- event.type == blink::WebInputEvent::GesturePinchEnd) {
+ if (event_type == blink::WebInputEvent::kGestureDoubleTap ||
+ event_type == blink::WebInputEvent::kGesturePinchEnd) {
SmartCallback<EWebViewCallbacks::ZoomFinished>().call();
}
}
DCHECK(render_view_host);
if (!BrowserThread::CurrentlyOn(BrowserThread::UI)) {
- BrowserThread::PostTask(BrowserThread::UI, FROM_HERE,
- base::Bind(&EWebView::SendDelayedMessages, base::Unretained(this), render_view_host));
+ BrowserThread::PostTask(
+ BrowserThread::UI, FROM_HERE,
+ base::Bind(&EWebView::SendDelayedMessages, base::Unretained(this),
+ render_view_host));
return;
}
- for (auto iter = delayed_messages_.begin(); iter != delayed_messages_.end(); ++iter) {
+ for (auto iter = delayed_messages_.begin(); iter != delayed_messages_.end();
+ ++iter) {
IPC::Message* message = *iter;
message->set_routing_id(render_view_host->GetRoutingID());
render_view_host->Send(message);
#define EWEB_VIEW_H
#if defined(OS_TIZEN_MOBILE)
-#if !defined(EWK_BRINGUP)
-// FIXME: appfw/app_service.h is no more in Tizen 2.3, figure out what to include instead.
+#if !defined(EWK_BRINGUP) // FIXME: m67 bringup
+// FIXME: appfw/app_service.h is no more in Tizen 2.3, figure out what to
+// include instead.
#include <appcore-agent/service_app.h>
#endif
#include <vector>
#include <locale.h>
#include "base/callback.h"
-#include "base/id_map.h"
+#include "base/containers/id_map.h"
#include "base/synchronization/waitable_event.h"
#include "browser/inputpicker/InputPicker.h"
#include "browser/selectpicker/popup_picker.h"
#include "ui/gfx/geometry/point.h"
#include "ui/gfx/geometry/size.h"
#include "web_contents_delegate_efl.h"
+#include "third_party/blink/public/web/WebViewModeEnums.h"
namespace content {
class RenderFrameHost;
user_data_ = data;
}
- bool IsCallbackSet() const {
- return callback_;
- }
+ bool IsCallbackSet() const { return callback_; }
- Eina_Bool Run(Evas_Object* webview, CallbackParameter param, Eina_Bool* callback_result) {
+ Eina_Bool Run(Evas_Object* webview,
+ CallbackParameter param,
+ Eina_Bool* callback_result) {
CHECK(callback_result);
if (IsCallbackSet()) {
*callback_result = callback_(webview, param, user_data_);
class WebApplicationIconUrlGetCallback {
public:
- WebApplicationIconUrlGetCallback(Ewk_Web_App_Icon_URL_Get_Callback func, void *user_data)
- : func_(func), user_data_(user_data)
- {}
- void Run(const std::string &url) {
+ WebApplicationIconUrlGetCallback(Ewk_Web_App_Icon_URL_Get_Callback func,
+ void* user_data)
+ : func_(func), user_data_(user_data) {}
+ void Run(const std::string& url) {
if (func_) {
(func_)(url.c_str(), user_data_);
}
private:
Ewk_Web_App_Icon_URL_Get_Callback func_;
- void *user_data_;
+ void* user_data_;
};
class WebApplicationIconUrlsGetCallback {
public:
- WebApplicationIconUrlsGetCallback(Ewk_Web_App_Icon_URLs_Get_Callback func, void *user_data)
- : func_(func), user_data_(user_data)
- {}
- void Run(const std::map<std::string, std::string> &urls) {
+ WebApplicationIconUrlsGetCallback(Ewk_Web_App_Icon_URLs_Get_Callback func,
+ void* user_data)
+ : func_(func), user_data_(user_data) {}
+ void Run(const std::map<std::string, std::string>& urls) {
if (func_) {
- Eina_List *list = NULL;
- for (std::map<std::string, std::string>::const_iterator it = urls.begin(); it != urls.end(); ++it) {
- _Ewk_Web_App_Icon_Data *data = ewkWebAppIconDataCreate(it->first, it->second);
+ Eina_List* list = NULL;
+ for (std::map<std::string, std::string>::const_iterator it = urls.begin();
+ it != urls.end(); ++it) {
+ _Ewk_Web_App_Icon_Data* data =
+ ewkWebAppIconDataCreate(it->first, it->second);
list = eina_list_append(list, data);
}
(func_)(list, user_data_);
private:
Ewk_Web_App_Icon_URLs_Get_Callback func_;
- void *user_data_;
+ void* user_data_;
};
class WebApplicationCapableGetCallback {
public:
- WebApplicationCapableGetCallback(Ewk_Web_App_Capable_Get_Callback func, void *user_data)
- : func_(func), user_data_(user_data)
- {}
+ WebApplicationCapableGetCallback(Ewk_Web_App_Capable_Get_Callback func,
+ void* user_data)
+ : func_(func), user_data_(user_data) {}
void Run(bool capable) {
if (func_) {
(func_)(capable ? EINA_TRUE : EINA_FALSE, user_data_);
private:
Ewk_Web_App_Capable_Get_Callback func_;
- void *user_data_;
+ void* user_data_;
};
class WebViewAsyncRequestHitTestDataCallback;
// call this once after created and before use
void Initialize();
- void CreateNewWindow(content::WebContentsEflDelegate::WebContentsCreateCallback);
+ void CreateNewWindow(
+ content::WebContentsEflDelegate::WebContentsCreateCallback);
static Evas_Object* GetHostWindowDelegate(const content::WebContents*);
Ewk_Context* context() const { return context_.get(); }
Evas_Object* evas_object() const { return evas_object_; }
Evas_Object* native_view() const { return native_view_; }
Evas* GetEvas() const { return evas_object_evas_get(evas_object_); }
- PermissionPopupManager* GetPermissionPopupManager() const
- {
+ PermissionPopupManager* GetPermissionPopupManager() const {
return permission_popup_manager_.get();
}
- content::WebContents& web_contents() const
- {
- return *web_contents_.get();
- }
+ content::WebContents& web_contents() const { return *web_contents_.get(); }
- template<EWebViewCallbacks::CallbackType callbackType>
- EWebViewCallbacks::CallBack<callbackType> SmartCallback() const
- {
+ template <EWebViewCallbacks::CallbackType callbackType>
+ EWebViewCallbacks::CallBack<callbackType> SmartCallback() const {
return EWebViewCallbacks::CallBack<callbackType>(evas_object_);
}
void SetTouchEventsEnabled(bool enabled);
bool MouseEventsEnabled() const;
void SetMouseEventsEnabled(bool enabled);
- void HandleTouchEvents(Ewk_Touch_Event_Type type, const Eina_List *points, const Evas_Modifier *modifiers);
+ void HandleTouchEvents(Ewk_Touch_Event_Type type,
+ const Eina_List* points,
+ const Evas_Modifier* modifiers);
void Show();
void Hide();
- bool ExecuteJavaScript(const char* script, Ewk_View_Script_Execute_Callback callback, void* userdata);
+ bool ExecuteJavaScript(const char* script,
+ Ewk_View_Script_Execute_Callback callback,
+ void* userdata);
bool SetUserAgent(const char* userAgent);
bool SetUserAgentAppName(const char* application_name);
bool SetPrivateBrowsing(bool incognito);
Ewk_Settings* GetSettings() { return settings_.get(); }
_Ewk_Frame* GetMainFrame();
void UpdateWebKitPreferences();
- void LoadHTMLString(const char* html, const char* base_uri, const char* unreachable_uri);
+ void LoadHTMLString(const char* html,
+ const char* base_uri,
+ const char* unreachable_uri);
void LoadPlainTextString(const char* plain_text);
- void LoadData(const char* data, size_t size, const char* mime_type, const char* encoding, const char* base_uri, const char* unreachable_uri = NULL);
-
- void InvokeLoadError(const GURL& url, int error_code,
- const std::string& error_description, bool is_main_frame);
- void InvokeAuthCallback(LoginDelegateEfl* login_delegate, const GURL& url, const std::string& realm);
+ void LoadData(const char* data,
+ size_t size,
+ const char* mime_type,
+ const char* encoding,
+ const char* base_uri,
+ const char* unreachable_uri = NULL);
+
+ void InvokeLoadError(const GURL& url,
+ int error_code,
+ const std::string& error_description,
+ bool is_main_frame);
+ void InvokeAuthCallback(LoginDelegateEfl* login_delegate,
+ const GURL& url,
+ const std::string& realm);
void Find(const char* text, Ewk_Find_Options);
void InvokeAuthCallbackOnUI(_Ewk_Auth_Challenge* auth_challenge);
void SetContentSecurityPolicy(const char* policy, Ewk_CSP_Header_Type type);
void ShowPopupMenu(const std::vector<content::MenuItem>& items,
- int selectedIndex, bool multiple);
+ int selectedIndex,
+ bool multiple);
Eina_Bool HidePopupMenu();
- void UpdateFormNavigation(int formElementCount, int currentNodeIndex,
- bool prevState, bool nextState);
+ void UpdateFormNavigation(int formElementCount,
+ int currentNodeIndex,
+ bool prevState,
+ bool nextState);
void FormNavigate(bool direction);
bool IsSelectPickerShown() const;
void CloseSelectPicker();
bool GetScrollPosition(int* x, int* y) const;
void SetScroll(int x, int y);
void UrlRequestSet(const char* url,
- content::NavigationController::LoadURLType loadtype,
- Eina_Hash* headers,
- const char* body);
+ content::NavigationController::LoadURLType loadtype,
+ Eina_Hash* headers,
+ const char* body);
content::SelectionControllerEfl* GetSelectionController() const;
- content::PopupControllerEfl* GetPopupController() const { return popup_controller_.get(); }
+ content::PopupControllerEfl* GetPopupController() const {
+ return popup_controller_.get();
+ }
ScrollDetector* GetScrollDetector() const { return scroll_detector_.get(); }
void MoveCaret(const gfx::Point& point);
void QuerySelectionStyle();
bool GetSelectionRange(Eina_Rectangle* left_rect, Eina_Rectangle* right_rect);
Eina_Bool ClearSelection();
- // Callback OnCopyFromBackingStore will be called once we get the snapshot from render
+ // Callback OnCopyFromBackingStore will be called once we get the snapshot
+ // from render
void OnCopyFromBackingStore(bool success, const SkBitmap& bitmap);
void RenderViewCreated(content::RenderViewHost* render_view_host);
*/
Evas_Object* GetSnapshot(Eina_Rectangle rect);
- bool GetSnapshotAsync(Eina_Rectangle rect, Ewk_Web_App_Screenshot_Captured_Callback callback, void* user_data);
+ bool GetSnapshotAsync(Eina_Rectangle rect,
+ Ewk_Web_App_Screenshot_Captured_Callback callback,
+ void* user_data);
void InvokePolicyResponseCallback(_Ewk_Policy_Decision* policy_decision);
void InvokePolicyNavigationCallback(content::RenderViewHost* rvh,
- NavigationPolicyParams params, bool* handled);
+ NavigationPolicyParams params,
+ bool* handled);
void UseSettingsFont();
_Ewk_Hit_Test* RequestHitTestDataAt(int x, int y, Ewk_Hit_Test_Mode mode);
- Eina_Bool AsyncRequestHitTestDataAt(int x, int y,
+ Eina_Bool AsyncRequestHitTestDataAt(int x,
+ int y,
+ Ewk_Hit_Test_Mode mode,
+ Ewk_View_Hit_Test_Request_Callback,
+ void* user_data);
+ _Ewk_Hit_Test* RequestHitTestDataAtBlinkCoords(int x,
+ int y,
+ Ewk_Hit_Test_Mode mode);
+ Eina_Bool AsyncRequestHitTestDataAtBlinkCords(
+ int x,
+ int y,
Ewk_Hit_Test_Mode mode,
Ewk_View_Hit_Test_Request_Callback,
void* user_data);
- _Ewk_Hit_Test* RequestHitTestDataAtBlinkCoords(int x, int y,
- Ewk_Hit_Test_Mode mode);
- Eina_Bool AsyncRequestHitTestDataAtBlinkCords(int x, int y,
- Ewk_Hit_Test_Mode mode,
- Ewk_View_Hit_Test_Request_Callback,
- void* user_data);
- void DispatchAsyncHitTestData(const Hit_Test_Params& params, int64_t request_id);
+ void DispatchAsyncHitTestData(const Hit_Test_Params& params,
+ int64_t request_id);
void UpdateHitTestData(const Hit_Test_Params& params);
int current_find_request_id() const { return current_find_request_id_; }
bool PlainTextGet(Ewk_View_Plain_Text_Get_Callback callback, void* user_data);
- void InvokePlainTextGetCallback(const std::string& content_text, int plain_text_get_callback_id);
- int SetEwkViewPlainTextGetCallback(Ewk_View_Plain_Text_Get_Callback callback, void* user_data);
- void SetViewGeolocationPermissionCallback(Ewk_View_Geolocation_Permission_Callback callback, void* user_data);
- bool InvokeViewGeolocationPermissionCallback(_Ewk_Geolocation_Permission_Request* geolocation_permission_request_context, Eina_Bool* result);
+ void InvokePlainTextGetCallback(const std::string& content_text,
+ int plain_text_get_callback_id);
+ int SetEwkViewPlainTextGetCallback(Ewk_View_Plain_Text_Get_Callback callback,
+ void* user_data);
+ void SetViewGeolocationPermissionCallback(
+ Ewk_View_Geolocation_Permission_Callback callback,
+ void* user_data);
+ bool InvokeViewGeolocationPermissionCallback(
+ _Ewk_Geolocation_Permission_Request*
+ geolocation_permission_request_context,
+ Eina_Bool* result);
void SetViewUserMediaPermissionCallback(
Ewk_View_User_Media_Permission_Callback callback,
void* user_data);
bool InvokeViewUserMediaPermissionCallback(
_Ewk_User_Media_Permission_Request* user_media_permission_request_context,
Eina_Bool* result);
- void SetViewUnfocusAllowCallback(Ewk_View_Unfocus_Allow_Callback callback, void* user_data);
- bool InvokeViewUnfocusAllowCallback(Ewk_Unfocus_Direction direction, Eina_Bool* result);
+ void SetViewUnfocusAllowCallback(Ewk_View_Unfocus_Allow_Callback callback,
+ void* user_data);
+ bool InvokeViewUnfocusAllowCallback(Ewk_Unfocus_Direction direction,
+ Eina_Bool* result);
void DidChangeContentsSize(int width, int height);
const Eina_Rectangle GetContentsSize() const;
void GetScrollSize(int* w, int* h);
_Ewk_Back_Forward_List* GetBackForwardList() const;
void InvokeBackForwardListChangedCallback();
_Ewk_History* GetBackForwardHistory() const;
- bool WebAppCapableGet(Ewk_Web_App_Capable_Get_Callback callback, void *userData);
- bool WebAppIconUrlGet(Ewk_Web_App_Icon_URL_Get_Callback callback, void *userData);
- bool WebAppIconUrlsGet(Ewk_Web_App_Icon_URLs_Get_Callback callback, void *userData);
+ bool WebAppCapableGet(Ewk_Web_App_Capable_Get_Callback callback,
+ void* userData);
+ bool WebAppIconUrlGet(Ewk_Web_App_Icon_URL_Get_Callback callback,
+ void* userData);
+ bool WebAppIconUrlsGet(Ewk_Web_App_Icon_URLs_Get_Callback callback,
+ void* userData);
void InvokeWebAppCapableGetCallback(bool capable, int callbackId);
- void InvokeWebAppIconUrlGetCallback(const std::string &iconUrl, int callbackId);
- void InvokeWebAppIconUrlsGetCallback(const std::map<std::string, std::string> &iconUrls, int callbackId);
- void SetNotificationPermissionCallback(Ewk_View_Notification_Permission_Callback callback, void* user_data);
+ void InvokeWebAppIconUrlGetCallback(const std::string& iconUrl,
+ int callbackId);
+ void InvokeWebAppIconUrlsGetCallback(
+ const std::map<std::string, std::string>& iconUrls,
+ int callbackId);
+ void SetNotificationPermissionCallback(
+ Ewk_View_Notification_Permission_Callback callback,
+ void* user_data);
bool IsNotificationPermissionCallbackSet() const;
- bool InvokeNotificationPermissionCallback(Ewk_Notification_Permission_Request* request);
+ bool InvokeNotificationPermissionCallback(
+ Ewk_Notification_Permission_Request* request);
bool GetMHTMLData(Ewk_View_MHTML_Data_Get_Callback callback, void* user_data);
void OnMHTMLContentGet(const std::string& mhtml_content, int callback_id);
void ExitFullscreen();
double GetScale();
void DidChangePageScaleFactor(double scale_factor);
- void SetJavaScriptAlertCallback(Ewk_View_JavaScript_Alert_Callback callback, void* user_data);
+ void SetJavaScriptAlertCallback(Ewk_View_JavaScript_Alert_Callback callback,
+ void* user_data);
void JavaScriptAlertReply();
- void SetJavaScriptConfirmCallback(Ewk_View_JavaScript_Confirm_Callback callback, void* user_data);
+ void SetJavaScriptConfirmCallback(
+ Ewk_View_JavaScript_Confirm_Callback callback,
+ void* user_data);
void JavaScriptConfirmReply(bool result);
- void SetJavaScriptPromptCallback(Ewk_View_JavaScript_Prompt_Callback callback, void* user_data);
+ void SetJavaScriptPromptCallback(Ewk_View_JavaScript_Prompt_Callback callback,
+ void* user_data);
void JavaScriptPromptReply(const char* result);
void set_renderer_crashed();
- void GetPageScaleRange(double *min_scale, double *max_scale);
+ void GetPageScaleRange(double* min_scale, double* max_scale);
void SetDrawsTransparentBackground(bool enabled);
- void GetSessionData(const char **data, unsigned *length) const;
- bool RestoreFromSessionData(const char *data, unsigned length);
+ void GetSessionData(const char** data, unsigned* length) const;
+ bool RestoreFromSessionData(const char* data, unsigned length);
void ShowFileChooser(content::RenderFrameHost* render_frame_host,
const content::FileChooserParams&);
void SetBrowserFont();
void SetLinkMagnifierEnabled(bool enabled);
void SetOverrideEncoding(const std::string& encoding);
- void SetQuotaPermissionRequestCallback(Ewk_Quota_Permission_Request_Callback callback,
- void* user_data);
- void InvokeQuotaPermissionRequest(_Ewk_Quota_Permission_Request* request,
- const content::QuotaPermissionContext::PermissionCallback& cb);
- void QuotaRequestReply(const _Ewk_Quota_Permission_Request *request,
+ void SetQuotaPermissionRequestCallback(
+ Ewk_Quota_Permission_Request_Callback callback,
+ void* user_data);
+ void InvokeQuotaPermissionRequest(
+ _Ewk_Quota_Permission_Request* request,
+ const content::QuotaPermissionContext::PermissionCallback& cb);
+ void QuotaRequestReply(const _Ewk_Quota_Permission_Request* request,
bool allow);
- void QuotaRequestCancel(const _Ewk_Quota_Permission_Request *request);
+ void QuotaRequestCancel(const _Ewk_Quota_Permission_Request* request);
void SetViewMode(blink::WebViewMode view_mode);
void SendDelayedMessages(content::RenderViewHost* render_view_host);
void EvasToBlinkCords(int x, int y, int* view_x, int* view_y);
- Eina_Bool AsyncRequestHitTestDataAtBlinkCords(int x, int y,
+ Eina_Bool AsyncRequestHitTestDataAtBlinkCords(
+ int x,
+ int y,
Ewk_Hit_Test_Mode mode,
WebViewAsyncRequestHitTestDataCallback* cb);
content::WebContentsViewEfl* GetWebContentsViewEfl() const;
#if defined(OS_TIZEN_MOBILE) && !defined(EWK_BRINGUP)
- static void cameraResultCb(service_h request, service_h reply,
- service_result_e result, void* data);
+ static void cameraResultCb(service_h request,
+ service_h reply,
+ service_result_e result,
+ void* data);
#endif
#if defined(OS_TIZEN_MOBILE) && !defined(EWK_BRINGUP)
int current_find_request_id_;
static int find_request_id_counter_;
- typedef WebViewCallback<Ewk_View_Plain_Text_Get_Callback, const char*> EwkViewPlainTextGetCallback;
- IDMap<EwkViewPlainTextGetCallback, IDMapOwnPointer> plain_text_get_callback_map_;
+ typedef WebViewCallback<Ewk_View_Plain_Text_Get_Callback, const char*>
+ EwkViewPlainTextGetCallback;
+ base::IDMap<EwkViewPlainTextGetCallback*> plain_text_get_callback_map_;
- typedef WebViewCallback<Ewk_View_MHTML_Data_Get_Callback, const char*> MHTMLCallbackDetails;
- IDMap<MHTMLCallbackDetails, IDMapOwnPointer> mhtml_callback_map_;
+ typedef WebViewCallback<Ewk_View_MHTML_Data_Get_Callback, const char*>
+ MHTMLCallbackDetails;
+ base::IDMap<MHTMLCallbackDetails*> mhtml_callback_map_;
gfx::Size contents_size_;
double progress_;
double max_page_scale_factor_;
WebViewCallback<Ewk_View_Geolocation_Permission_Callback,
- _Ewk_Geolocation_Permission_Request*> geolocation_permission_cb_;
+ _Ewk_Geolocation_Permission_Request*>
+ geolocation_permission_cb_;
WebViewCallback<Ewk_View_User_Media_Permission_Callback,
- _Ewk_User_Media_Permission_Request*> user_media_permission_cb_;
- WebViewCallback<Ewk_View_Unfocus_Allow_Callback,
- Ewk_Unfocus_Direction> unfocus_allow_cb_;
+ _Ewk_User_Media_Permission_Request*>
+ user_media_permission_cb_;
+ WebViewCallback<Ewk_View_Unfocus_Allow_Callback, Ewk_Unfocus_Direction>
+ unfocus_allow_cb_;
WebViewCallback<Ewk_View_Notification_Permission_Callback,
- Ewk_Notification_Permission_Request*> notification_permission_callback_;
+ Ewk_Notification_Permission_Request*>
+ notification_permission_callback_;
WebViewCallback<Ewk_Quota_Permission_Request_Callback,
- const _Ewk_Quota_Permission_Request*> quota_request_callback_;
+ const _Ewk_Quota_Permission_Request*>
+ quota_request_callback_;
std::unique_ptr<content::InputPicker> inputPicker_;
- IDMap<WebApplicationIconUrlGetCallback, IDMapOwnPointer> web_app_icon_url_get_callback_map_;
- IDMap<WebApplicationIconUrlsGetCallback, IDMapOwnPointer> web_app_icon_urls_get_callback_map_;
- IDMap<WebApplicationCapableGetCallback, IDMapOwnPointer> web_app_capable_get_callback_map_;
+ base::IDMap<WebApplicationIconUrlGetCallback*>
+ web_app_icon_url_get_callback_map_;
+ base::IDMap<WebApplicationIconUrlsGetCallback*>
+ web_app_icon_urls_get_callback_map_;
+ base::IDMap<WebApplicationCapableGetCallback*>
+ web_app_capable_get_callback_map_;
std::unique_ptr<PermissionPopupManager> permission_popup_manager_;
std::unique_ptr<ScrollDetector> scroll_detector_;
#if defined(OS_TIZEN_MOBILE)
content::FileChooserParams::Mode filechooser_mode_;
#endif
- std::map<const _Ewk_Quota_Permission_Request*, content::QuotaPermissionContext::PermissionCallback> quota_permission_request_map_;
+ std::map<const _Ewk_Quota_Permission_Request*,
+ content::QuotaPermissionContext::PermissionCallback>
+ quota_permission_request_map_;
bool is_initialized_;
static content::WebContentsEflDelegate::WebContentsCreateCallback
create_new_window_web_contents_cb_;
-private:
+ private:
gfx::Vector2d previous_scroll_position_;
gfx::Point context_menu_position_;
const unsigned int g_default_tilt_motion_sensitivity = 3;
-
#endif
#include "message_pump_for_ui_efl.h"
#include "ui/display/screen_efl.h"
+#include "content/browser/gpu/gpu_main_thread_factory.h"
+
#ifdef OS_TIZEN
#include <dlfcn.h>
void* EflExtensionHandle = 0;
return std::unique_ptr<base::MessagePump>(new base::MessagePumpForUIEfl);
}
-} // namespace
+} // namespace
EwkGlobalData::EwkGlobalData()
- : content_main_runner_(ContentMainRunner::Create())
- , browser_main_runner_(BrowserMainRunner::Create()) {
-}
+ : content_main_runner_(ContentMainRunner::Create()),
+ browser_main_runner_(BrowserMainRunner::Create()) {}
EwkGlobalData::~EwkGlobalData() {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
// URLRequestContextGetterEfl needs to be deleted before loop stops
system_request_context_ = NULL;
- // We need to pretend that message loop was stopped so chromium unwinds correctly
- MessageLoop *loop = MessageLoop::current();
+
+// MessageLoop::QuitNow is deprecated. Should use RunLoop::Quit()
+#if !defined(EWK_BRINGUP) // FIXME: m67 bringup
+ // We need to pretend that message loop was stopped so chromium unwinds
+ // correctly
+ MessageLoop* loop = MessageLoop::current();
loop->QuitNow();
+#endif
- // Since we forcibly shutdown our UI message loop, it is possible
- // that important pending Tasks are simply not executed.
- // Among these, the destruction of RenderProcessHostImpl class
- // (scheduled with DeleteSoon) performs various process umplumbing
- // stuff and also holds strong references of lots of other objects
- // (e.g. URLRequestContextGetterEfl, RenderWidgetHelper,
- // ChildProcessLauncher). Not performing the proper destruction
- // of them might result in crashes or other undefined problems.
- //
- // Line below gives the message loop a extra run ('till it gets idle)
- // to perform such pending tasks.
+// Since we forcibly shutdown our UI message loop, it is possible
+// that important pending Tasks are simply not executed.
+// Among these, the destruction of RenderProcessHostImpl class
+// (scheduled with DeleteSoon) performs various process umplumbing
+// stuff and also holds strong references of lots of other objects
+// (e.g. URLRequestContextGetterEfl, RenderWidgetHelper,
+// ChildProcessLauncher). Not performing the proper destruction
+// of them might result in crashes or other undefined problems.
+//
+// Line below gives the message loop a extra run ('till it gets idle)
+// to perform such pending tasks.
+#if !defined(EWK_BRINGUP) // FIXME: m67 bringup
+ // FIXME: EWK_BRINGUP definition should be removed.
loop->RunUntilIdle();
+#endif // !defined(EWK_BRINGUP)
- // browser_main_runner must be deleted first as it depends on content_main_runner
+ // browser_main_runner must be deleted first as it depends on
+ // content_main_runner
delete browser_main_runner_;
delete content_main_runner_;
instance_->content_main_runner_->Initialize(params);
#if defined(USE_OZONE)
- ui::OzonePlatform::InitializeForUI();
+ ui::OzonePlatform::InitParams init_params;
+ init_params.single_process = true;
+ ui::OzonePlatform::InitializeForUI(init_params);
#endif
instance_->browser_main_runner_->Initialize(main_funtion_params);
base::ThreadRestrictions::SetIOAllowed(true);
- if (base::CommandLine::ForCurrentProcess()->HasSwitch(switches::kSingleProcess)) {
+ if (base::CommandLine::ForCurrentProcess()->HasSwitch(
+ switches::kSingleProcess)) {
content::UtilityProcessHostImpl::RegisterUtilityMainThreadFactory(
content::CreateInProcessUtilityThread);
content::RenderProcessHostImpl::RegisterRendererMainThreadFactory(
content::CreateInProcessRendererThread);
- GpuProcessHost::RegisterGpuMainThreadFactory(
- reinterpret_cast<content::GpuMainThreadFactoryFunction>(content::CreateInProcessGpuThread));
+ content::RegisterGpuMainThreadFactory(
+ reinterpret_cast<content::GpuMainThreadFactoryFunction>(
+ content::CreateInProcessGpuThread));
}
#ifndef NDEBUG
return instance_;
}
-content::URLRequestContextGetterEfl* EwkGlobalData::GetSystemRequestContextGetter() {
+content::URLRequestContextGetterEfl*
+EwkGlobalData::GetSystemRequestContextGetter() {
if (!system_request_context_.get()) {
system_request_context_ = new content::URLRequestContextGetterEfl();
}
return system_request_context_.get();
}
-void EwkGlobalData::Delete()
-{
+void EwkGlobalData::Delete() {
delete instance_;
instance_ = NULL;
}
BUILD_MODE=Release
fi
-CHROMIUM_EFL_LIBDIR=$(readlink -e $SCRIPTDIR/lib)
+# FIXME: CHROMIUM_EFL_LIBDIR should be fixed.
+# CHROMIUM_EFL_LIBDIR=$(readlink -e $SCRIPTDIR/lib)
+CHROMIUM_EFL_LIBDIR=$(readlink -e $SCRIPTDIR)
CHROMIUM_EFL_DEPENDENCIES_LIBDIR=$(readlink -e $SCRIPTDIR/Dependencies/Root/$_LIBDIR)
export LD_LIBRARY_PATH=$CHROMIUM_EFL_DEPENDENCIES_LIBDIR:$CHROMIUM_EFL_LIBDIR:${LD_LIBRARY_PATH}
#include "message_pump_for_ui_efl.h"
-#define private public
#include "base/run_loop.h"
-#undef private
#include "base/command_line.h"
+#include "base/message_loop/message_loop.h"
#include "base/time/time.h"
#include "cc/base/switches.h"
#include "common/content_switches_efl.h"
}
MessagePumpForUIEfl::MessagePumpForUIEfl()
- : pipe_(ecore_pipe_add(&PipeCallback, this))
- , schedule_delayed_work_timer_(NULL)
- , run_loop_(NULL)
- , keep_running_(true)
- , work_scheduled_(false) {
-}
+ : pipe_(ecore_pipe_add(&PipeCallback, this)),
+ schedule_delayed_work_timer_(NULL),
+ run_loop_(NULL),
+ keep_running_(true),
+ work_scheduled_(false) {}
MessagePumpForUIEfl::~MessagePumpForUIEfl() {
base::CommandLine* cmdline = base::CommandLine::ForCurrentProcess();
- if (!cmdline->HasSwitch(switches::kLimitMemoryAllocationInScheduleDelayedWork)) {
+ if (!cmdline->HasSwitch(
+ switches::kLimitMemoryAllocationInScheduleDelayedWork)) {
for (std::unordered_set<TimerPair*>::iterator it = pending_timers_.begin();
it != pending_timers_.end(); ++it) {
ecore_timer_del((*it)->second);
ecore_pipe_del(pipe_);
if (schedule_delayed_work_timer_)
ecore_timer_del(schedule_delayed_work_timer_);
+#if !defined(EWK_BRINGUP) // FIXME: m67 bringup
if (run_loop_) {
DCHECK(run_loop_->running());
run_loop_->AfterRun();
delete run_loop_;
run_loop_ = NULL;
}
+#endif
pipe_ = NULL;
schedule_delayed_work_timer_ = NULL;
keep_running_ = false;
}
DCHECK(pipe_);
- bool ok = ecore_pipe_write(pipe_, dummy_pipe_message, dummy_pipe_message_size);
+ bool ok =
+ ecore_pipe_write(pipe_, dummy_pipe_message, dummy_pipe_message_size);
DCHECK(ok);
}
-void MessagePumpForUIEfl::ScheduleDelayedWork(const base::TimeTicks& delayed_work_time) {
+void MessagePumpForUIEfl::ScheduleDelayedWork(
+ const base::TimeTicks& delayed_work_time) {
base::CommandLine* cmdline = base::CommandLine::ForCurrentProcess();
base::TimeTicks now = base::TimeTicks::Now();
double delay = 0;
if (delayed_work_time > now)
delay = base::TimeDelta(delayed_work_time - now).InSecondsF();
- if (!cmdline->HasSwitch(switches::kLimitMemoryAllocationInScheduleDelayedWork)) {
+ if (!cmdline->HasSwitch(
+ switches::kLimitMemoryAllocationInScheduleDelayedWork)) {
TimerPair* new_pair = new TimerPair();
new_pair->first = this;
new_pair->second = ecore_timer_add(delay, &TimerCallback, new_pair);
}
}
-void MessagePumpForUIEfl::PipeCallback(void *data, void*, unsigned int) {
+void MessagePumpForUIEfl::PipeCallback(void* data, void*, unsigned int) {
static_cast<MessagePumpForUIEfl*>(data)->DoWork();
}
Eina_Bool MessagePumpForUIEfl::TimerCallback(void* data) {
base::CommandLine* cmdline = base::CommandLine::ForCurrentProcess();
- if (!cmdline->HasSwitch(switches::kLimitMemoryAllocationInScheduleDelayedWork)) {
+ if (!cmdline->HasSwitch(
+ switches::kLimitMemoryAllocationInScheduleDelayedWork)) {
TimerPair* current_timer_pair = static_cast<TimerPair*>(data);
current_timer_pair->first->DoDelayedWork();
current_timer_pair->first->pending_timers_.erase(current_timer_pair);
delete current_timer_pair;
} else {
- MessagePumpForUIEfl* messagePumpForUIEfl = static_cast<MessagePumpForUIEfl*>(data);
+ MessagePumpForUIEfl* messagePumpForUIEfl =
+ static_cast<MessagePumpForUIEfl*>(data);
messagePumpForUIEfl->DoDelayedWork();
messagePumpForUIEfl->schedule_delayed_work_timer_ = NULL;
}
}
Delegate* delegate = base::MessageLoopForUI::current();
+#if !defined(EWK_BRINGUP) // FIXME: m67 bringup
if (!run_loop_) {
run_loop_ = new RunLoop();
bool result = run_loop_->BeforeRun();
DCHECK(result);
}
+#endif
bool more_work_is_plausible = delegate->DoWork();
}
void MessagePumpForUIEfl::DoDelayedWork() {
+#if !defined(EWK_BRINGUP) // FIXME: m67 bringup
base::TimeTicks next_delayed_work_time;
base::MessageLoopForUI::current()->DoDelayedWork(&next_delayed_work_time);
if (!next_delayed_work_time.is_null())
ScheduleDelayedWork(next_delayed_work_time);
+#endif
}
-
}
NetworkDelegateEfl::NetworkDelegateEfl(
base::WeakPtr<CookieManager> cookie_manager)
- : cookie_manager_(cookie_manager) {
-}
+ : cookie_manager_(cookie_manager) {}
NetworkDelegate::AuthRequiredResponse NetworkDelegateEfl::OnAuthRequired(
URLRequest* request,
return cookie_manager_->OnCanSetCookie(request, cookie_line, options);
}
-bool NetworkDelegateEfl::OnCanAccessFile(const URLRequest& request,
- const base::FilePath& path) const {
+bool NetworkDelegateEfl::OnCanAccessFile(
+ const URLRequest& request,
+ const base::FilePath& original_path,
+ const base::FilePath& absolute_path) const {
return true;
}
-}; // namespace net
+}; // namespace net
const AuthChallengeInfo& auth_info,
const AuthCallback& callback,
AuthCredentials* credentials) override;
- virtual bool OnCanGetCookies(const URLRequest& request,
- const CookieList& cookie_list) override;
- virtual bool OnCanSetCookie(const URLRequest& request,
- const std::string& cookie_line,
- CookieOptions* options) override;
- virtual bool OnCanAccessFile(const URLRequest& request,
- const base::FilePath& path) const override;
+ bool OnCanGetCookies(const URLRequest& request,
+ const CookieList& cookie_list) override;
+ bool OnCanSetCookie(const URLRequest& request,
+ const std::string& cookie_line,
+ CookieOptions* options) override;
+ bool OnCanAccessFile(const URLRequest& request,
+ const base::FilePath& original_path,
+ const base::FilePath& absolute_path) const override;
base::WeakPtr<CookieManager> cookie_manager_;
};
-} // namespace net
+} // namespace net
-#endif // _NETWORK_DELEGATE_EFL_H_
+#endif // _NETWORK_DELEGATE_EFL_H_
#include "content/public/browser/notification_types.h"
#include "content/public/browser/navigation_details.h"
-_Ewk_Back_Forward_List::_Ewk_Back_Forward_List(content::NavigationController &controller)
+_Ewk_Back_Forward_List::_Ewk_Back_Forward_List(
+ content::NavigationController& controller)
: navigation_controller_(controller) {
- notification_registrar_.Add(this, content::NOTIFICATION_NAV_ENTRY_CHANGED,
+#if !defined(EWK_BRINGUP) // FIXME: m67 bringup
+ // FIXME: Removed in upversion.
+ notification_registrar_.Add(
+ this, content::NOTIFICATION_NAV_ENTRY_CHANGED,
content::NotificationService::AllBrowserContextsAndSources());
- notification_registrar_.Add(this, content::NOTIFICATION_NAV_ENTRY_COMMITTED,
+#endif
+ notification_registrar_.Add(
+ this, content::NOTIFICATION_NAV_ENTRY_COMMITTED,
content::NotificationService::AllBrowserContextsAndSources());
}
return navigation_controller_.GetEntryCount() - current - 1;
}
-back_forward_list::Item* _Ewk_Back_Forward_List::GetItemAtIndex(int index) const {
+back_forward_list::Item* _Ewk_Back_Forward_List::GetItemAtIndex(
+ int index) const {
index += navigation_controller_.GetCurrentEntryIndex();
int count = navigation_controller_.GetEntryCount();
if (index < 0 || index >= count) {
return FindOrCreateItem(index);
}
-void _Ewk_Back_Forward_List::NewPageCommited(int prev_entry_index,
- content::NavigationEntry* new_entry) {
+void _Ewk_Back_Forward_List::NewPageCommited(
+ int prev_entry_index,
+ content::NavigationEntry* new_entry) {
int current = prev_entry_index + 1;
if (current != navigation_controller_.GetCurrentEntryIndex()) {
return;
}
InsertEntryToIndexes(current, new_entry);
- cache_[new_entry] = scoped_refptr<_Ewk_Back_Forward_List_Item>(new _Ewk_Back_Forward_List_Item(new_entry));
+ cache_[new_entry] = scoped_refptr<_Ewk_Back_Forward_List_Item>(
+ new _Ewk_Back_Forward_List_Item(new_entry));
}
void _Ewk_Back_Forward_List::UpdateItemWithEntry(
cache_.clear();
}
-void _Ewk_Back_Forward_List::Observe(int type,
- const content::NotificationSource &source,
- const content::NotificationDetails &details) {
+void _Ewk_Back_Forward_List::Observe(
+ int type,
+ const content::NotificationSource& source,
+ const content::NotificationDetails& details) {
switch (static_cast<content::NotificationType>(type)) {
case content::NOTIFICATION_NAV_ENTRY_COMMITTED: {
content::Details<content::LoadCommittedDetails> d = details;
NewPageCommited(d->previous_entry_index, d->entry);
break;
}
+#if !defined(EWK_BRINGUP) // FIXME: m67 bringup
+ // FIXME: Removed in upversion.
case content::NOTIFICATION_NAV_ENTRY_CHANGED: {
content::Details<content::EntryChangedDetails> d = details;
const content::NavigationEntry* entry = d->changed_entry;
UpdateItemWithEntry(entry);
break;
}
- default: {
- return;
- }
+#endif
+ default: { return; }
}
}
-_Ewk_Back_Forward_List_Item* _Ewk_Back_Forward_List::FindOrCreateItem(int index) const {
+_Ewk_Back_Forward_List_Item* _Ewk_Back_Forward_List::FindOrCreateItem(
+ int index) const {
content::NavigationEntry* entry =
navigation_controller_.GetEntryAtIndex(index);
}
void _Ewk_Back_Forward_List::InsertEntryToIndexes(
- unsigned index, content::NavigationEntry* entry) const {
+ unsigned index,
+ content::NavigationEntry* entry) const {
if (index == indexes_.size()) {
indexes_.push_back(entry);
return;
#include <map>
-class _Ewk_Back_Forward_List_Item :
- public back_forward_list::Item,
- public base::RefCounted<_Ewk_Back_Forward_List_Item> {
+class _Ewk_Back_Forward_List_Item
+ : public back_forward_list::Item,
+ public base::RefCounted<_Ewk_Back_Forward_List_Item> {
public:
_Ewk_Back_Forward_List_Item(content::NavigationEntry* entry) {
Update(entry);
}
}
- const GURL& GetURL() const override {
- return url_;
- }
+ const GURL& GetURL() const override { return url_; }
- const GURL& GetOriginalURL() const override {
- return original_url_;
- }
+ const GURL& GetOriginalURL() const override { return original_url_; }
- const std::string& GetTitle() const override {
- return title_;
- }
+ const std::string& GetTitle() const override { return title_; }
private:
GURL url_;
std::string title_;
};
-class _Ewk_Back_Forward_List :
- public back_forward_list::List,
- public content::NotificationObserver {
+class _Ewk_Back_Forward_List : public back_forward_list::List,
+ public content::NotificationObserver {
public:
typedef std::map<const content::NavigationEntry*,
- scoped_refptr<_Ewk_Back_Forward_List_Item> > CacheMap;
+ scoped_refptr<_Ewk_Back_Forward_List_Item> >
+ CacheMap;
- _Ewk_Back_Forward_List(content::NavigationController &controller);
+ _Ewk_Back_Forward_List(content::NavigationController& controller);
~_Ewk_Back_Forward_List() {}
int GetCurrentIndex() const override;
void UpdateItemWithEntry(const content::NavigationEntry* entry);
void ClearCache();
- void Observe(int type, const content::NotificationSource &source,
- const content::NotificationDetails &details) override;
+ // FIXME: EWK_BRINGUP: Check the need.
+ void Observe(int type,
+ const content::NotificationSource& source,
+ const content::NotificationDetails& details);
private:
_Ewk_Back_Forward_List_Item* FindOrCreateItem(int index) const;
content::NavigationEntry* entry) const;
private:
- content::NavigationController &navigation_controller_;
+ content::NavigationController& navigation_controller_;
content::NotificationRegistrar notification_registrar_;
mutable CacheMap cache_;
mutable std::vector<content::NavigationEntry*> indexes_;
};
-#endif // EWK_BACK_FORWARD_LIST_PRIVATE_H
+#endif // EWK_BACK_FORWARD_LIST_PRIVATE_H
#include "base/callback.h"
#include "ewk_suspendable_object.h"
-#include "third_party/WebKit/public/platform/modules/permissions/permission_status.mojom.h"
+#include "third_party/blink/public/platform/modules/permissions/permission_status.mojom.h"
#include "url/gurl.h"
class _Ewk_Security_Origin;
linkTitle(params.linkTitle),
linkLabel(params.linkLabel),
imageURI(params.imageURI),
- mediaURI(params.mediaURI),
isEditable(params.isEditable),
mode(static_cast<Ewk_Hit_Test_Mode>(params.mode)),
nodeData(params.nodeData),
//(warning) deep copy of skia buffer.
_Ewk_Hit_Test::Hit_Test_Image_Buffer::Hit_Test_Image_Buffer(const Hit_Test_Params::Image_Data& data):
fileNameExtension(data.fileNameExtension) {
+#if !defined(EWK_BRINGUP) // FIXME: m67 bringup
+// FIXME: [M63_3239]
+// error: ‘const class SkBitmap’ has no member named ‘deepCopyTo’
data.imageBitmap.deepCopyTo(&(imageBitmap));
+#endif
}
return imageData.imageBitmap.getSize();
}
-const char* _Ewk_Hit_Test::GetMediaUri() const {
- return mediaURI.c_str();
-}
-
const char* _Ewk_Hit_Test::GetNodeTagName() const {
return nodeData.tagName.c_str();
}
void* GetImageBuffer() const;
size_t GetImageBufferLength() const;
- const char* GetMediaUri() const;
-
const char* GetNodeTagName() const;
const char* GetNodeValue() const;
Eina_Hash* GetNodeAttributeHash() const;
const std::string linkTitle; // the title of link
const std::string linkLabel; // the text of the link
const std::string imageURI;
- const std::string mediaURI;
const bool isEditable;
const Ewk_Hit_Test_Mode mode;
using content::BrowserThread;
using namespace blink::mojom;
-Ewk_Notification::Ewk_Notification(
- const std::string& body,
- const std::string& replaceID,
- const std::string& title,
- const SkBitmap& icon,
- bool silent,
- uint64_t notificationID,
- const GURL& origin)
- : body_(body)
- , icon_(icon)
- , replaceID_(replaceID)
- , title_(title)
- , silent_(silent)
- , notificationID_(notificationID)
- , origin_(new _Ewk_Security_Origin(origin)) {
-}
-
-Ewk_Notification::~Ewk_Notification() {
-}
+Ewk_Notification::Ewk_Notification(const std::string& body,
+ const std::string& replaceID,
+ const std::string& title,
+ const SkBitmap& icon,
+ bool silent,
+ uint64_t notificationID,
+ const GURL& origin)
+ : body_(body),
+ icon_(icon),
+ replaceID_(replaceID),
+ title_(title),
+ silent_(silent),
+ notificationID_(notificationID),
+ origin_(new _Ewk_Security_Origin(origin)) {}
+
+Ewk_Notification::~Ewk_Notification() {}
const char* Ewk_Notification::GetBody() const {
return body_.c_str();
evas_object_image_colorspace_set(icon, EVAS_COLORSPACE_ARGB8888);
evas_object_image_alpha_set(icon, EINA_TRUE);
void* pixels = evas_object_image_data_get(icon, EINA_TRUE);
+
+#if !defined(EWK_BRINGUP) // FIXME: m67 bringup
if (pixels) {
icon_.copyPixelsTo(pixels, icon_.getSize());
evas_object_image_data_set(icon, pixels);
}
+#endif
return icon;
}
}
bool Ewk_Notification::SaveAsPng(const char* path) const {
- return SkImageEncoder::EncodeFile(path, icon_,
- SkImageEncoder::kPNG_Type, 100); // use max quality
+#if !defined(EWK_BRINGUP) // FIXME: m67 bringup
+ return SkImageEncoder::EncodeFile(path, icon_, SkImageEncoder::kPNG_Type,
+ 100); // use max quality
+#else
+ return false;
+#endif
}
Ewk_Notification_Permission_Request::Ewk_Notification_Permission_Request(
decided_(false),
suspended_(false) {}
-Ewk_Notification_Permission_Request::~Ewk_Notification_Permission_Request() {
-}
+Ewk_Notification_Permission_Request::~Ewk_Notification_Permission_Request() {}
Evas_Object* Ewk_Notification_Permission_Request::GetWebviewEvasObject() const {
return webview_;
}
-const _Ewk_Security_Origin* Ewk_Notification_Permission_Request::GetSecurityOrigin() const {
+const _Ewk_Security_Origin*
+Ewk_Notification_Permission_Request::GetSecurityOrigin() const {
return origin_.get();
}
return true;
}
-
-
#include "base/macros.h"
#include "private/ewk_security_origin_private.h"
#include "third_party/skia/include/core/SkBitmap.h"
-#include "third_party/WebKit/public/platform/modules/permissions/permission_status.mojom.h"
+#include "third_party/blink/public/platform/modules/permissions/permission_status.mojom.h"
class GURL;
#ifndef ewk_object_private_h
#define ewk_object_private_h
-#include <wtf/RefCounted.h>
+#include <platform/wtf/RefCounted.h>
class EwkObject : public RefCounted<EwkObject> {
public:
#include <algorithm>
-#include "components/mime_util/mime_util.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/render_view_host.h"
#include "eweb_view.h"
#include "net/http/http_response_headers.h"
#include "private/ewk_frame_private.h"
+#include "third_party/WebKit/common/mime_util/mime_util.h"
using content::BrowserThread;
using content::RenderFrameHost;
using content::RenderViewHost;
namespace {
- void FreeStringShare(void *data) {
- eina_stringshare_del(static_cast<char*>(data));
- }
+void FreeStringShare(void* data) {
+ eina_stringshare_del(static_cast<char*>(data));
+}
}
-_Ewk_Policy_Decision::_Ewk_Policy_Decision(const GURL &request_url,
+_Ewk_Policy_Decision::_Ewk_Policy_Decision(const GURL& request_url,
net::URLRequest* request,
content::ResourceType resource_type,
PolicyResponseDelegateEfl* delegate)
- : web_view_(NULL)
- , policy_response_delegate_(delegate)
- , response_headers_(NULL)
- , decision_type_(EWK_POLICY_DECISION_USE)
- , navigation_type_(EWK_POLICY_NAVIGATION_TYPE_OTHER)
- , is_decided_(false)
- , is_suspended_(false)
- , response_status_code_(0)
- , type_(POLICY_RESPONSE) {
+ : web_view_(NULL),
+ policy_response_delegate_(delegate),
+ response_headers_(NULL),
+ decision_type_(EWK_POLICY_DECISION_USE),
+ navigation_type_(EWK_POLICY_NAVIGATION_TYPE_OTHER),
+ is_decided_(false),
+ is_suspended_(false),
+ response_status_code_(0),
+ type_(POLICY_RESPONSE) {
DCHECK(delegate);
DCHECK(request);
request->GetMimeType(&response_mime_);
if ((!content::IsResourceTypeFrame(resource_type) &&
- !resource_type == content::RESOURCE_TYPE_FAVICON) ||
- (!mime_util::IsSupportedMimeType(response_mime_))) {
+ !resource_type == content::RESOURCE_TYPE_FAVICON) ||
+ (!blink::IsSupportedMimeType(response_mime_))) {
decision_type_ = EWK_POLICY_DECISION_DOWNLOAD;
}
std::string value;
response_headers_ = eina_hash_string_small_new(FreeStringShare);
while (response_headers->EnumerateHeaderLines(&iter, &name, &value))
- eina_hash_add(response_headers_, name.c_str(), eina_stringshare_add(value.c_str()));
+ eina_hash_add(response_headers_, name.c_str(),
+ eina_stringshare_add(value.c_str()));
}
}
-_Ewk_Policy_Decision::_Ewk_Policy_Decision(const NavigationPolicyParams ¶ms, content::RenderViewHost* rvh)
- : web_view_(NULL)
- , navigation_policy_handler_(new NavigationPolicyHandlerEfl(rvh, params))
- , frame_(new _Ewk_Frame(params))
- , cookie_(params.cookie)
- , http_method_(params.httpMethod)
- , response_headers_(NULL)
- , decision_type_(EWK_POLICY_DECISION_USE)
- , navigation_type_(static_cast<Ewk_Policy_Navigation_Type>(params.type))
- , is_decided_(false)
- , is_suspended_(false)
- , response_status_code_(0)
- , type_(POLICY_NAVIGATION) {
+_Ewk_Policy_Decision::_Ewk_Policy_Decision(const NavigationPolicyParams& params,
+ content::RenderViewHost* rvh)
+ : web_view_(NULL),
+ navigation_policy_handler_(new NavigationPolicyHandlerEfl(rvh, params)),
+ frame_(new _Ewk_Frame(params)),
+ cookie_(params.cookie),
+ http_method_(params.httpMethod),
+ response_headers_(NULL),
+ decision_type_(EWK_POLICY_DECISION_USE),
+ navigation_type_(static_cast<Ewk_Policy_Navigation_Type>(params.type)),
+ is_decided_(false),
+ is_suspended_(false),
+ response_status_code_(0),
+ type_(POLICY_NAVIGATION) {
ParseUrl(params.url);
- if (!params.auth.isEmpty())
- SetAuthorizationIfNecessary(params.auth.utf8());
+ if (!params.auth.IsEmpty())
+ SetAuthorizationIfNecessary(params.auth.Utf8());
else if (params.url.has_password() && params.url.has_username())
SetAuthorizationIfNecessary(params.url);
}
-_Ewk_Policy_Decision::_Ewk_Policy_Decision(EWebView* view,
+_Ewk_Policy_Decision::_Ewk_Policy_Decision(
+ EWebView* view,
content::WebContentsEflDelegate::NewWindowDecideCallback callback)
- : web_view_(view)
- , window_create_callback_(callback)
- , response_headers_(NULL)
- , decision_type_(EWK_POLICY_DECISION_USE)
- , navigation_type_(EWK_POLICY_NAVIGATION_TYPE_OTHER)
- , is_decided_(false)
- , is_suspended_(false)
- , response_status_code_(0)
- , type_(POLICY_NEWWINDOW) {
+ : web_view_(view),
+ window_create_callback_(callback),
+ response_headers_(NULL),
+ decision_type_(EWK_POLICY_DECISION_USE),
+ navigation_type_(EWK_POLICY_NAVIGATION_TYPE_OTHER),
+ is_decided_(false),
+ is_suspended_(false),
+ response_status_code_(0),
+ type_(POLICY_NEWWINDOW) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
DCHECK(view);
policy_response_delegate_->UseResponse();
break;
case POLICY_NAVIGATION:
- navigation_policy_handler_->SetDecision(NavigationPolicyHandlerEfl::Unhandled);
+ navigation_policy_handler_->SetDecision(
+ NavigationPolicyHandlerEfl::Unhandled);
break;
case POLICY_NEWWINDOW:
window_create_callback_.Run(true);
policy_response_delegate_->IgnoreResponse();
break;
case _Ewk_Policy_Decision::POLICY_NAVIGATION:
- navigation_policy_handler_->SetDecision(NavigationPolicyHandlerEfl::Handled);
+ navigation_policy_handler_->SetDecision(
+ NavigationPolicyHandlerEfl::Handled);
break;
case _Ewk_Policy_Decision::POLICY_NEWWINDOW:
window_create_callback_.Run(false);
DCHECK(policy_response_delegate_.get());
if (policy_response_delegate_.get()) {
- RenderFrameHost *host = RenderFrameHost::FromID(policy_response_delegate_->GetRenderProcessId(), policy_response_delegate_->GetRenderFrameId());
+ RenderFrameHost* host =
+ RenderFrameHost::FromID(policy_response_delegate_->GetRenderProcessId(),
+ policy_response_delegate_->GetRenderFrameId());
- // Download request has no render frame id, they're detached. We override it with main frame from render view id
+ // Download request has no render frame id, they're detached. We override it
+ // with main frame from render view id
if (!host) {
- RenderViewHost *viewhost = RenderViewHost::FromID(policy_response_delegate_->GetRenderProcessId(), policy_response_delegate_->GetRenderViewId());
+ RenderViewHost* viewhost = RenderViewHost::FromID(
+ policy_response_delegate_->GetRenderProcessId(),
+ policy_response_delegate_->GetRenderViewId());
- //DCHECK(viewhost);
+ // DCHECK(viewhost);
if (viewhost) {
host = viewhost->GetMainFrame();
}
if (host) {
/*
* In some situations there is no renderer associated to the response
- * Such case can be observed while running TC utc_blink_ewk_geolocation_permission_request_suspend_func
+ * Such case can be observed while running TC
+ * utc_blink_ewk_geolocation_permission_request_suspend_func
*/
frame_.reset(new _Ewk_Frame(host));
}
host_ = url.host();
}
-void _Ewk_Policy_Decision::SetAuthorizationIfNecessary(const GURL& request_url) {
+void _Ewk_Policy_Decision::SetAuthorizationIfNecessary(
+ const GURL& request_url) {
// There is no need to check if username or password is empty.
// It was checked befor in constructor
auth_password_ = request_url.password();
auth_user_ = request_url.username();
}
-void _Ewk_Policy_Decision::SetAuthorizationIfNecessary(const std::string request) {
+void _Ewk_Policy_Decision::SetAuthorizationIfNecessary(
+ const std::string request) {
std::string type = request.substr(0, request.find_first_of(' '));
std::transform(type.begin(), type.end(), type.begin(), ::toupper);
std::size_t space = request.find(' ');
std::size_t colon = request.find(':');
- DCHECK(space != std::string::npos && colon != std::string::npos && colon != request.length());
- if (space == std::string::npos || colon == std::string::npos || colon == request.length())
+ DCHECK(space != std::string::npos && colon != std::string::npos &&
+ colon != request.length());
+ if (space == std::string::npos || colon == std::string::npos ||
+ colon == request.length())
return;
auth_user_ = request.substr(space + 1, request.length() - colon - 1);
#include "content/public/browser/web_contents_efl_delegate.h"
#include "content/public/common/resource_type.h"
#include "public/ewk_policy_decision.h"
-#include "third_party/WebKit/public/web/WebViewModeEnums.h"
+// FIXME: removed on m63
+//#include "third_party/blink/public/web/WebViewModeEnums.h"
// Basic type of authorization - 'type username:password'
#define BASIC_AUTHORIZATION "BASIC"
void Ewk_Settings::setSpdyEnabled(bool flag)
{
+#if !defined(EWK_BRINGUP) // FIXME: m67 bringup
+ // FIXME: EWK_BRINGUP definition should be removed.
net::HttpStreamFactory::set_spdy_enabled(flag);
+#endif // !defined(EWK_BRINGUP)
}
void Ewk_Settings::setCurrentLegacyFontSizeMode(Ewk_Legacy_Font_Size_Mode mode) {
m_currentLegacyFontSizeMode = mode;
-#if !defined(EWK_BRINGUP)
+#if !defined(EWK_BRINGUP) // FIXME: m67 bringup
m_preferences.current_legacy_font_size_mode = static_cast<content::LegacyFontSizeMode>(mode);
#endif
}
return hitTest->GetImageUri();
}
-const char* ewk_hit_test_media_uri_get(Ewk_Hit_Test* hitTest)
-{
- EINA_SAFETY_ON_NULL_RETURN_VAL(hitTest, 0);
- return hitTest->GetMediaUri();
-}
-
const char* ewk_hit_test_tag_name_get(Ewk_Hit_Test* hitTest)
{
EINA_SAFETY_ON_NULL_RETURN_VAL(hitTest, 0);
Ewk_Object* ewk_object_ref(Ewk_Object* object)
{
EINA_SAFETY_ON_NULL_RETURN_VAL(object, 0);
- object->ref();
+ object->AddRef();
return object;
}
{
EINA_SAFETY_ON_NULL_RETURN(object);
- object->deref();
+ object->Release();
}
#include <Evas.h>
-#if !defined(EWK_BRINGUP)
+#if !defined(EWK_BRINGUP) // FIXME: m67 bringup
#include "webkit/common/webpreferences.h"
#else
#include "content/public/common/web_preferences.h"
#include "private/ewk_back_forward_list_private.h"
#include "private/ewk_history_private.h"
#include "private/ewk_view_private.h"
-#include "third_party/WebKit/public/web/WebViewModeEnums.h"
+// FIXME: removed on m63
+//#include "third_party/blink/public/web/WebViewModeEnums.h"
#include "ui/events/gesture_detection/gesture_configuration.h"
#include "url/gurl.h"
#include "usermedia_permission_popup.h"
#include "common/content_switches_efl.h"
#include "common/render_messages_ewk.h"
#include "content/common/paths_efl.h"
+#include "content/public/common/url_loader_throttle.h"
#include "content/public/renderer/render_thread.h"
#include "content/public/renderer/render_view.h"
#include "content/renderer/render_view_impl.h"
#include "renderer/render_view_observer_efl.h"
#include "components/visitedlink/renderer/visitedlink_slave.h"
#include "content/public/renderer/content_renderer_client.h"
-#include "third_party/WebKit/public/platform/URLConversion.h"
-#include "third_party/WebKit/public/platform/WebURLError.h"
-#include "third_party/WebKit/public/platform/WebURLRequest.h"
-#include "third_party/WebKit/public/platform/WebViewportStyle.h"
-#include "third_party/WebKit/public/web/WebDataSource.h"
-#include "third_party/WebKit/public/web/WebDocument.h"
-#include "third_party/WebKit/public/web/WebFrame.h"
-#include "third_party/WebKit/public/web/WebSettings.h"
-#include "third_party/WebKit/public/web/WebView.h"
+#include "third_party/blink/public/platform/URLConversion.h"
+#include "third_party/blink/public/platform/WebURLError.h"
+#include "third_party/blink/public/platform/WebURLRequest.h"
+#include "third_party/blink/public/platform/WebViewportStyle.h"
+#include "third_party/blink/public/web/WebDocument.h"
+#include "third_party/blink/public/web/WebDocumentLoader.h"
+#include "third_party/blink/public/web/WebFrame.h"
+#include "third_party/blink/public/web/WebLocalFrame.h"
+#include "third_party/blink/public/web/WebSettings.h"
+#include "third_party/blink/public/web/WebView.h"
+#include "third_party/blink/public/web/WebLocalFrame.h"
#include "url/gurl.h"
#if defined(OS_TIZEN)
ContentRendererClientEfl::~ContentRendererClientEfl() {
}
-void ContentRendererClientEfl::RenderThreadStarted()
-{
+void ContentRendererClientEfl::RenderThreadStarted() {
content::RenderThread* thread = content::RenderThread::Get();
- const base::CommandLine& command_line = *base::CommandLine::ForCurrentProcess();
+ const base::CommandLine& command_line =
+ *base::CommandLine::ForCurrentProcess();
if (command_line.HasSwitch(switches::kInjectedBundlePath)) {
wrt_widget_.reset(new WrtWidget);
thread->AddObserver(wrt_widget_->GetObserver());
thread->AddObserver(render_thread_observer_.get());
visited_link_slave_.reset(new visitedlink::VisitedLinkSlave());
+#if !defined(EWK_BRINGUP) // FIXME: m67 bringup
+ // FIXME: EWK_BRINGUP definition should be removed.
thread->AddObserver(visited_link_slave_.get());
+#endif // !defined(EWK_BRINGUP)
}
void ContentRendererClientEfl::RenderFrameCreated(content::RenderFrame* render_frame) {
new RenderViewObserverEfl(render_view, this);
new editing::EditorClientAgent(render_view);
-#if !defined(EWK_BRINGUP)
+#if !defined(EWK_BRINGUP) // FIXME: m67 bringup
render_view->SetWrtUrlParser(wrt_url_parser_.get());
#endif
}
bool ContentRendererClientEfl::OverrideCreatePlugin(
content::RenderFrame* render_frame,
- blink::WebLocalFrame* frame,
const blink::WebPluginParams& params,
blink::WebPlugin** plugin) {
PluginPlaceholderEfl* placeholder =
- PluginPlaceholderEfl::CreateMissingPlugin(render_frame, frame, params);
+ PluginPlaceholderEfl::CreateMissingPlugin(render_frame, params);
if (!placeholder)
return false;
*plugin = placeholder->plugin();
return true;
}
-bool ContentRendererClientEfl::WillSendRequest(blink::WebFrame* frame,
+bool ContentRendererClientEfl::WillSendRequest(blink::WebLocalFrame* frame,
ui::PageTransition transition_type,
- const GURL& url,
- const GURL& first_party_for_cookies,
+ const blink::WebURL& url,
+ std::vector<std::unique_ptr<content::URLLoaderThrottle>>* throttles,
GURL* new_url) {
if (wrt_widget_) {
wrt_widget_->ParseUrl(url, *new_url);
void ContentRendererClientEfl::DidCreateScriptContext(
blink::WebFrame* frame,
v8::Handle<v8::Context> context,
- int extension_group,
int world_id) {
const content::RenderView* render_view = content::RenderView::FromWebView(
- frame->view());
+ frame->View());
if (wrt_widget_)
wrt_widget_->StartSession(context, render_view->GetRoutingID(),
- frame->document().baseURL().string().utf8());
+ frame->ToWebLocalFrame()->GetDocument().BaseURL().GetString().Utf8());
}
void ContentRendererClientEfl::WillReleaseScriptContext(
bool ContentRendererClientEfl::HandleNavigation(content::RenderFrame* render_frame,
content::DocumentState* document_state,
- int opener_id,
+ bool render_view_was_created_by_renderer,
blink::WebFrame* frame,
const blink::WebURLRequest& request,
blink::WebNavigationType type,
blink::WebNavigationPolicy default_policy,
bool is_redirect) {
const content::RenderView* render_view =
- content::RenderView::FromWebView(frame->view());
+ content::RenderView::FromWebView(frame->View());
bool result = false;
GURL referrer_url(blink::WebStringToGURL(
- request.httpHeaderField(blink::WebString::fromUTF8("Referer"))));
+ request.HttpHeaderField(blink::WebString::FromUTF8("Referer"))));
blink::WebReferrerPolicy referrer_policy =
- request.isNull() ? frame->document().referrerPolicy() : request.referrerPolicy();
+ request.IsNull() ? frame->ToWebLocalFrame()->GetDocument().GetReferrerPolicy() : request.GetReferrerPolicy();
int render_view_id = render_view->GetRoutingID();
NavigationPolicyParams params;
params.render_view_id = render_view_id;
- params.url = request.url();
- params.httpMethod = request.httpMethod().utf8();
+ params.url = request.Url();
+ params.httpMethod = request.HttpMethod().Utf8();
params.referrer = content::Referrer(referrer_url, referrer_policy);
- params.auth = request.httpHeaderField(blink::WebString::fromUTF8("Authorization"));
+ params.auth = request.HttpHeaderField(blink::WebString::FromUTF8("Authorization"));
params.policy = default_policy;
- params.is_main_frame = (frame->view()->mainFrame() == frame);
+ params.is_main_frame = (frame->View()->MainFrame() == frame);
params.type = type;
params.is_redirect = is_redirect;
- params.cookie = request.httpHeaderField(blink::WebString::fromUTF8("Cookie")).utf8();
+ params.cookie = request.HttpHeaderField(blink::WebString::FromUTF8("Cookie")).Utf8();
- blink::WebDataSource* ds = frame->provisionalDataSource();
- params.should_replace_current_entry = (ds ? ds->replacesCurrentHistoryItem() : false);
+ blink::WebDocumentLoader* docLoader = frame->ToWebLocalFrame()->GetProvisionalDocumentLoader();
+ params.should_replace_current_entry = (docLoader ? docLoader->ReplacesCurrentHistoryItem() : false);
// Sync message, renderer is blocked here.
content::RenderThread::Get()->Send(new EwkHostMsg_DecideNavigationPolicy(
"WebKit",
"IDS_WEBVIEW_BODY_THE_SERVER_AT_PS_CANT_BE_FOUND_BECAUSE_THE_DNS_LOOK_UP_FAILED_MSG"));
errorMessage = base::StringPrintf(
- errorMessage.c_str(), error.unreachableURL.string().utf8().c_str());
+ errorMessage.c_str(), error.unreachable_url.GetString().Ascii());
*error_html =
"<html>"
"initial-scale=1.0, user-scalable=no'>"
"<meta http-equiv='Content-Type' content='text/html; charset=UTF-8'>"
"<title>";
- *error_html += error.unreachableURL.string().utf8();
+ *error_html += error.unreachable_url.GetString().Utf8();
*error_html +=
"</title>"
"<style type=text/css>"
}
}
-blink::WebSpeechSynthesizer* ContentRendererClientEfl::OverrideSpeechSynthesizer(
+std::unique_ptr<blink::WebSpeechSynthesizer> ContentRendererClientEfl::OverrideSpeechSynthesizer(
blink::WebSpeechSynthesizerClient* client) {
#if defined(OS_TIZEN)
- return new content::TtsDispatcherEfl(client);
+ return base::MakeUnique<TtsDispatcher>(new content::TtsDispatcherEfl(client));
#else
- return NULL;
+ return nullptr;
#endif
}
// blink::WebViewImpl prevents auto zoom after tap if maximum legible scale is
// too small. Blink by default sets it to 1 and needs to be enlarged to make
// auto zoom work.
- webview->setMaximumLegibleScale(maximum_legible_scale);
+ webview->SetMaximumLegibleScale(maximum_legible_scale);
base::CommandLine* cmdline = base::CommandLine::ForCurrentProcess();
if (cmdline->HasSwitch(switches::kEwkEnableMobileFeaturesForDesktop)) {
- blink::WebSettings* settings = webview->settings();
- settings->setViewportStyle(blink::WebViewportStyle::Mobile);
- settings->setViewportMetaEnabled(true);
- settings->setAutoZoomFocusedNodeToLegibleScale(true);
- webview->setDefaultPageScaleLimits(minimum_page_scale_for_mobile,
+ blink::WebSettings* settings = webview->GetSettings();
+ settings->SetViewportStyle(blink::WebViewportStyle::kMobile);
+ settings->SetViewportMetaEnabled(true);
+ settings->SetAutoZoomFocusedNodeToLegibleScale(true);
+ webview->SetDefaultPageScaleLimits(minimum_page_scale_for_mobile,
maximum_page_scale_for_mobile);
}
}
#ifndef CONTENT_RENDERER_CLIENT_EFL_H
#define CONTENT_RENDERER_CLIENT_EFL_H
+#include "content/public/common/url_loader_throttle.h"
#include "content/public/renderer/content_renderer_client.h"
#include "content/public/renderer/render_frame_observer.h"
#include "renderer/content_renderer_client_efl.h"
bool OverrideCreatePlugin(
content::RenderFrame* render_frame,
- blink::WebLocalFrame* frame,
const blink::WebPluginParams& params,
blink::WebPlugin** plugin) override;
bool HandleNavigation(content::RenderFrame* render_frame,
content::DocumentState* document_state,
- int opener_id,
+ bool render_view_was_created_by_renderer,
blink::WebFrame* frame,
const blink::WebURLRequest& request,
blink::WebNavigationType type,
blink::WebNavigationPolicy default_policy,
bool is_redirect) override;
- bool WillSendRequest(blink::WebFrame* frame,
+ bool WillSendRequest(blink::WebLocalFrame* frame,
ui::PageTransition transition_type,
- const GURL& url,
- const GURL& first_party_for_cookies,
+ const blink::WebURL& url,
+ std::vector<std::unique_ptr<content::URLLoaderThrottle>>* throttles,
GURL* new_url) override;
void DidCreateScriptContext(
blink::WebFrame* frame,
v8::Handle<v8::Context> context,
- int extension_group,
int world_id);
void WillReleaseScriptContext(
bool IsLinkVisited(unsigned long long link_hash) override;
- blink::WebSpeechSynthesizer* OverrideSpeechSynthesizer(
+ std::unique_ptr<blink::WebSpeechSynthesizer> OverrideSpeechSynthesizer(
blink::WebSpeechSynthesizerClient* client) override;
private:
#include "content/public/renderer/render_view.h"
#include "common/editing_messages.h"
-#include "third_party/WebKit/public/web/WebView.h"
+#include "third_party/blink/public/web/WebView.h"
namespace editing {
EditorClientAgent::EditorClientAgent(content::RenderView* render_view)
: content::RenderViewObserver(render_view) {
-#if !defined(EWK_BRINGUP)
+#if !defined(EWK_BRINGUP) // FIXME: m67 bringup
render_view->GetWebView()->setEditorClient(this);
#endif
}
#include <string>
#include "content/public/renderer/render_view_observer.h"
-#if !defined(EWK_BRINGUP)
-#include "third_party/WebKit/public/web/WebEditorClient.h"
+#if !defined(EWK_BRINGUP) // FIXME: m67 bringup
+#include "third_party/blink/public/web/WebEditorClient.h"
#endif
namespace editing {
-#if !defined(EWK_BRINGUP)
+#if !defined(EWK_BRINGUP) // FIXME: m67 bringup
class EditorClientAgent : public content::RenderViewObserver,
public blink::WebEditorClient {
#else
#include <libintl.h>
#include "gin/handle.h"
-#include "third_party/WebKit/public/web/WebKit.h"
+#include "third_party/blink/public/web/WebKit.h"
gin::WrapperInfo PluginPlaceholderEfl::kWrapperInfo = {gin::kEmbedderNativeGin};
PluginPlaceholderEfl::PluginPlaceholderEfl(
content::RenderFrame* render_frame,
- blink::WebLocalFrame* frame,
const blink::WebPluginParams& params,
const std::string& html_data)
: plugins::LoadablePluginPlaceholder(
- render_frame, frame, params, html_data) {
+ render_frame, params, html_data) {
}
PluginPlaceholderEfl::~PluginPlaceholderEfl() {
// static
PluginPlaceholderEfl* PluginPlaceholderEfl::CreateMissingPlugin(
content::RenderFrame* render_frame,
- blink::WebLocalFrame* frame,
const blink::WebPluginParams& params) {
// |missing_plugin| will destroy itself when its WebViewPlugin is going away.
PluginPlaceholderEfl* missing_plugin = new PluginPlaceholderEfl(
- render_frame, frame, params, dgettext("WebKit", "IDS_WEBVIEW_BODY_PLUG_IN_MISSING"));
+ render_frame, params, dgettext("WebKit", "IDS_WEBVIEW_BODY_PLUG_IN_MISSING"));
missing_plugin->AllowLoading();
return missing_plugin;
}
-void PluginPlaceholderEfl::OnLoadedRectUpdate(
- const gfx::Rect& unobscured_rect,
- content::RenderFrame::PeripheralContentStatus status) {
+void PluginPlaceholderEfl::OnBlockedContent(
+ content::RenderFrame::PeripheralContentStatus status,
+ bool is_same_origin) {
NOTIMPLEMENTED();
}
// Creates a new WebViewPlugin with a MissingPlugin as a delegate.
static PluginPlaceholderEfl* CreateMissingPlugin(
content::RenderFrame* render_frame,
- blink::WebLocalFrame* frame,
const blink::WebPluginParams& params);
-
- void OnLoadedRectUpdate(
- const gfx::Rect& unobscured_rect,
- content::RenderFrame::PeripheralContentStatus status) override;
+ void OnBlockedContent(
+ content::RenderFrame::PeripheralContentStatus status,
+ bool is_same_origin) override;
private:
PluginPlaceholderEfl(content::RenderFrame* render_frame,
- blink::WebLocalFrame* frame,
const blink::WebPluginParams& params,
const std::string& html_data);
~PluginPlaceholderEfl() override;
#include "skia/ext/platform_canvas.h"
#include "third_party/skia/include/core/SkCanvas.h"
#include "third_party/skia/include/core/SkRect.h"
-#include "third_party/WebKit/public/web/WebPrintParams.h"
-#include "third_party/WebKit/public/web/WebFrame.h"
-#include "third_party/WebKit/public/web/WebView.h"
+#include "third_party/blink/public/web/WebPrintParams.h"
+#include "third_party/blink/public/web/WebFrame.h"
+#include "third_party/blink/public/web/WebView.h"
namespace skia {
typedef SkCanvas VectorCanvas;
void ComputeWebKitPrintParamsInDesiredDpi(const PrintParams& print_params,
blink::WebPrintParams* webkit_print_params) {
int dpi = static_cast<int>(print_params.dpi);
+#if !defined(EWK_BRINGUP) // FIXME: m67 bringup
webkit_print_params->printerDPI = dpi;
webkit_print_params->printScalingOption = print_params.print_scaling_option;
webkit_print_params->paperSize.height =
ConvertUnit(print_params.page_size.height(), dpi,
print_params.desired_dpi);
+#endif
}
} //namespace
void PrintWebViewHelperEfl::PrintToPdf(int width, int height) {
InitPrintSettings(width, height, true);
DCHECK(view_->GetWebView());
+#if !defined(EWK_BRINGUP) // FIXME: m67 bringup
RenderPagesForPrint(view_->GetWebView()->mainFrame());
+#endif
}
void PrintWebViewHelperEfl::InitPrintSettings(int width, int height, bool fit_to_paper_size) {
settings.pages.clear();
settings.params.print_scaling_option =
- blink::WebPrintScalingOptionSourceSize;
+ blink::kWebPrintScalingOptionSourceSize;
if (fit_to_paper_size) {
settings.params.print_scaling_option =
- blink::WebPrintScalingOptionFitToPrintableArea;
+ blink::kWebPrintScalingOptionFitToPrintableArea;
}
print_pages_params_.reset(new PrintPagesParams(settings));
const PrintParams& print_params = params.params;
blink::WebPrintParams webkit_print_params;
ComputeWebKitPrintParamsInDesiredDpi(print_params, &webkit_print_params);
+#if !defined(EWK_BRINGUP) // FIXME: m67 bringup
int page_count = frame->printBegin(webkit_print_params);
gfx::Size print_canvas_size(webkit_print_params.printContentArea.width,
webkit_print_params.printContentArea.height);
bool result = PrintPagesToPdf(frame, page_count, print_canvas_size);
frame->printEnd();
return result;
+#endif
}
bool PrintWebViewHelperEfl::PrintPagesToPdf(blink::WebFrame* frame,
int page_count, const gfx::Size& canvas_size) {
+#if !defined(EWK_BRINGUP) // FIXME: m67 bringup
printing::PdfMetafileSkia metafile(printing::PDF_SKIA_DOCUMENT_TYPE);
if (!metafile.Init())
return false;
} // shared memory handle scope
return view_->Send(new EwkHostMsg_DidPrintPagesToPdf(view_->GetRoutingID(), printed_page_params));
+#endif
}
bool PrintWebViewHelperEfl::PrintPageInternal(
PrintParams result;
double scale_factor = 1.0f;
gfx::Rect canvas_area(canvas_size);
+#if !defined(EWK_BRINGUP) // FIXME: m67 bringup
+ // FIXME: cannot convert ‘cc::PaintCanvas*’ to ‘skia::VectorCanvas* {aka SkCanvas*}’ in initialization
skia::VectorCanvas* canvas = metafile->GetVectorCanvasForNewPage(
params.params.page_size, canvas_area, scale_factor);
if (!canvas)
return false;
}
return true;
+#endif
}
#include "base/files/file_path.h"
#include "common/print_pages_params.h"
-#include "third_party/WebKit/public/platform/WebCanvas.h"
+#include "third_party/blink/public/platform/WebCanvas.h"
namespace content {
class RenderView;
#include "content/renderer/external_popup_menu.h"
#include "common/render_messages_ewk.h"
#include "renderer/content_renderer_client_efl.h"
-#include "third_party/WebKit/public/platform/URLConversion.h"
-#include "third_party/WebKit/public/platform/WebURLError.h"
-#include "third_party/WebKit/public/platform/WebURLRequest.h"
-#include "third_party/WebKit/public/web/WebDocument.h"
-#include "third_party/WebKit/public/web/WebElement.h"
-#include "third_party/WebKit/public/web/WebElementCollection.h"
-#include "third_party/WebKit/public/web/WebFormElement.h"
-#include "third_party/WebKit/public/web/WebLocalFrame.h"
-#include "third_party/WebKit/public/web/WebView.h"
+#include "third_party/blink/public/platform/URLConversion.h"
+#include "third_party/blink/public/platform/WebURLError.h"
+#include "third_party/blink/public/platform/WebURLRequest.h"
+#include "third_party/blink/public/web/WebDocument.h"
+#include "third_party/blink/public/web/WebElement.h"
+#include "third_party/blink/public/web/WebElementCollection.h"
+#include "third_party/blink/public/web/WebFormElement.h"
+#include "third_party/blink/public/web/WebLocalFrame.h"
+#include "third_party/blink/public/web/WebView.h"
#include "base/logging.h"
namespace {
WebElement GetFocusedElement(WebLocalFrame* frame) {
- WebDocument doc = frame->document();
- if (!doc.isNull())
- return doc.focusedElement();
+ WebDocument doc = frame->GetDocument();
+ if (!doc.IsNull())
+ return doc.FocusedElement();
return WebElement();
}
bool hasHTMLTagNameSelect(const WebElement& element) {
- if (element.isNull())
+ if (element.IsNull())
return false;
- if (element.hasHTMLTagName("select"))
+ if (element.HasHTMLTagName("select"))
return true;
return false;
void RenderFrameObserverEfl::OnLoadNotFoundErrorPage(std::string errorUrl) {
blink::WebLocalFrame* frame = render_frame()->GetWebFrame();
blink::WebURLError error;
- error.unreachableURL = GURL(errorUrl);
- blink::WebURLRequest failed_request(error.unreachableURL);
+ error.unreachable_url = GURL(errorUrl);
+ blink::WebURLRequest failed_request(error.unreachable_url);
bool replace = true;
std::string error_html;
GetContentClientExport()->renderer()->GetNavigationErrorStrings(
render_frame(), failed_request, error, &error_html, NULL);
- frame->loadHTMLString(error_html,
+ frame->LoadHTMLString(error_html,
GURL(kUnreachableWebDataURL),
- error.unreachableURL,
+ error.unreachable_url,
replace);
}
void RenderFrameObserverEfl::OnRequestSelectCollectionInformation() {
WebElement focused_element = GetFocusedElement(render_frame()->GetWebFrame());
- if (focused_element.isNull())
+ if (focused_element.IsNull())
return;
content::RenderView* render_view_ = render_frame()->GetRenderView();
- WebFrame* focused_frame = render_view_->GetWebView()->focusedFrame();
+ WebLocalFrame* focused_frame = render_view_->GetWebView()->FocusedFrame();
if (!focused_frame)
return;
- WebDocument document = focused_frame->document();
- if (document.isNull())
+ WebDocument document = focused_frame->GetDocument();
+ if (document.IsNull())
return;
- WebElementCollection select_elements = document.getElementsByHTMLTagName("select");
+ WebElementCollection select_elements = document.GetElementsByHTMLTagName("select");
int count = 0;
int index = 0;
- for (WebElement e = select_elements.firstItem();
- !e.isNull(); e = select_elements.nextItem()) {
+ for (WebElement e = select_elements.FirstItem();
+ !e.IsNull(); e = select_elements.NextItem()) {
// take only visible elements into account
- if (e.hasNonEmptyLayoutSize()) {
+ if (e.HasNonEmptyLayoutSize()) {
if (e == focused_element)
index = count;
++count;
blink::WebLocalFrame* frame = render_frame()->GetWebFrame();
- blink::WebSize contentsSize = frame->contentsSize();
- blink::WebRect visibleContentRect = frame->visibleContentRect();
+ blink::WebSize contentsSize = frame->ContentsSize();
+ blink::WebRect visibleContentRect = frame->VisibleContentRect();
blink::WebSize maximumScrollOffset(
contentsSize.width - visibleContentRect.width,
contentsSize.height - visibleContentRect.height);
maximumScrollOffset.height));
}
- if (last_scroll_offset_ != frame->scrollOffset()) {
- last_scroll_offset_ = frame->scrollOffset();
+ if (last_scroll_offset_ != frame->GetScrollOffset()) {
+ last_scroll_offset_ = frame->GetScrollOffset();
Send(new EwkHostMsg_DidChangeScrollOffset(render_frame()->GetRoutingID(),
- frame->scrollOffset().width,
- frame->scrollOffset().height));
+ frame->GetScrollOffset().width,
+ frame->GetScrollOffset().height));
}
}
void RenderFrameObserverEfl::WillSubmitForm(
const blink::WebFormElement& form) {
- GURL url(blink::WebStringToGURL(form.action()));
+ GURL url(blink::WebStringToGURL(form.Action()));
Send(new EwkHostMsg_FormSubmit(render_frame()->GetRoutingID(), url));
}
void RenderFrameObserverEfl::DidCreateScriptContext(
- v8::Local<v8::Context> context, int extension_group, int world_id) {
+ v8::Local<v8::Context> context, int world_id) {
ContentRendererClientEfl* client = static_cast<ContentRendererClientEfl*>(
GetContentClientExport()->renderer());
client->DidCreateScriptContext(
- render_frame()->GetWebFrame(), context, extension_group, world_id);
+ render_frame()->GetWebFrame(), context, world_id);
}
void RenderFrameObserverEfl::WillReleaseScriptContext(
#include <vector>
#include "content/public/renderer/render_frame_observer.h"
-#include "third_party/WebKit/public/platform/WebSize.h"
+#include "third_party/blink/public/platform/WebSize.h"
namespace blink {
class WebElement;
void WillSubmitForm(const blink::WebFormElement& form) override;
void DidCreateScriptContext(v8::Local<v8::Context> context,
- int extension_group,
int world_id) override;
void WillReleaseScriptContext(v8::Handle<v8::Context> context,
int world_id) override;
#include "common/content_switches_efl.h"
#include "common/render_messages_ewk.h"
#include "content/public/renderer/render_thread.h"
-#include "third_party/WebKit/public/web/WebCache.h"
+#include "third_party/blink/public/platform/WebCache.h"
#include "third_party/sqlite/sqlite3.h"
#include "v8/include/v8.h"
#include "renderer/content_renderer_client_efl.h"
-#include "third_party/WebKit/public/web/WebRuntimeFeatures.h"
+#include "third_party/blink/public/platform/WebRuntimeFeatures.h"
// XXX: config.h needs to be included before internal blink headers.
// XXX2: It'd be great if we did not include internal blibk headers.
#include "third_party/WebKit/Source/platform/fonts/FontCache.h"
ContentRendererClientEfl* content_client)
: content_client_(content_client) {
const base::CommandLine& command_line = *base::CommandLine::ForCurrentProcess();
+#if !defined(EWK_BRINGUP) // FIXME: m67 bringup
+ // FIXME: ‘EnableCSSViewModeMediaFeature’ is not a member of ‘blink::WebRuntimeFeatures’
if (command_line.HasSwitch(switches::kEnableViewMode))
- WebRuntimeFeatures::enableCSSViewModeMediaFeature(true);
+ WebRuntimeFeatures::EnableCSSViewModeMediaFeature(true);
+#endif
}
bool RenderThreadObserverEfl::OnControlMessageReceived(const IPC::Message& message)
void RenderThreadObserverEfl::OnClearCache()
{
- WebCache::clear();
+ WebCache::Clear();
}
void RenderThreadObserverEfl::OnSetCache(const CacheParamsEfl& params)
{
+#if !defined(EWK_BRINGUP) // FIXME: m67 bringup
+ // FIXME: ‘setCapacities’ is not a member of ‘blink::WebCache’
WebCache::setCapacities(static_cast<size_t>(params.cache_min_dead_capacity),
static_cast<size_t>(params.cache_max_dead_capacity),
static_cast<size_t>(params.cache_total_capacity));
+#endif
}
#include "base/strings/string_split.h"
#include "base/strings/string_util.h"
#include "base/strings/utf_string_conversions.h"
+#include "common/hit_test_params.h"
+#include "common/render_messages_ewk.h"
#include "content/public/renderer/content_renderer_client.h"
#include "content/public/renderer/render_view.h"
-#include "common/render_messages_ewk.h"
-#include "common/hit_test_params.h"
-#include "third_party/WebKit/public/platform/WebCString.h"
-#include "third_party/WebKit/public/platform/WebData.h"
-#include "third_party/WebKit/public/platform/WebPoint.h"
-#include "third_party/WebKit/public/platform/WebSize.h"
-#include "third_party/WebKit/public/platform/WebString.h"
-#include "third_party/WebKit/public/platform/WebURLError.h"
-#include "third_party/WebKit/public/platform/WebURLRequest.h"
-#include "third_party/WebKit/public/web/WebDocument.h"
-#include "third_party/WebKit/public/web/WebDataSource.h"
-#include "third_party/WebKit/public/web/WebFormElement.h"
-#include "third_party/WebKit/public/web/WebFrame.h"
-#include "third_party/WebKit/public/web/WebFrameContentDumper.h"
-#include "third_party/WebKit/public/web/WebFrameWidget.h"
-#include "third_party/WebKit/public/web/WebHitTestResult.h"
-#include "third_party/WebKit/public/web/WebInputEvent.h"
-#include "third_party/WebKit/public/web/WebLocalFrame.h"
-#include "third_party/WebKit/public/web/WebView.h"
-#include "third_party/WebKit/public/web/WebSettings.h"
+//#include "third_party/blink/public/platform/WebCString.h"
+#include "third_party/blink/public/platform/WebData.h"
+#include "third_party/blink/public/platform/web_input_event.h"
+#include "third_party/blink/public/platform/WebPoint.h"
+#include "third_party/blink/public/platform/WebSize.h"
+#include "third_party/blink/public/platform/WebString.h"
+#include "third_party/blink/public/platform/WebURLError.h"
+#include "third_party/blink/public/platform/WebURLRequest.h"
+//#include "third_party/blink/public/web/WebDataSource.h"
+#include "third_party/blink/public/web/WebDocument.h"
+#include "third_party/blink/public/web/WebFormElement.h"
+#include "third_party/blink/public/web/WebFrame.h"
+#include "third_party/blink/public/web/WebFrameContentDumper.h"
+#include "third_party/blink/public/web/WebFrameWidget.h"
+#include "third_party/blink/public/web/WebHitTestResult.h"
+#include "third_party/blink/public/web/WebLocalFrame.h"
+#include "third_party/blink/public/web/WebSettings.h"
+#include "third_party/blink/public/web/WebView.h"
+#include "public/web/WebFrameContentDumper.h"
// XXX: config.h needs to be included before internal blink headers.
// It'd be great if we did not include not internal blibk headers.
#include "third_party/WebKit/Source/platform/fonts/FontCache.h"
-using blink::WebDataSource;
+using blink::WebDocumentLoader;
using blink::WebURLRequest;
namespace {
typedef blink::WebContentSecurityPolicyType SecurityPolicyType;
static_assert(
- static_cast<int>(SecurityPolicyType::WebContentSecurityPolicyTypeReport) ==
+ static_cast<int>(SecurityPolicyType::kWebContentSecurityPolicyTypeReport) ==
static_cast<int>(EWK_REPORT_ONLY),
"mismatching enums : EWK_REPORT_ONLY");
static_assert(
- static_cast<int>(SecurityPolicyType::WebContentSecurityPolicyTypeEnforce) ==
+ static_cast<int>(SecurityPolicyType::kWebContentSecurityPolicyTypeEnforce) ==
static_cast<int>(EWK_ENFORCE_POLICY),
"mismatching enums : EWK_ENFORCE_POLICY");
void PopulateEwkHitTestData(const blink::WebHitTestResult& web_hit_test, Hit_Test_Params* params)
{
DCHECK(params);
- params->imageURI = web_hit_test.absoluteImageURL().string().utf8();
- params->linkURI = web_hit_test.absoluteLinkURL().string().utf8();
- params->mediaURI = web_hit_test.absoluteMediaURL().string().utf8();
- params->linkLabel = web_hit_test.textContent().utf8();
- params->linkTitle = web_hit_test.titleDisplayString().utf8();
- params->isEditable = web_hit_test.isContentEditable();
+ params->imageURI = web_hit_test.AbsoluteImageURL().GetString().Utf8();
+ params->linkURI = web_hit_test.AbsoluteLinkURL().GetString().Utf8();
+ params->linkLabel = web_hit_test.textContent().Utf8();
+ params->linkTitle = web_hit_test.titleDisplayString().Utf8();
+ params->isEditable = web_hit_test.IsContentEditable();
int context = EWK_HIT_TEST_RESULT_CONTEXT_DOCUMENT;
- if (!web_hit_test.absoluteLinkURL().isEmpty())
+ if (!web_hit_test.AbsoluteLinkURL().IsEmpty())
context |= EWK_HIT_TEST_RESULT_CONTEXT_LINK;
- if (!web_hit_test.absoluteImageURL().isEmpty())
+ if (!web_hit_test.AbsoluteImageURL().IsEmpty())
context |= EWK_HIT_TEST_RESULT_CONTEXT_IMAGE;
- if (!web_hit_test.absoluteMediaURL().isEmpty())
- context |= EWK_HIT_TEST_RESULT_CONTEXT_MEDIA;;
+ if (!web_hit_test.absoluteMediaURL().IsEmpty())
+ context |= EWK_HIT_TEST_RESULT_CONTEXT_MEDIA;
if (web_hit_test.isSelected())
context |= EWK_HIT_TEST_RESULT_CONTEXT_SELECTION;
- if (web_hit_test.isContentEditable())
+ if (web_hit_test.IsContentEditable())
context |= EWK_HIT_TEST_RESULT_CONTEXT_EDITABLE;
- if (web_hit_test.node().isTextNode())
+ if (web_hit_test.GetNode().IsTextNode())
context |= EWK_HIT_TEST_RESULT_CONTEXT_TEXT;
params->context = static_cast<Ewk_Hit_Test_Result_Context>(context);
if (params->mode & EWK_HIT_TEST_MODE_NODE_DATA) {
- params->nodeData.nodeValue = web_hit_test.node().nodeValue().utf8();
+ params->nodeData.nodeValue = web_hit_test.GetNode().NodeValue().Utf8();
}
if ((params->mode & EWK_HIT_TEST_MODE_IMAGE_DATA) &&
(params->context & EWK_HIT_TEST_RESULT_CONTEXT_IMAGE)) {
- blink::WebElement hit_element = web_hit_test.node().toConst<blink::WebElement>();
+ blink::WebElement hit_element = web_hit_test.GetNode().ToConst<blink::WebElement>();
- params->imageData.imageBitmap = hit_element.imageContents().getSkBitmap();
- params->imageData.fileNameExtension = hit_element.imageFilenameExtension().utf8();
+ params->imageData.imageBitmap = hit_element.ImageContents().GetSkBitmap();
+ params->imageData.fileNameExtension = hit_element.imageFilenameExtension().Utf8();
}
}
{
DCHECK(params);
- if (!web_hit_test.node().isElementNode())
+ if (!web_hit_test.GetNode().IsElementNode())
return;
- blink::WebElement hit_element = web_hit_test.node().toConst<blink::WebElement>();
- for (unsigned int i = 0; i < hit_element.attributeCount(); i++) {
+ blink::WebElement hit_element = web_hit_test.GetNode().ToConst<blink::WebElement>();
+ for (unsigned int i = 0; i < hit_element.AttributeCount(); i++) {
params->nodeData.attributes.insert(std::pair<std::string, std::string>(
- hit_element.attributeLocalName(i).utf8(), hit_element.attributeValue(i).utf8()));
+ hit_element.AttributeLocalName(i).Utf8(), hit_element.AttributeValue(i).Utf8()));
}
}
delete this;
}
-void RenderViewObserverEfl::DidCreateDocumentElement(blink::WebLocalFrame* frame)
-{
- std::string policy;
- Ewk_CSP_Header_Type type = EWK_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) {
- frame->document().setContentSecurityPolicyUsingHeader(
- blink::WebString::fromUTF8(policy), ToSecurityPolicyType(type));
- }
-}
-
void RenderViewObserverEfl::OnSetContentSecurityPolicy(const std::string& policy, Ewk_CSP_Header_Type header_type)
{
blink::WebView* view = render_view()->GetWebView();
DCHECK(view);
- blink::WebDocument document = view->mainFrame()->document();
+ blink::WebDocument document = view->FocusedFrame()->GetDocument();
- document.setContentSecurityPolicyUsingHeader(blink::WebString::fromUTF8(policy),
+ document.setContentSecurityPolicyUsingHeader(blink::WebString::FromUTF8(policy),
ToSecurityPolicyType(header_type));
}
if (!view)
return;
- view->setPageScaleFactor(scale_factor);
+ view->SetPageScaleFactor(scale_factor);
}
void RenderViewObserverEfl::OnSetScroll(int x, int y)
{
- blink::WebFrame* frame = render_view()->GetWebView()->mainFrame();
+ blink::WebLocalFrame* frame = render_view()->GetWebView()->FocusedFrame();
if (!frame)
return;
- frame->setScrollOffset(blink::WebSize(x, y));
+ frame->SetScrollOffset(blink::WebSize(x, y));
}
void RenderViewObserverEfl::OnUseSettingsFont()
{
+#if !defined(EWK_BRINGUP) // FIXME: m67 bringup
blink::FontCache::fontCache()->invalidate();
-#if !defined(EWK_BRINGUP)
blink::WebView* view = render_view()->GetWebView();
if (view)
view->sendResizeEventAndForceLayout();
void RenderViewObserverEfl::OnPlainTextGet(int plain_text_get_callback_id)
{
// WebFrameContentDumper should only be used for testing purposes. See http://crbug.com/585164.
- blink::WebString content = blink::WebFrameContentDumper::dumpWebViewAsText(
+ blink::WebString content = blink::WebFrameContentDumper::DumpWebViewAsText(
render_view()->GetWebView(), INT_MAX);
- Send(new EwkHostMsg_PlainTextGetContents(render_view()->GetRoutingID(), content.utf8(), plain_text_get_callback_id));
+ Send(new EwkHostMsg_PlainTextGetContents(render_view()->GetRoutingID(), content.Utf8(), plain_text_get_callback_id));
}
void RenderViewObserverEfl::OnGetSelectionStyle()
if (!view)
return;
- blink::WebFrame* frame = view->focusedFrame();
+ blink::WebLocalFrame* frame = view->FocusedFrame();
if (!frame)
return;
SelectionStylePrams params;
- params.underline_state = frame->commandState(blink::WebString::fromUTF8("underline"));
- params.italic_state = frame->commandState(blink::WebString::fromUTF8("italic"));
- params.bold_state = frame->commandState(blink::WebString::fromUTF8("bold"));
- blink::WebString bg_color = frame->commandValue(blink::WebString::fromUTF8("BackColor"));
- GetGRBAValuesFromString(std::string(bg_color.utf8()), ¶ms.bg_color.r, ¶ms.bg_color.g, ¶ms.bg_color.b, ¶ms.bg_color.a);
- blink::WebString color = frame->commandValue(blink::WebString::fromUTF8("ForeColor"));
- GetGRBAValuesFromString(std::string(color.utf8()), ¶ms.color.r, ¶ms.color.g, ¶ms.color.b, ¶ms.color.a);
- blink::WebString font_size = frame->commandValue(blink::WebString::fromUTF8("FontSize"));
- params.font_size = font_size.utf8();
- params.order_list_state = frame->commandState(blink::WebString::fromUTF8("InsertOrderedList"));
- params.un_order_list_state = frame->commandState(blink::WebString::fromUTF8("InsertUnorderedList"));
- params.text_align_center_state = frame->commandState(blink::WebString::fromUTF8("JustifyCenter"));
- params.text_align_left_state = frame->commandState(blink::WebString::fromUTF8("JustifyLeft"));
- params.text_align_right_state = frame->commandState(blink::WebString::fromUTF8("JustifyRight"));
- params.text_align_full_state = frame->commandState(blink::WebString::fromUTF8("JustifyFull"));
+ params.underline_state = frame->commandState(blink::WebString::FromUTF8("underline"));
+ params.italic_state = frame->commandState(blink::WebString::FromUTF8("italic"));
+ params.bold_state = frame->commandState(blink::WebString::FromUTF8("bold"));
+ blink::WebString bg_color = frame->commandValue(blink::WebString::FromUTF8("BackColor"));
+ GetGRBAValuesFromString(std::string(bg_color.Utf8()), ¶ms.bg_color.r, ¶ms.bg_color.g, ¶ms.bg_color.b, ¶ms.bg_color.a);
+ blink::WebString color = frame->commandValue(blink::WebString::FromUTF8("ForeColor"));
+ GetGRBAValuesFromString(std::string(color.Utf8()), ¶ms.color.r, ¶ms.color.g, ¶ms.color.b, ¶ms.color.a);
+ blink::WebString font_size = frame->commandValue(blink::WebString::FromUTF8("FontSize"));
+ params.font_size = font_size.Utf8();
+ params.order_list_state = frame->commandState(blink::WebString::FromUTF8("InsertOrderedList"));
+ params.un_order_list_state = frame->commandState(blink::WebString::FromUTF8("InsertUnorderedList"));
+ params.text_align_center_state = frame->commandState(blink::WebString::FromUTF8("JustifyCenter"));
+ params.text_align_left_state = frame->commandState(blink::WebString::FromUTF8("JustifyLeft"));
+ params.text_align_right_state = frame->commandState(blink::WebString::FromUTF8("JustifyRight"));
+ params.text_align_full_state = frame->commandState(blink::WebString::FromUTF8("JustifyFull"));
+#if !defined(EWK_BRINGUP) // FIXME: m67 bringup
+ // FIXME: EWK_BRINGUP definition should be removed.
params.has_composition = frame->hasMarkedText();
+#endif // !defined(EWK_BRINGUP)
Send(new EwkViewMsg_SelectionTextStyleState(render_view()->GetRoutingID(), params));
}
return false;
const blink::WebHitTestResult web_hit_test_result =
- render_view()->GetWebView()->hitTestResultAt(
+ render_view()->GetWebView()->HitTestResultAt(
blink::WebPoint(view_x, view_y));
- if (web_hit_test_result.node().isNull())
+ if (web_hit_test_result.GetNode().IsNull())
return false;
params->mode = mode;
return;
std::string content_string;
-#if !defined(EWK_BRINGUP)
+#if !defined(EWK_BRINGUP) // FIXME: m67 bringup
#pragma message "[M49] WebPageSerializer has been removed from blink. Check for alternative."
blink::WebCString content = blink::WebPageSerializer::serializeToMHTML(view);
if (!content.isEmpty())
if (!view)
return;
- Send(new EwkHostMsg_DidChangePageScaleFactor(render_view()->GetRoutingID(), view->pageScaleFactor()));
+ Send(new EwkHostMsg_DidChangePageScaleFactor(render_view()->GetRoutingID(), view->PageScaleFactor()));
}
void RenderViewObserverEfl::DidUpdateLayout()
void RenderViewObserverEfl::CheckContentsSize()
{
blink::WebView* view = render_view()->GetWebView();
- if (!view || !view->mainFrame())
+ if (!view || !view->MainFrame())
return;
- gfx::Size contents_size = view->mainFrame()->contentsSize();
+ gfx::Size contents_size = view->MainFrame()->ToWebLocalFrame()->ContentsSize();
// Fall back to contentsPreferredMinimumSize if the mainFrame is reporting a
// 0x0 size (this happens during initial load).
if (contents_size.IsEmpty()) {
- contents_size = render_view()->GetWebView()->contentsPreferredMinimumSize();
+ contents_size = render_view()->GetWebView()->ContentsPreferredMinimumSize();
}
if (contents_size == last_sent_contents_size_)
blink::WebColor backgroundColor = draws_transparent_background ?
static_cast<blink::WebColor>(0x00000000) : static_cast<blink::WebColor>(0xFFFFFFFF);
- widget->setBaseBackgroundColor(backgroundColor);
+ widget->SetBaseBackgroundColor(backgroundColor);
}
void RenderViewObserverEfl::OnWebAppIconUrlGet(int callback_id)
{
- blink::WebFrame *frame = render_view()->GetWebView()->mainFrame();
+ blink::WebFrame *frame = render_view()->GetWebView()->MainFrame();
if (!frame) {
return;
}
- blink::WebDocument document = frame->document();
- blink::WebElement head = document.head();
- if (head.isNull()) {
+ blink::WebDocument document = frame->ToWebLocalFrame()->GetDocument();
+ blink::WebElement head = document.Head();
+ if (head.IsNull()) {
return;
}
// We're looking for Apple style rel ("apple-touch-*")
// and Google style rel ("icon"), but we prefer the Apple one
// when both appear, as WebKit-efl was looking only for Apple style rels.
- for (blink::WebNode node = head.firstChild(); !node.isNull();
- node = node.nextSibling()) {
- if (!node.isElementNode()) {
+ for (blink::WebNode node = head.FirstChild(); !node.IsNull();
+ node = node.NextSibling()) {
+ if (!node.IsElementNode()) {
continue;
}
- blink::WebElement elem = node.to<blink::WebElement>();
- if (!elem.hasHTMLTagName("link")) {
+ blink::WebElement elem = node.To<blink::WebElement>();
+ if (!elem.HasHTMLTagName("link")) {
continue;
}
- std::string rel = elem.getAttribute("rel").utf8();
+ std::string rel = elem.GetAttribute("rel").Utf8();
if (base::LowerCaseEqualsASCII(rel, "apple-touch-icon") || // Apple's way
base::LowerCaseEqualsASCII(rel, "apple-touch-icon-precomposed")) {
- appleIconUrl = document.completeURL(elem.getAttribute("href")).string().utf8();
+ appleIconUrl = document.CompleteURL(elem.GetAttribute("href")).GetString().Utf8();
break;
} else if (base::LowerCaseEqualsASCII(rel, "icon")) { // Google's way
- iconUrl = document.completeURL(elem.getAttribute("href")).string().utf8();
+ iconUrl = document.CompleteURL(elem.GetAttribute("href")).GetString().Utf8();
}
}
Send(new EwkHostMsg_WebAppIconUrlGet(render_view()->GetRoutingID(), appleIconUrl.empty() ? iconUrl : appleIconUrl, callback_id));
}
void RenderViewObserverEfl::OnWebAppIconUrlsGet(int callback_id) {
- blink::WebFrame *frame = render_view()->GetWebView()->mainFrame();
+ blink::WebFrame *frame = render_view()->GetWebView()->MainFrame();
if (!frame) {
return;
}
- blink::WebDocument document = frame->document();
- blink::WebElement head = document.head();
- if (head.isNull()) {
+ blink::WebDocument document = frame->ToWebLocalFrame()->GetDocument();
+ blink::WebElement head = document.Head();
+ if (head.IsNull()) {
return;
}
std::map<std::string, std::string> iconUrls;
- for (blink::WebNode node = head.firstChild(); !node.isNull();
- node = node.nextSibling()) {
- if (!node.isElementNode()) {
+ for (blink::WebNode node = head.FirstChild(); !node.IsNull();
+ node = node.NextSibling()) {
+ if (!node.IsElementNode()) {
continue;
}
- blink::WebElement elem = node.to<blink::WebElement>();
- if (!elem.hasHTMLTagName("link")) {
+ blink::WebElement elem = node.To<blink::WebElement>();
+ if (!elem.HasHTMLTagName("link")) {
continue;
}
- std::string rel = elem.getAttribute("rel").utf8();
+ std::string rel = elem.GetAttribute("rel").Utf8();
if (base::LowerCaseEqualsASCII(rel, "apple-touch-icon") || // Apple's way
base::LowerCaseEqualsASCII(rel, "apple-touch-icon-precomposed") || // same here
base::LowerCaseEqualsASCII(rel, "icon")) { // Google's way
- std::string iconSize = elem.getAttribute("sizes").utf8();
- std::string iconUrl = document.completeURL(elem.getAttribute("href")).string().utf8();
+ std::string iconSize = elem.GetAttribute("sizes").Utf8();
+ std::string iconUrl = document.CompleteURL(elem.GetAttribute("href")).GetString().Utf8();
iconUrls[iconSize] = iconUrl;
}
}
void RenderViewObserverEfl::OnWebAppCapableGet(int callback_id) {
- blink::WebFrame *frame = render_view()->GetWebView()->mainFrame();
+ blink::WebFrame *frame = render_view()->GetWebView()->MainFrame();
if (!frame)
return;
- blink::WebDocument document = frame->document();
- blink::WebElement head = document.head();
- if (head.isNull())
+ blink::WebDocument document = frame->ToWebLocalFrame()->GetDocument();
+ blink::WebElement head = document.Head();
+ if (head.IsNull())
return;
bool capable = false;
- for (blink::WebNode node = head.firstChild(); !node.isNull();
- node = node.nextSibling()) {
- if (!node.isElementNode())
+ for (blink::WebNode node = head.FirstChild(); !node.IsNull();
+ node = node.NextSibling()) {
+ if (!node.IsElementNode())
continue;
- blink::WebElement elem = node.to<blink::WebElement>();
- if (!elem.hasHTMLTagName("meta"))
+ blink::WebElement elem = node.To<blink::WebElement>();
+ if (!elem.HasHTMLTagName("meta"))
continue;
- std::string name = elem.getAttribute("name").utf8();
+ std::string name = elem.GetAttribute("name").Utf8();
if (base::LowerCaseEqualsASCII(name, "apple-mobile-web-app-capable") || // Apple's way
base::LowerCaseEqualsASCII(name, "mobile-web-app-capable")) { // Google's way
- std::string content = elem.getAttribute("content").utf8();
+ std::string content = elem.GetAttribute("content").Utf8();
if (base::LowerCaseEqualsASCII(content, "yes")) {
capable = true;
}
void RenderViewObserverEfl::DidHandleGestureEvent(const blink::WebGestureEvent& event)
{
+#if !defined(EWK_BRINGUP) // FIXME: m67 bringup
+ // FIXME: EWK_BRINGUP definition should be removed.
if (event.type == blink::WebInputEvent::GestureTap)
HandleTap(event);
+#endif // !defined(EWK_BRINGUP)
}
void RenderViewObserverEfl::OnSetBrowserFont()
{
-#if !defined(EWK_BRINGUP)
+#if !defined(EWK_BRINGUP) // FIXME: m67 bringup
+ // FIXME: EWK_BRINGUP definition should be removed.
blink::WebView* view = render_view()->GetWebView();
if (view) {
view->setBrowserFont();
}
-#endif
+#endif // !defined(EWK_BRINGUP)
}
void RenderViewObserverEfl::OnSuspendScheduledTasks()
}
void RenderViewObserverEfl::OnSetViewMode(blink::WebViewMode view_mode) {
+#if !defined(EWK_BRINGUP) // FIXME: m67 bringup
blink::WebView* view = render_view()->GetWebView();
if (view)
view->setViewMode(view_mode);
+#endif
}
void RenderViewObserverEfl::OnUpdateWebKitPreferencesEfl(const WebPreferencesEfl& web_preferences_efl)
{
blink::WebView* view = render_view()->GetWebView();
- if (view && view->settings()) {
- blink::WebSettings* settings = view->settings();
- settings->setShrinksViewportContentToFit(web_preferences_efl.shrinks_viewport_content_to_fit);
+ if (view && view->GetSettings()) {
+ blink::WebSettings* settings = view->GetSettings();
+ settings->SetShrinksViewportContentToFit(web_preferences_efl.shrinks_viewport_content_to_fit);
// Allows resetting the scale factor when "auto fitting" gets disabled.
- settings->setLoadWithOverviewMode(web_preferences_efl.shrinks_viewport_content_to_fit);
+ settings->SetLoadWithOverviewMode(web_preferences_efl.shrinks_viewport_content_to_fit);
// and more if they exist in web_preferences_efl.
}
void RenderViewObserverEfl::HandleTap(const blink::WebGestureEvent& event)
{
+#if !defined(EWK_BRINGUP) // FIXME: m67 bringup
+ // FIXME: EWK_BRINGUP definition should be removed.
// In order to closely match our touch adjustment logic, we
// perform a hit test "for tap" using the same "padding" as the
// original tap event. That way, touch adjustment picks up a link
bool hit_content_editable = web_hit_test_result.isContentEditable();
Send(new EwkHostMsg_HandleTapGestureWithContext(render_view()->GetRoutingID(),
hit_link, hit_content_editable));
+#endif // !defined(EWK_BRINGUP)
}
void RenderViewObserverEfl::OnSetTextZoomFactor(float zoom_factor) {
return;
// Hide selection and autofill popups.
- view->hidePopups();
- view->setTextZoomFactor(zoom_factor);
+ view->HidePopups();
+ view->SetTextZoomFactor(zoom_factor);
}
#include "private/ewk_hit_test_private.h"
#include "public/ewk_hit_test.h"
#include "public/ewk_view.h"
-#include "third_party/WebKit/public/platform/WebSize.h"
-#include "third_party/WebKit/public/web/WebViewModeEnums.h"
+#include "third_party/blink/public/platform/WebSize.h"
+#include "third_party/blink/public/web/WebViewModeEnums.h"
namespace base {
class FilePath;
bool OnMessageReceived(const IPC::Message& message) override;
void OnDestruct() override;
- virtual void DidCreateDocumentElement(blink::WebLocalFrame* frame) override;
virtual void DidChangePageScaleFactor() override;
//Changes in PageScaleFactorLimits are applied when layoutUpdated is called
#include <algorithm>
#include <string>
+#include <vector>
namespace {
- // The below Encodings have been taken from
- // chromium/src/third_party/WebKit/Source/wtf/text/TextCodecLatin1.cpp
- // chromium/src/third_party/WebKit/Source/wtf/text/TextCodecUTF8.cpp
- // chromium/src/third_party/WebKit/Source/wtf/text/TextCodecUserDefined.cpp
- // chromium/src/third_party/WebKit/Source/wtf/text/TextCodecUTF16.cpp
- // chromium/src/third_party/WebKit/Source/wtf/text/TextCodecICU.cpp
- //
- // The TextEncodingNameMap(present in /chromium/src/third_party/WebKit/Source/wtf/text/TextEncodingRegistry.cpp)
- // is contructed by combining the Encodings and aliases present in the above files.
- //
- // The character encoding list used by chrome browser is also used as reference. It is located in :
- // chromium/src/chrome/browser/character_encoding.cc
+// The below Encodings have been taken from
+// chromium/src/third_party/WebKit/Source/wtf/text/TextCodecLatin1.cpp
+// chromium/src/third_party/WebKit/Source/wtf/text/TextCodecUTF8.cpp
+// chromium/src/third_party/WebKit/Source/wtf/text/TextCodecUserDefined.cpp
+// chromium/src/third_party/WebKit/Source/wtf/text/TextCodecUTF16.cpp
+// chromium/src/third_party/WebKit/Source/wtf/text/TextCodecICU.cpp
+//
+// The TextEncodingNameMap(present in
+// /chromium/src/third_party/WebKit/Source/wtf/text/TextEncodingRegistry.cpp)
+// is contructed by combining the Encodings and aliases present in the above
+// files.
+//
+// The character encoding list used by chrome browser is also used as reference.
+// It is located in :
+// chromium/src/chrome/browser/character_encoding.cc
const std::vector<std::string> TextEncodingNameMap = {
-"windows-1252",
-"ISO-8859-1",
-"US-ASCII",
-"UTF-8",
-"UTF-16LE",
-"UTF-16BE",
-"x-user-defined",
-"ISO-8859-8-I",
-"GBK",
-"GB_2312-80",
-"EUC-KR",
-"Windows-1254",
-"Windows-874",
-"Big5",
-"macintosh",
-"EUC-JP",
-"Big5-HKSCS",
-"Shift_JIS",
-"EUC-JP",
-"ISO-2022-JP",
-"windows-874",
-"windows-949",
-"ISO-8859-15",
-"ISO-8859-2",
-"windows-1250",
-"windows-1251",
-"windows-1258",
-"KOI8-R",
-"ISO-8859-7",
-"windows-1253",
-"windows-1256",
-"windows-1257",
-"ISO-8859-8",
-"windows-1254",
-"windows-1255",
-"ISO-8859-6",
-"ISO-8859-1",
-"ISO-8859-3",
-"ISO-8859-4",
-"ISO-8859-10",
-"ISO-8859-13",
-"ISO-8859-14",
-"ISO-8859-5",
-"ISO-8859-9",
-"cp864",
-"x-mac-cyrillic"
-};
+ "windows-1252", "ISO-8859-1", "US-ASCII", "UTF-8",
+ "UTF-16LE", "UTF-16BE", "x-user-defined", "ISO-8859-8-I",
+ "GBK", "GB_2312-80", "EUC-KR", "Windows-1254",
+ "Windows-874", "Big5", "macintosh", "EUC-JP",
+ "Big5-HKSCS", "Shift_JIS", "EUC-JP", "ISO-2022-JP",
+ "windows-874", "windows-949", "ISO-8859-15", "ISO-8859-2",
+ "windows-1250", "windows-1251", "windows-1258", "KOI8-R",
+ "ISO-8859-7", "windows-1253", "windows-1256", "windows-1257",
+ "ISO-8859-8", "windows-1254", "windows-1255", "ISO-8859-6",
+ "ISO-8859-1", "ISO-8859-3", "ISO-8859-4", "ISO-8859-10",
+ "ISO-8859-13", "ISO-8859-14", "ISO-8859-5", "ISO-8859-9",
+ "cp864", "x-mac-cyrillic"};
-} //namespace
+} // namespace
-//static
+// static
TextEncodingMapEfl* TextEncodingMapEfl::GetInstance() {
return base::Singleton<TextEncodingMapEfl>::get();
}
#include "url_request_context_getter_efl.h"
#include "base/command_line.h"
+#include "base/task_scheduler/post_task.h"
#include "base/files/file_util.h"
#include "base/memory/ptr_util.h"
#include "base/strings/string_number_conversions.h"
-#include "base/threading/worker_pool.h"
#include "base/threading/sequenced_worker_pool.h"
+#include "chrome/common/chrome_switches.h"
#include "content/public/browser/cookie_store_factory.h"
#include "content/public/common/content_switches.h"
#include "content/public/common/url_constants.h"
-#include "components/network_session_configurator/switches.h"
+#include "http_user_agent_settings_efl.h"
#include "net/base/cache_type.h"
#include "net/cert/cert_verifier.h"
#include "net/cert/ct_policy_enforcer.h"
#include "net/url_request/url_request_intercepting_job_factory.h"
#include "net/url_request/url_request_job_factory_impl.h"
#include "network_delegate_efl.h"
-#include "http_user_agent_settings_efl.h"
+#include "components/network_session_configurator/common/network_switches.h"
using net::SQLitePersistentCookieStore;
void InstallProtocolHandlers(net::URLRequestJobFactoryImpl* job_factory,
ProtocolHandlerMap* protocol_handlers) {
- for (ProtocolHandlerMap::iterator it =
- protocol_handlers->begin();
- it != protocol_handlers->end();
- ++it) {
+ for (ProtocolHandlerMap::iterator it = protocol_handlers->begin();
+ it != protocol_handlers->end(); ++it) {
bool set_protocol = job_factory->SetProtocolHandler(
it->first, base::WrapUnique(it->second.release()));
DCHECK(set_protocol);
if (protocol_handlers)
std::swap(protocol_handlers_, *protocol_handlers);
- proxy_config_service_ = net::ProxyService::CreateSystemProxyConfigService(
- io_task_runner, file_task_runner);
+ proxy_config_service_ =
+ net::ProxyService::CreateSystemProxyConfigService(io_task_runner);
}
-URLRequestContextGetterEfl::~URLRequestContextGetterEfl() {
-}
+URLRequestContextGetterEfl::~URLRequestContextGetterEfl() {}
net::URLRequestContext* URLRequestContextGetterEfl::GetURLRequestContext() {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
if (!url_request_context_) {
- const base::CommandLine& command_line = *base::CommandLine::ForCurrentProcess();
+ const base::CommandLine& command_line =
+ *base::CommandLine::ForCurrentProcess();
url_request_context_.reset(new net::URLRequestContext());
if (net_log_) {
}
if (!network_delegate_.get())
- network_delegate_.reset(new net::NetworkDelegateEfl(
- base::WeakPtr<CookieManager>()));
+ network_delegate_.reset(
+ new net::NetworkDelegateEfl(base::WeakPtr<CookieManager>()));
url_request_context_->set_network_delegate(network_delegate_.get());
storage_.reset(
new net::URLRequestContextStorage(url_request_context_.get()));
- storage_->set_cookie_store(
- CreateCookieStore(CookieStoreConfig()));
- storage_->set_channel_id_service(base::WrapUnique(new net::ChannelIDService(
- new net::DefaultChannelIDStore(NULL),
- base::WorkerPool::GetTaskRunner(true))));
+ storage_->set_cookie_store(CreateCookieStore(CookieStoreConfig()));
+ storage_->set_channel_id_service(base::WrapUnique(
+ new net::ChannelIDService(new net::DefaultChannelIDStore(NULL))));
storage_->set_http_user_agent_settings(
base::WrapUnique(new HttpUserAgentSettingsEfl()));
// TODO(jam): use v8 if possible, look at chrome code.
storage_->set_proxy_service(
net::ProxyService::CreateUsingSystemProxyResolver(
- std::move(proxy_config_service_), 0,
- url_request_context_->net_log()));
+ std::move(proxy_config_service_), url_request_context_->net_log()));
storage_->set_ssl_config_service(new net::SSLConfigServiceDefaults);
storage_->set_http_auth_handler_factory(
net::HttpCache::DefaultBackend* main_backend = NULL;
if (base_path_.empty()) {
main_backend = new net::HttpCache::DefaultBackend(
- net::MEMORY_CACHE,
- net::CACHE_BACKEND_DEFAULT,
- base::FilePath(),
- 0,
- BrowserThread::GetMessageLoopProxyForThread(BrowserThread::CACHE));
+ net::MEMORY_CACHE, net::CACHE_BACKEND_DEFAULT, base::FilePath(), 0);
} else {
base::FilePath cache_path = base_path_.Append(FILE_PATH_LITERAL("Cache"));
main_backend = new net::HttpCache::DefaultBackend(
- net::DISK_CACHE,
- net::CACHE_BACKEND_DEFAULT,
- cache_path,
- 0,
- BrowserThread::GetMessageLoopProxyForThread(BrowserThread::CACHE));
+ net::DISK_CACHE, net::CACHE_BACKEND_DEFAULT, cache_path, 0);
}
- net::HttpNetworkSession::Params network_session_params;
- network_session_params.cert_verifier =
+
+ net::HttpNetworkSession::Context network_session_context;
+ network_session_context.cert_verifier =
url_request_context_->cert_verifier();
- network_session_params.transport_security_state =
+ network_session_context.transport_security_state =
url_request_context_->transport_security_state();
- network_session_params.cert_transparency_verifier =
+ network_session_context.cert_transparency_verifier =
url_request_context_->cert_transparency_verifier();
- network_session_params.ct_policy_enforcer =
+ network_session_context.ct_policy_enforcer =
url_request_context_->ct_policy_enforcer();
- network_session_params.channel_id_service =
+ network_session_context.channel_id_service =
url_request_context_->channel_id_service();
- network_session_params.proxy_service =
- url_request_context_->proxy_service();
- network_session_params.ssl_config_service =
+ network_session_context.ssl_config_service =
url_request_context_->ssl_config_service();
- network_session_params.http_auth_handler_factory =
+ network_session_context.http_auth_handler_factory =
url_request_context_->http_auth_handler_factory();
- network_session_params.http_server_properties =
+ network_session_context.net_log = url_request_context_->net_log();
+ network_session_context.host_resolver =
+ url_request_context_->host_resolver();
+ network_session_context.proxy_service =
+ url_request_context_->proxy_service();
+ network_session_context.http_server_properties =
url_request_context_->http_server_properties();
- network_session_params.net_log =
- url_request_context_->net_log();
+
+ net::HttpNetworkSession::Params network_session_params;
network_session_params.ignore_certificate_errors =
ignore_certificate_errors_;
if (command_line.HasSwitch(switches::kTestingFixedHttpPort)) {
int value;
- base::StringToInt(command_line.GetSwitchValueASCII(
- switches::kTestingFixedHttpPort), &value);
+ base::StringToInt(
+ command_line.GetSwitchValueASCII(switches::kTestingFixedHttpPort),
+ &value);
network_session_params.testing_fixed_http_port = value;
}
if (command_line.HasSwitch(switches::kTestingFixedHttpsPort)) {
int value;
- base::StringToInt(command_line.GetSwitchValueASCII(
- switches::kTestingFixedHttpsPort), &value);
+ base::StringToInt(
+ command_line.GetSwitchValueASCII(switches::kTestingFixedHttpsPort),
+ &value);
network_session_params.testing_fixed_https_port = value;
}
if (command_line.HasSwitch(switches::kHostResolverRules)) {
// Give |storage_| ownership at the end in case it's |mapped_host_resolver|.
storage_->set_host_resolver(std::move(host_resolver));
- network_session_params.host_resolver =
- url_request_context_->host_resolver();
- http_network_session_.reset(
- new net::HttpNetworkSession(network_session_params));
+ http_network_session_.reset(new net::HttpNetworkSession(
+ network_session_params, network_session_context));
net::HttpCache* main_cache = new net::HttpCache(
http_network_session_.get(), base::WrapUnique(main_backend), true);
set_protocol = job_factory->SetProtocolHandler(
url::kFileScheme,
base::WrapUnique(new net::FileProtocolHandler(
- BrowserThread::GetBlockingPool()->
- GetTaskRunnerWithShutdownBehavior(
- base::SequencedWorkerPool::SKIP_ON_SHUTDOWN))));
+ base::CreateTaskRunnerWithTraits(
+ {base::MayBlock(), base::TaskPriority::BACKGROUND,
+ base::TaskShutdownBehavior::SKIP_ON_SHUTDOWN})
+ .get())));
DCHECK(set_protocol);
// Set up interceptors in the reverse order.
std::move(job_factory);
for (URLRequestInterceptorScopedVector::reverse_iterator i =
request_interceptors_.rbegin();
- i != request_interceptors_.rend();
- ++i) {
+ i != request_interceptors_.rend(); ++i) {
top_job_factory.reset(new net::URLRequestInterceptingJobFactory(
- std::move(top_job_factory), base::WrapUnique(*i)));
+ std::move(top_job_factory), std::move(*i)));
}
- request_interceptors_.weak_clear();
+ request_interceptors_.clear();
storage_->set_job_factory(base::WrapUnique(top_job_factory.release()));
}
}
scoped_refptr<base::SingleThreadTaskRunner>
- URLRequestContextGetterEfl::GetNetworkTaskRunner() const {
- return BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO);
+URLRequestContextGetterEfl::GetNetworkTaskRunner() const {
+ return BrowserThread::GetTaskRunnerForThread(BrowserThread::IO);
}
net::HostResolver* URLRequestContextGetterEfl::host_resolver() {
const base::FilePath& path,
bool persist_session_cookies,
Ewk_Cookie_Persistent_Storage file_storage) {
- if (url_request_context_->cookie_store() &&
- (cookie_store_path_ == path)) {
+ if (url_request_context_->cookie_store() && (cookie_store_path_ == path)) {
// The path has not changed so don't do anything.
return;
}
if (!BrowserThread::CurrentlyOn(BrowserThread::IO)) {
BrowserThread::PostTask(
- BrowserThread::IO, FROM_HERE,
- base::Bind(&URLRequestContextGetterEfl::SetCookieStoragePath,
- this, path, persist_session_cookies, file_storage));
+ BrowserThread::IO, FROM_HERE,
+ base::Bind(&URLRequestContextGetterEfl::SetCookieStoragePath, this,
+ path, persist_session_cookies, file_storage));
return;
}
void URLRequestContextGetterEfl::CreateSQLitePersistentCookieStore(
const base::FilePath& path,
- bool persist_session_cookies)
-{
+ bool persist_session_cookies) {
using content::CookieStoreConfig;
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
- scoped_refptr<SQLitePersistentCookieStore> persistent_store;
+ scoped_refptr<net::SQLitePersistentCookieStore> persistent_store;
if (path.empty())
return;
base::ThreadRestrictions::ScopedAllowIO allow_io;
- if (base::DirectoryExists(path) ||
- base::CreateDirectory(path)) {
+ if (base::DirectoryExists(path) || base::CreateDirectory(path)) {
const base::FilePath& cookie_path = path.AppendASCII("Cookies");
- persistent_store =
- new SQLitePersistentCookieStore(
- cookie_path,
- BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO),
- BrowserThread::GetMessageLoopProxyForThread(BrowserThread::DB),
- persist_session_cookies, NULL);
+ persistent_store = new net::SQLitePersistentCookieStore(
+ cookie_path, BrowserThread::GetTaskRunnerForThread(BrowserThread::IO),
+ BrowserThread::GetTaskRunnerForThread(BrowserThread::DB),
+ persist_session_cookies, NULL);
} else {
NOTREACHED() << "The cookie storage directory could not be created";
return;
std::vector<std::string> schemes;
for (int i = 0; i < net::CookieMonster::kDefaultCookieableSchemesCount; ++i)
- schemes.push_back(std::string(net::CookieMonster::kDefaultCookieableSchemes[i]));
+ schemes.push_back(
+ std::string(net::CookieMonster::kDefaultCookieableSchemes[i]));
schemes.push_back(url::kFileScheme);
cookie_monster->SetCookieableSchemes(schemes);
cookie_store_path_ = path;
}
-void URLRequestContextGetterEfl::CreatePersistentCookieStore(const base::FilePath& path,
- bool persist_session_cookies)
-{
+void URLRequestContextGetterEfl::CreatePersistentCookieStore(
+ const base::FilePath& path,
+ bool persist_session_cookies) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
cookie_store_path_ = path;
CookieStoreConfig config(
cookie_store_path_.Append(FILE_PATH_LITERAL("Cookies")),
- CookieStoreConfig::RESTORED_SESSION_COOKIES,
- NULL,
- NULL);
- cookie_store_= CreateCookieStore(config);
- net::CookieMonster* cookie_monster = static_cast<net::CookieMonster*>(
- cookie_store_.get());
+ CookieStoreConfig::RESTORED_SESSION_COOKIES, NULL);
+ cookie_store_ = CreateCookieStore(config);
+ net::CookieMonster* cookie_monster =
+ static_cast<net::CookieMonster*>(cookie_store_.get());
cookie_monster->SetPersistSessionCookies(persist_session_cookies);
std::vector<std::string> schemes;
for (int i = 0; i < net::CookieMonster::kDefaultCookieableSchemesCount; ++i)
- schemes.push_back(std::string(net::CookieMonster::kDefaultCookieableSchemes[i]));
+ schemes.push_back(
+ std::string(net::CookieMonster::kDefaultCookieableSchemes[i]));
schemes.push_back(url::kFileScheme);
cookie_monster->SetCookieableSchemes(schemes);
url_request_context_->set_cookie_store(cookie_store_.get());
}
-}; // namespace content
+}; // namespace content
URLRequestContextGetterEfl(std::unique_ptr<net::NetworkDelegate> network_delegate = std::unique_ptr<net::NetworkDelegate>(),
bool ignore_certificate_errors = false,
const base::FilePath& base_path = base::FilePath(),
- const scoped_refptr<base::SingleThreadTaskRunner> &io_task_runner = BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO),
- const scoped_refptr<base::SingleThreadTaskRunner> &file_task_runner = BrowserThread::GetMessageLoopProxyForThread(BrowserThread::FILE),
+ const scoped_refptr<base::SingleThreadTaskRunner> &io_task_runner = BrowserThread::GetTaskRunnerForThread(BrowserThread::IO),
+ const scoped_refptr<base::SingleThreadTaskRunner> &file_task_runner = BrowserThread::GetTaskRunnerForThread(BrowserThread::FILE),
ProtocolHandlerMap* protocol_handlers = NULL,
URLRequestInterceptorScopedVector request_interceptors = URLRequestInterceptorScopedVector(),
net::NetLog* net_log = NULL);
#include "browser/javascript_dialog_manager_efl.h"
#include "browser/policy_response_delegate_efl.h"
#include "common/render_messages_ewk.h"
+#include "components/favicon_base/favicon_types.h"
#include "components/password_manager/core/common/password_manager_pref_names.h"
#include "components/prefs/pref_service.h"
#include "content/browser/renderer_host/render_widget_host_view_efl.h"
#include "private/ewk_policy_decision_private.h"
#include "private/ewk_user_media_private.h"
#include "private/webview_delegate_ewk.h"
-#include "public/web/WebInputEvent.h"
+#include "public/platform/web_input_event.h"
#include "url/gurl.h"
#if defined(OS_TIZEN)
namespace content {
-void WritePdfDataToFile(printing::PdfMetafileSkia* metafile, const base::FilePath& filename) {
+void WritePdfDataToFile(printing::PdfMetafileSkia* metafile,
+ const base::FilePath& filename) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE));
DCHECK(metafile);
- base::File file(filename, base::File::FLAG_CREATE_ALWAYS | base::File::FLAG_WRITE);
+ base::File file(filename,
+ base::File::FLAG_CREATE_ALWAYS | base::File::FLAG_WRITE);
metafile->SaveTo(&file);
file.Close();
delete metafile;
}
#if defined(OS_TIZEN) && defined(TIZEN_MULTIMEDIA_SUPPORT)
-static const content::MediaStreamDevice*
- GetRequestedVideoDevice(const std::string& device_id) {
+static const content::MediaStreamDevice* GetRequestedVideoDevice(
+ const std::string& device_id) {
const content::MediaStreamDevices& video_devices =
MediaCaptureDevices::GetInstance()->GetVideoCaptureDevices();
if (video_devices.empty())
#endif
WebContentsDelegateEfl::WebContentsDelegateEfl(EWebView* view)
- : WebContentsObserver(&view->web_contents())
- , web_view_(view)
- , is_fullscreen_(false)
- , web_contents_(view->web_contents())
- , document_created_(false)
- , dialog_manager_(NULL)
- , weak_ptr_factory_(this) {
+ : WebContentsObserver(&view->web_contents()),
+ web_view_(view),
+ is_fullscreen_(false),
+ web_contents_(view->web_contents()),
+ document_created_(false),
+ dialog_manager_(NULL),
+ weak_ptr_factory_(this) {
#if defined(TIZEN_AUTOFILL_SUPPORT)
AutofillClientEfl::CreateForWebContents(&web_contents_);
AutofillClientEfl* autofill_manager =
AutofillClientEfl::FromWebContents(&web_contents_);
autofill_manager->SetEWebView(view);
- PasswordManagerClientEfl::CreateForWebContentsWithAutofillClient(&web_contents_,
- autofill_manager);
- ContentAutofillDriverFactory::CreateForWebContentsAndDelegate(&web_contents_,
- autofill_manager,
- EWebView::GetPlatformLocale(),
+ PasswordManagerClientEfl::CreateForWebContentsWithAutofillClient(
+ &web_contents_, autofill_manager);
+ ContentAutofillDriverFactory::CreateForWebContentsAndDelegate(
+ &web_contents_, autofill_manager, EWebView::GetPlatformLocale(),
AutofillManager::DISABLE_AUTOFILL_DOWNLOAD_MANAGER);
#endif
}
}
WebContents* WebContentsDelegateEfl::OpenURLFromTab(
- WebContents* source,
- const content::OpenURLParams& params) {
-
+ WebContents* source,
+ const content::OpenURLParams& params) {
const GURL& url = params.url;
WindowOpenDisposition disposition = params.disposition;
- if (!source || (disposition != CURRENT_TAB &&
- disposition != NEW_FOREGROUND_TAB &&
- disposition != NEW_BACKGROUND_TAB &&
- disposition != OFF_THE_RECORD)) {
+ if (!source || (disposition != WindowOpenDisposition::CURRENT_TAB &&
+ disposition != WindowOpenDisposition::NEW_FOREGROUND_TAB &&
+ disposition != WindowOpenDisposition::NEW_BACKGROUND_TAB &&
+ disposition != WindowOpenDisposition::OFF_THE_RECORD)) {
NOTIMPLEMENTED();
return NULL;
}
- if (disposition == NEW_FOREGROUND_TAB ||
- disposition == NEW_BACKGROUND_TAB ||
- disposition == OFF_THE_RECORD) {
+ if (disposition == WindowOpenDisposition::NEW_FOREGROUND_TAB ||
+ disposition == WindowOpenDisposition::NEW_BACKGROUND_TAB ||
+ disposition == WindowOpenDisposition::OFF_THE_RECORD) {
Evas_Object* new_object = NULL;
- web_view_->SmartCallback<EWebViewCallbacks::CreateNewWindow>().call(&new_object);
+ web_view_->SmartCallback<EWebViewCallbacks::CreateNewWindow>().call(
+ &new_object);
if (!new_object)
return NULL;
- EWebView* wv = WebViewDelegateEwk::GetInstance().
- GetWebViewFromEvasObject(new_object);
+ EWebView* wv =
+ WebViewDelegateEwk::GetInstance().GetWebViewFromEvasObject(new_object);
DCHECK(wv);
wv->SetURL(url);
return NULL;
}
void WebContentsDelegateEfl::NavigationStateChanged(
- WebContents* source, InvalidateTypes changed_flags) {
+ WebContents* source,
+ InvalidateTypes changed_flags) {
if (changed_flags & content::INVALIDATE_TYPE_URL) {
const char* url = source->GetVisibleURL().spec().c_str();
web_view_->SmartCallback<EWebViewCallbacks::URLChanged>().call(url);
web_view_->SmartCallback<EWebViewCallbacks::LoadProgressFinished>().call();
}
-void WebContentsDelegateEfl::LoadProgressChanged(WebContents* source, double progress) {
+void WebContentsDelegateEfl::LoadProgressChanged(WebContents* source,
+ double progress) {
web_view_->SetProgressValue(progress);
web_view_->SmartCallback<EWebViewCallbacks::LoadProgress>().call(&progress);
}
bool WebContentsDelegateEfl::ShouldCreateWebContents(
- WebContents* web_contents,
- int route_id,
- int main_frame_route_id,
- int main_frame_widget_route_id,
- WindowContainerType window_container_type,
+ content::WebContents* web_contents,
+ content::RenderFrameHost* opener,
+ content::SiteInstance* source_site_instance,
+ int32_t route_id,
+ int32_t main_frame_route_id,
+ int32_t main_frame_widget_route_id,
+ content::mojom::WindowContainerType window_container_type,
+ const GURL& opener_url,
const std::string& frame_name,
const GURL& target_url,
const std::string& partition_id,
- SessionStorageNamespace* session_storage_namespace) {
+ content::SessionStorageNamespace* session_storage_namespace) {
// We implement the asynchronous version of the function, this
// one should never be invoked.
NOTREACHED();
web_view_->SmartCallback<EWebViewCallbacks::WindowClosed>().call();
}
-void WebContentsDelegateEfl::EnterFullscreenModeForTab(content::WebContents* web_contents,
- const GURL& origin) {
- is_fullscreen_ = true;
- web_view_->SmartCallback<EWebViewCallbacks::EnterFullscreen>().call();
+void WebContentsDelegateEfl::EnterFullscreenModeForTab(
+ content::WebContents* web_contents,
+ const GURL& origin) {
+ is_fullscreen_ = true;
+ web_view_->SmartCallback<EWebViewCallbacks::EnterFullscreen>().call();
}
-void WebContentsDelegateEfl::ExitFullscreenModeForTab(content::WebContents* web_contents) {
- is_fullscreen_ = false;
- web_view_->SmartCallback<EWebViewCallbacks::ExitFullscreen>().call();
+void WebContentsDelegateEfl::ExitFullscreenModeForTab(
+ content::WebContents* web_contents) {
+ is_fullscreen_ = false;
+ web_view_->SmartCallback<EWebViewCallbacks::ExitFullscreen>().call();
}
bool WebContentsDelegateEfl::IsFullscreenForTabOrPending(
- const WebContents* web_contents) const {
+ const WebContents* web_contents) const {
return is_fullscreen_;
}
-void WebContentsDelegateEfl::RegisterProtocolHandler(WebContents* web_contents,
- const std::string& protocol, const GURL& url, bool user_gesture) {
- Ewk_Custom_Handlers_Data protocol_data(protocol.c_str(),
- url.host().c_str(), url.spec().c_str());
- web_view_->SmartCallback<EWebViewCallbacks::RegisterProtocolHandler>().call(&protocol_data);
+void WebContentsDelegateEfl::RegisterProtocolHandler(
+ WebContents* web_contents,
+ const std::string& protocol,
+ const GURL& url,
+ bool user_gesture) {
+ Ewk_Custom_Handlers_Data protocol_data(protocol.c_str(), url.host().c_str(),
+ url.spec().c_str());
+ web_view_->SmartCallback<EWebViewCallbacks::RegisterProtocolHandler>().call(
+ &protocol_data);
}
-void WebContentsDelegateEfl::UnregisterProtocolHandler(WebContents* web_contents,
- const std::string& protocol,
- const GURL& url,
- bool user_gesture) {
- Ewk_Custom_Handlers_Data protocol_data(protocol.c_str(),
- url.host().c_str(), url.spec().c_str());
- web_view_->SmartCallback<EWebViewCallbacks::UnregisterProtocolHandler>()
- .call(&protocol_data);
+void WebContentsDelegateEfl::UnregisterProtocolHandler(
+ WebContents* web_contents,
+ const std::string& protocol,
+ const GURL& url,
+ bool user_gesture) {
+ Ewk_Custom_Handlers_Data protocol_data(protocol.c_str(), url.host().c_str(),
+ url.spec().c_str());
+ web_view_->SmartCallback<EWebViewCallbacks::UnregisterProtocolHandler>().call(
+ &protocol_data);
}
#if defined(TIZEN_MULTIMEDIA_SUPPORT)
void WebContentsDelegateEfl::RequestMediaAccessAllow(
const MediaStreamRequest& request,
const MediaResponseCallback& callback) {
-
MediaStreamDevices devices;
if (request.audio_type == content::MEDIA_DEVICE_AUDIO_CAPTURE) {
- devices.push_back(MediaStreamDevice(request.audio_type,
- "default", "Default"));
+ devices.push_back(
+ MediaStreamDevice(request.audio_type, "default", "Default"));
}
if (request.video_type == content::MEDIA_DEVICE_VIDEO_CAPTURE) {
GetRequestedVideoDevice(request.requested_video_device_id);
if (video_device) {
devices.push_back(*video_device);
- }
- else {
+ } else {
callback.Run(MediaStreamDevices(), MEDIA_DEVICE_NOT_SUPPORTED,
- std::unique_ptr<MediaStreamUI>());
+ std::unique_ptr<MediaStreamUI>());
}
#else
- devices.push_back(MediaStreamDevice(request.video_type, "/dev/video0", "1"));
+ devices.push_back(
+ MediaStreamDevice(request.video_type, "/dev/video0", "1"));
#endif
}
- callback.Run(devices, MEDIA_DEVICE_OK,std::unique_ptr<MediaStreamUI>());
+ callback.Run(devices, MEDIA_DEVICE_OK, std::unique_ptr<MediaStreamUI>());
}
void WebContentsDelegateEfl::RequestMediaAccessDeny(
const MediaResponseCallback& callback) {
LOG(ERROR) << __FUNCTION__ << " Decline request with empty list";
callback.Run(MediaStreamDevices(), MEDIA_DEVICE_NOT_SUPPORTED,
- std::unique_ptr<MediaStreamUI>());
+ std::unique_ptr<MediaStreamUI>());
}
bool WebContentsDelegateEfl::CheckMediaAccessPermission(
}
void WebContentsDelegateEfl::RequestMediaAccessPermission(
- WebContents* web_contents,
- const MediaStreamRequest& request,
- const MediaResponseCallback& callback) {
+ WebContents* web_contents,
+ const MediaStreamRequest& request,
+ const MediaResponseCallback& callback) {
std::unique_ptr<_Ewk_User_Media_Permission_Request> media_permission_request(
new _Ewk_User_Media_Permission_Request(this, request, callback));
Eina_Bool callback_result = EINA_FALSE;
if (!web_view_->InvokeViewUserMediaPermissionCallback(
- media_permission_request.get(), &callback_result)) {
- web_view_->SmartCallback<EWebViewCallbacks::UserMediaPermission>()
- .call(media_permission_request.get());
+ media_permission_request.get(), &callback_result)) {
+ web_view_->SmartCallback<EWebViewCallbacks::UserMediaPermission>().call(
+ media_permission_request.get());
}
// if policy is suspended, the API takes over the policy object lifetime
ignore_result(media_permission_request.release());
else if (!media_permission_request->IsDecided()) {
callback.Run(MediaStreamDevices(), MEDIA_DEVICE_NOT_SUPPORTED,
- std::unique_ptr<MediaStreamUI>());
+ std::unique_ptr<MediaStreamUI>());
}
}
#endif
web_view_->InvokeAuthCallback(login_delegate, request->url(), realm);
}
-void WebContentsDelegateEfl::DidStartProvisionalLoadForFrame(RenderFrameHost* render_frame_host,
- const GURL& validated_url,
- bool is_error_page,
- bool is_iframe_srcdoc) {
+void WebContentsDelegateEfl::DidStartProvisionalLoadForFrame(
+ RenderFrameHost* render_frame_host,
+ const GURL& validated_url,
+ bool is_error_page,
+ bool is_iframe_srcdoc) {
web_view_->SmartCallback<EWebViewCallbacks::ProvisionalLoadStarted>().call();
}
-void WebContentsDelegateEfl::DidCommitProvisionalLoadForFrame(RenderFrameHost* render_frame_host,
- const GURL& url,
- ui::PageTransition transition_type) {
+void WebContentsDelegateEfl::DidCommitProvisionalLoadForFrame(
+ RenderFrameHost* render_frame_host,
+ const GURL& url,
+ ui::PageTransition transition_type) {
web_view_->SmartCallback<EWebViewCallbacks::LoadCommitted>().call();
}
-
-void WebContentsDelegateEfl::DidNavigateMainFrame(const LoadCommittedDetails& details,
- const FrameNavigateParams& params) {
+void WebContentsDelegateEfl::DidNavigateMainFrame(
+ const LoadCommittedDetails& details,
+ const FrameNavigateParams& params) {
// The condition checks whether the main frame navigated to a different page,
// not scrolled to a fragment inside the current page.
if (details.is_navigation_to_different_page())
web_view_->SmartCallback<EWebViewCallbacks::LoadFinished>().call();
}
-void WebContentsDelegateEfl::DidNavigateAnyFrame(RenderFrameHost* render_frame_host, const LoadCommittedDetails& details, const FrameNavigateParams& params) {
+void WebContentsDelegateEfl::DidNavigateAnyFrame(
+ RenderFrameHost* render_frame_host,
+ const LoadCommittedDetails& details,
+ const FrameNavigateParams& params) {
web_view_->SmartCallback<EWebViewCallbacks::ProvisionalLoadRedirect>().call();
- static_cast<BrowserContextEfl*>(web_contents_.GetBrowserContext())->AddVisitedURLs(params.redirects);
+ static_cast<BrowserContextEfl*>(web_contents_.GetBrowserContext())
+ ->AddVisitedURLs(params.redirects);
}
void WebContentsDelegateEfl::DidFinishLoad(RenderFrameHost* render_frame_host,
if (render_frame_host->GetParent())
return;
- NavigationEntry *entry = web_contents().GetController().GetVisibleEntry();
+ NavigationEntry* entry = web_contents().GetController().GetVisibleEntry();
if (!entry)
return;
- FaviconStatus &favicon = entry->GetFavicon();
+ FaviconStatus& favicon = entry->GetFavicon();
if (favicon.valid) {
// check/update the url and favicon url in favicon database
- FaviconDatabase::Instance()->SetFaviconURLForPageURL(favicon.url, validated_url);
+ FaviconDatabase::Instance()->SetFaviconURLForPageURL(favicon.url,
+ validated_url);
// download favicon if there is no such in database
if (!FaviconDatabase::Instance()->ExistsForFaviconURL(favicon.url)) {
LOG(ERROR) << "[DidFinishLoad] :: no favicon in database for URL: "
<< favicon.url.spec();
- favicon_downloader_.reset(
- new FaviconDownloader(&web_contents_,
- favicon.url,
- base::Bind(
- &WebContentsDelegateEfl::DidDownloadFavicon,
- weak_ptr_factory_.GetWeakPtr())));
+ favicon_downloader_.reset(new FaviconDownloader(
+ &web_contents_, favicon.url,
+ base::Bind(&WebContentsDelegateEfl::DidDownloadFavicon,
+ weak_ptr_factory_.GetWeakPtr())));
favicon_downloader_->Start();
} else {
web_view_->SmartCallback<EWebViewCallbacks::IconReceived>().call();
web_contents_.Focus();
}
-
-void WebContentsDelegateEfl::DidUpdateFaviconURL(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];
- if (favicon.icon_type == FaviconURL::FAVICON && !favicon.icon_url.is_empty()) {
- NavigationEntry *entry = web_contents_.GetController().GetVisibleEntry();
+ if (favicon.icon_type == FaviconURL::IconType::kFavicon &&
+ !favicon.icon_url.is_empty()) {
+ NavigationEntry* entry = web_contents_.GetController().GetVisibleEntry();
if (!entry)
return;
entry->GetFavicon().url = favicon.icon_url;
return;
}
-void WebContentsDelegateEfl::DidDownloadFavicon(bool success, const GURL& icon_url, const SkBitmap& bitmap) {
+void WebContentsDelegateEfl::DidDownloadFavicon(bool success,
+ const GURL& icon_url,
+ const SkBitmap& bitmap) {
favicon_downloader_.reset();
if (success) {
FaviconDatabase::Instance()->SetBitmapForFaviconURL(bitmap, icon_url);
}
}
-void WebContentsDelegateEfl::RequestCertificateConfirm(WebContents* /*web_contents*/,
- int cert_error,
- const net::SSLInfo& ssl_info,
- const GURL& url,
- ResourceType /*resource_type*/,
- bool /*overridable*/,
- bool /*strict_enforcement*/,
- const base::Callback<void(bool)>& callback,
- CertificateRequestResultType* result) {
+void WebContentsDelegateEfl::RequestCertificateConfirm(
+ WebContents* /*web_contents*/,
+ int cert_error,
+ const net::SSLInfo& ssl_info,
+ const GURL& url,
+ ResourceType /*resource_type*/,
+ bool /*overridable*/,
+ bool /*strict_enforcement*/,
+ base::Callback<void(CertificateRequestResultType)>& callback) {
+#if !defined(EWK_BRINGUP) // FIXME: m67 bringup
+ // FIXME: EWK_BRINGUP definition should be removed.
DCHECK(result);
std::string pem_certificate;
- if (!net::X509Certificate::GetPEMEncoded(ssl_info.cert->os_cert_handle(), &pem_certificate)) {
+ if (!net::X509Certificate::GetPEMEncoded(ssl_info.cert->os_cert_handle(),
+ &pem_certificate)) {
*result = content::CERTIFICATE_REQUEST_RESULT_TYPE_CANCEL;
return;
}
- certificate_policy_decision_.reset(new _Ewk_Certificate_Policy_Decision(url,
- pem_certificate,
- cert_error,
- callback));
+ certificate_policy_decision_.reset(new _Ewk_Certificate_Policy_Decision(
+ url, pem_certificate, cert_error, callback));
+#endif // !defined(EWK_BRINGUP)
web_view_->SmartCallback<EWebViewCallbacks::RequestCertificateConfirm>().call(
certificate_policy_decision_.get());
}
}
-void WebContentsDelegateEfl::SetContentSecurityPolicy(const std::string& policy, Ewk_CSP_Header_Type header_type) {
+void WebContentsDelegateEfl::SetContentSecurityPolicy(
+ const std::string& policy,
+ Ewk_CSP_Header_Type header_type) {
if (document_created_) {
RenderViewHost* rvh = web_contents_.GetRenderViewHost();
rvh->Send(new EwkViewMsg_SetCSP(rvh->GetRoutingID(), policy, header_type));
} else {
DCHECK(!pending_content_security_policy_.get());
- pending_content_security_policy_.reset(new ContentSecurityPolicy(policy, header_type));
+ pending_content_security_policy_.reset(
+ new ContentSecurityPolicy(policy, header_type));
}
}
int active_match_ordinal,
bool final_update) {
if (final_update && request_id == web_view_->current_find_request_id()) {
- unsigned int uint_number_of_matches = static_cast<unsigned int>(number_of_matches);
- web_view_->SmartCallback<EWebViewCallbacks::TextFound>().call(&uint_number_of_matches);
+ unsigned int uint_number_of_matches =
+ static_cast<unsigned int>(number_of_matches);
+ web_view_->SmartCallback<EWebViewCallbacks::TextFound>().call(
+ &uint_number_of_matches);
}
}
JavaScriptDialogManager* WebContentsDelegateEfl::GetJavaScriptDialogManager(
- WebContents* source) {
+ WebContents* source) {
if (!dialog_manager_)
dialog_manager_ = new JavaScriptDialogManagerEfl();
return dialog_manager_;
}
-void WebContentsDelegateEfl::OnUpdateSettings(const Ewk_Settings *settings) {
+void WebContentsDelegateEfl::OnUpdateSettings(const Ewk_Settings* settings) {
#if defined(TIZEN_AUTOFILL_SUPPORT)
PasswordManagerClientEfl* client =
PasswordManagerClientEfl::FromWebContents(&web_contents_);
bool WebContentsDelegateEfl::OnMessageReceived(const IPC::Message& message) {
bool handled = true;
IPC_BEGIN_MESSAGE_MAP(WebContentsDelegateEfl, message)
- IPC_MESSAGE_HANDLER_DELAY_REPLY(EwkHostMsg_GetContentSecurityPolicy, OnGetContentSecurityPolicy)
- IPC_MESSAGE_HANDLER(EwkHostMsg_DidPrintPagesToPdf, OnPrintedMetafileReceived)
- IPC_MESSAGE_HANDLER(EwkHostMsg_WrtMessage, OnWrtPluginMessage)
- IPC_MESSAGE_HANDLER_DELAY_REPLY(EwkHostMsg_WrtSyncMessage, OnWrtPluginSyncMessage)
- IPC_MESSAGE_UNHANDLED(handled = false)
+#if !defined(EWK_BRINGUP) // FIXME: m67 bringup
+ // FIXME: WebContentsObserver is IPC:: listener only cannot send
+ IPC_MESSAGE_HANDLER_DELAY_REPLY(EwkHostMsg_GetContentSecurityPolicy,
+ OnGetContentSecurityPolicy)
+#endif
+ IPC_MESSAGE_HANDLER(EwkHostMsg_DidPrintPagesToPdf, OnPrintedMetafileReceived)
+ IPC_MESSAGE_HANDLER(EwkHostMsg_WrtMessage, OnWrtPluginMessage)
+#if !defined(EWK_BRINGUP) // FIXME: m67 bringup
+ // FIXME: WebContentsObserver is IPC:: listener only cannot send
+ IPC_MESSAGE_HANDLER_DELAY_REPLY(EwkHostMsg_WrtSyncMessage,
+ OnWrtPluginSyncMessage)
+#endif
+ IPC_MESSAGE_UNHANDLED(handled = false)
IPC_END_MESSAGE_MAP()
return handled;
}
void WebContentsDelegateEfl::DidFailProvisionalLoad(
- RenderFrameHost* render_frame_host, const GURL& validated_url,
- int error_code, const base::string16& error_description,
- bool was_ignored_by_handler) {
- DidFailLoad(render_frame_host, validated_url, error_code,
- error_description, was_ignored_by_handler);
-}
-
-void WebContentsDelegateEfl::DidFailLoad(RenderFrameHost* render_frame_host,
- const GURL& validated_url, int error_code,
- const base::string16& error_description, bool was_ignored_by_handler) {
+ RenderFrameHost* render_frame_host,
+ const GURL& validated_url,
+ int error_code,
+ const base::string16& error_description,
+ bool /*was_ignored_by_handler*/) {
+ DidFailLoad(render_frame_host, validated_url, error_code, error_description);
+}
+
+void WebContentsDelegateEfl::DidFailLoad(
+ RenderFrameHost* render_frame_host,
+ const GURL& validated_url,
+ int error_code,
+ const base::string16& error_description) {
bool is_main_frame = !render_frame_host->GetParent();
std::string description = base::UTF16ToUTF8(error_description);
- web_view_->InvokeLoadError(validated_url, error_code, description, is_main_frame);
+ web_view_->InvokeLoadError(validated_url, error_code, description,
+ is_main_frame);
}
-void WebContentsDelegateEfl::OnWrtPluginMessage(const Ewk_Wrt_Message_Data& data) {
+void WebContentsDelegateEfl::OnWrtPluginMessage(
+ const Ewk_Wrt_Message_Data& data) {
std::unique_ptr<Ewk_Wrt_Message_Data> p(new Ewk_Wrt_Message_Data);
p->type = data.type;
p->value = data.value;
p->id = data.id;
p->reference_id = data.reference_id;
- web_view_->SmartCallback<EWebViewCallbacks::WrtPluginsMessage>().call(p.get());
+ web_view_->SmartCallback<EWebViewCallbacks::WrtPluginsMessage>().call(
+ p.get());
}
-void WebContentsDelegateEfl::OnWrtPluginSyncMessage(const Ewk_Wrt_Message_Data& data,
- IPC::Message* reply) {
+void WebContentsDelegateEfl::OnWrtPluginSyncMessage(
+ const Ewk_Wrt_Message_Data& data,
+ IPC::Message* reply) {
Ewk_Wrt_Message_Data tmp = data;
web_view_->SmartCallback<EWebViewCallbacks::WrtPluginsMessage>().call(&tmp);
EwkHostMsg_WrtSyncMessage::WriteReplyParams(reply, tmp.value);
+#if !defined(EWK_BRINGUP) // FIXME: m67 bringup
+ // WebContentsObserver is IPC:: listener only cannot send
Send(reply);
+#endif
}
void WebContentsDelegateEfl::DidFirstVisuallyNonEmptyPaint() {
- web_view_->SmartCallback<EWebViewCallbacks::LoadNonEmptyLayoutFinished>().call();
+ web_view_->SmartCallback<EWebViewCallbacks::LoadNonEmptyLayoutFinished>()
+ .call();
web_view_->SmartCallback<EWebViewCallbacks::FrameRendered>().call(0);
}
-void WebContentsDelegateEfl::OnGetContentSecurityPolicy(IPC::Message* reply_msg) {
+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(), EWK_DEFAULT_POLICY);
} else {
- EwkHostMsg_GetContentSecurityPolicy::WriteReplyParams(reply_msg,
- pending_content_security_policy_->policy, pending_content_security_policy_->header_type);
+ EwkHostMsg_GetContentSecurityPolicy::WriteReplyParams(
+ reply_msg, pending_content_security_policy_->policy,
+ pending_content_security_policy_->header_type);
pending_content_security_policy_.reset();
}
+#if !defined(EWK_BRINGUP) // FIXME: m67 bringup
+ // WebContentsObserver is IPC:: listener only cannot send
Send(reply_msg);
+#endif
}
-void WebContentsDelegateEfl::OnPrintedMetafileReceived(const DidPrintPagesParams& params) {
+void WebContentsDelegateEfl::OnPrintedMetafileReceived(
+ const DidPrintPagesParams& params) {
base::SharedMemory shared_buf(params.metafile_data_handle, true);
if (!shared_buf.Map(params.data_size)) {
- NOTREACHED() << "couldn't map";
- return;
+ NOTREACHED() << "couldn't map";
+ return;
}
- std::unique_ptr<printing::PdfMetafileSkia> metafile
- (new printing::PdfMetafileSkia(printing::PDF_SKIA_DOCUMENT_TYPE));
+ std::unique_ptr<printing::PdfMetafileSkia> metafile(
+ new printing::PdfMetafileSkia(printing::SkiaDocumentType::PDF));
if (!metafile->InitFromData(shared_buf.memory(), params.data_size)) {
NOTREACHED() << "Invalid metafile header";
return;
}
- BrowserThread::PostTask(BrowserThread::FILE, FROM_HERE,
- base::Bind(&WritePdfDataToFile, metafile.release(), params.filename));
+ BrowserThread::PostTask(
+ BrowserThread::FILE, FROM_HERE,
+ base::Bind(&WritePdfDataToFile, metafile.release(), params.filename));
}
-void WebContentsDelegateEfl::NavigationEntryCommitted(const LoadCommittedDetails& load_details) {
+void WebContentsDelegateEfl::NavigationEntryCommitted(
+ const LoadCommittedDetails& load_details) {
web_view_->InvokeBackForwardListChangedCallback();
}
-void WebContentsDelegateEfl::RenderViewCreated(RenderViewHost* render_view_host) {
+void WebContentsDelegateEfl::RenderViewCreated(
+ RenderViewHost* render_view_host) {
web_view_->RenderViewCreated(render_view_host);
}
void WebContentsDelegateEfl::RenderProcessGone(base::TerminationStatus status) {
// See RenderWidgetHostViewEfl::RenderProcessGone.
- if (status == base::TERMINATION_STATUS_ABNORMAL_TERMINATION
- || status == base::TERMINATION_STATUS_PROCESS_WAS_KILLED
- || status == base::TERMINATION_STATUS_PROCESS_CRASHED) {
+ if (status == base::TERMINATION_STATUS_ABNORMAL_TERMINATION ||
+ status == base::TERMINATION_STATUS_PROCESS_WAS_KILLED ||
+ status == base::TERMINATION_STATUS_PROCESS_CRASHED) {
web_view_->HandleRendererProcessCrash();
}
}
-bool WebContentsDelegateEfl::AddMessageToConsole(WebContents* source,
- int32_t level,
- const string16& message,
- int32_t line_no,
- const string16& source_id) {
- std::unique_ptr<_Ewk_Console_Message> console_message(new _Ewk_Console_Message(level,
- UTF16ToUTF8(message).c_str(),
- line_no,
- UTF16ToUTF8(source_id).c_str()));
- web_view_->SmartCallback<EWebViewCallbacks::ConsoleMessage>().call(console_message.get());
+bool WebContentsDelegateEfl::DidAddMessageToConsole(WebContents* source,
+ int32_t level,
+ const string16& message,
+ int32_t line_no,
+ const string16& source_id) {
+ std::unique_ptr<_Ewk_Console_Message> console_message(
+ new _Ewk_Console_Message(level, base::UTF16ToUTF8(message).c_str(), line_no,
+ base::UTF16ToUTF8(source_id).c_str()));
+ web_view_->SmartCallback<EWebViewCallbacks::ConsoleMessage>().call(
+ console_message.get());
return true;
}
-void WebContentsDelegateEfl::RunFileChooser(RenderFrameHost* render_frame_host, const FileChooserParams& params) {
+void WebContentsDelegateEfl::RunFileChooser(RenderFrameHost* render_frame_host,
+ const FileChooserParams& params) {
web_view_->ShowFileChooser(render_frame_host, params);
}
SkColor color,
const std::vector<ColorSuggestion>& suggestions) {
ColorChooserEfl* color_chooser_efl = new ColorChooserEfl(*web_contents);
- web_view_->RequestColorPicker(SkColorGetR(color), SkColorGetG(color), SkColorGetB(color), SkColorGetA(color));
+ web_view_->RequestColorPicker(SkColorGetR(color), SkColorGetG(color),
+ SkColorGetB(color), SkColorGetA(color));
return color_chooser_efl;
}
bool WebContentsDelegateEfl::PreHandleGestureEvent(
WebContents* source,
const blink::WebGestureEvent& event) {
- switch (event.type) {
- case blink::WebInputEvent::GestureDoubleTap:
+ blink::WebInputEvent::Type event_type = event.GetType();
+ switch (event_type) {
+ case blink::WebInputEvent::kGestureDoubleTap:
if (is_fullscreen_)
return true;
break;
- case blink::WebInputEvent::GesturePinchBegin:
- case blink::WebInputEvent::GesturePinchUpdate:
- case blink::WebInputEvent::GesturePinchEnd:
+ case blink::WebInputEvent::kGesturePinchBegin:
+ case blink::WebInputEvent::kGesturePinchUpdate:
+ case blink::WebInputEvent::kGesturePinchEnd:
if (!IsPinchToZoomEnabled() ||
IsFullscreenForTabOrPending(&web_contents()))
return true;
web_view_->GetBackForwardList()->UpdateItemWithEntry(entry);
}
-} //namespace content
+} // namespace content
namespace content {
struct DateTimeSuggestion;
-class WebContentsDelegateEfl
- : public WebContentsDelegate,
- public WebContentsObserver {
+class WebContentsDelegateEfl : public WebContentsDelegate,
+ public WebContentsObserver {
public:
WebContentsDelegateEfl(EWebView*);
~WebContentsDelegateEfl();
- virtual WebContents* OpenURLFromTab(WebContents* source,
+ // Overridden from content::WebContentsDelegate:
+ content::WebContents* OpenURLFromTab(
+ content::WebContents* source,
const content::OpenURLParams& params) override;
- virtual void NavigationStateChanged(WebContents* source,
- InvalidateTypes changed_flags) override;
-
- virtual void LoadProgressChanged(WebContents* source, double progress) override;
- virtual void LoadingStateChanged(WebContents* source,
- bool to_different_document) override;
-
- virtual bool ShouldCreateWebContents(
- WebContents*,
- int route_id,
- int main_frame_route_id,
- int main_frame_widget_route_id,
- WindowContainerType,
+ void NavigationStateChanged(content::WebContents* source,
+ content::InvalidateTypes changed_flags) override;
+ void LoadingStateChanged(content::WebContents* source,
+ bool to_different_document) override;
+ bool ShouldCreateWebContents(
+ content::WebContents* web_contents,
+ content::RenderFrameHost* opener,
+ content::SiteInstance* source_site_instance,
+ int32_t route_id,
+ int32_t main_frame_route_id,
+ int32_t main_frame_widget_route_id,
+ content::mojom::WindowContainerType window_container_type,
+ const GURL& opener_url,
const std::string& frame_name,
const GURL& target_url,
const std::string& partition_id,
- SessionStorageNamespace* session_storage_namespace) override;
-
- virtual void CloseContents(WebContents* source) override;
-
+ content::SessionStorageNamespace* session_storage_namespace) override;
+ void CloseContents(content::WebContents* source) override;
void EnterFullscreenModeForTab(content::WebContents* web_contents,
const GURL& origin) override;
void ExitFullscreenModeForTab(content::WebContents* web_contents) override;
+ bool IsFullscreenForTabOrPending(
+ const content::WebContents* web_contents) const override;
- virtual bool IsFullscreenForTabOrPending(
- const WebContents* web_contents) const override;
#if defined(TIZEN_MULTIMEDIA_SUPPORT)
virtual bool CheckMediaAccessPermission(WebContents* web_contents,
const GURL& security_origin,
const MediaResponseCallback& callback) override;
void RequestMediaAccessAllow(const MediaStreamRequest& request,
- const MediaResponseCallback& callback);
+ const MediaResponseCallback& callback);
void RequestMediaAccessDeny(const MediaStreamRequest& request,
- const MediaResponseCallback& callback);
+ const MediaResponseCallback& callback);
#endif
- void RegisterProtocolHandler(WebContents* web_contents,
+ void RegisterProtocolHandler(content::WebContents* web_contents,
const std::string& protocol,
const GURL& url,
bool user_gesture) override;
-
- void UnregisterProtocolHandler(WebContents* web_contents,
+ void UnregisterProtocolHandler(content::WebContents* web_contents,
const std::string& protocol,
const GURL& url,
bool user_gesture) override;
-
- void FindReply(WebContents* web_contents,
+ void FindReply(content::WebContents* web_contents,
int request_id,
int number_of_matches,
const gfx::Rect& selection_rect,
int active_match_ordinal,
bool final_update) override;
- void RequestCertificateConfirm(WebContents* web_contents, int cert_error,
- const net::SSLInfo& ssl_info, const GURL& url, ResourceType resource_type,
+ void RequestCertificateConfirm(
+ WebContents* web_contents,
+ int cert_error,
+ const net::SSLInfo& ssl_info,
+ const GURL& url,
+ ResourceType resource_type,
bool overridable,
bool strict_enforcement,
- const base::Callback<void(bool)>& callback,
- CertificateRequestResultType* result);
-
- EWebView* web_view() const { return web_view_; }
- WebContents& web_contents() const { return web_contents_; }
-
- virtual void DidStartProvisionalLoadForFrame(RenderFrameHost* render_frame_host,
- const GURL& validated_url,
- bool is_error_page,
- bool is_iframe_srcdoc) override;
+ base::Callback<void(CertificateRequestResultType)>& callback);
- virtual void DidCommitProvisionalLoadForFrame(RenderFrameHost* render_frame_host,
- const GURL& url,
- ui::PageTransition transition_type) override;
+ JavaScriptDialogManager* GetJavaScriptDialogManager(
+ WebContents* source) override;
- virtual void DidNavigateMainFrame(const LoadCommittedDetails& details,
- const FrameNavigateParams& params) override;
- virtual void DocumentOnLoadCompletedInMainFrame() override;
-
- virtual void DidNavigateAnyFrame(RenderFrameHost* render_frame_host,
- const LoadCommittedDetails& details,
- const FrameNavigateParams& params) override;
-
- void OnAuthRequired(net::URLRequest* request,
- const std::string& realm,
- LoginDelegateEfl* login_delegate);
-
- virtual void DidFinishLoad(RenderFrameHost* render_frame_host,
- const GURL& validated_url) override;
-
- virtual void DidUpdateFaviconURL(const std::vector<FaviconURL>& candidates) override;
- virtual void DidDownloadFavicon(bool success, const GURL& icon_url, const SkBitmap& bitmap);
-
- void OnUpdateSettings(const Ewk_Settings *settings);
- void SetContentSecurityPolicy(const std::string& policy, Ewk_CSP_Header_Type header_type);
-
- JavaScriptDialogManager* GetJavaScriptDialogManager(WebContents* source) override;
+ void OnUpdateSettings(const Ewk_Settings* settings);
+ void SetContentSecurityPolicy(const std::string& policy,
+ Ewk_CSP_Header_Type header_type);
void DidFirstVisuallyNonEmptyPaint() override;
bool OnMessageReceived(const IPC::Message& message) override;
void OnPrintedMetafileReceived(const DidPrintPagesParams& params);
- void NavigationEntryCommitted(const LoadCommittedDetails& load_details) override;
+ void NavigationEntryCommitted(
+ const LoadCommittedDetails& load_details) override;
void RenderViewCreated(RenderViewHost* render_view_host) override;
void RenderProcessGone(base::TerminationStatus status) override;
- bool AddMessageToConsole(WebContents* source,
- int32_t level,
- const base::string16& message,
- int32_t line_no,
- const base::string16& source_id) override;
+ bool DidAddMessageToConsole(WebContents* source,
+ int32_t level,
+ const base::string16& message,
+ int32_t line_no,
+ const base::string16& source_id) override;
void RunFileChooser(content::RenderFrameHost* render_frame_host,
const FileChooserParams& params) override;
- ColorChooser* OpenColorChooser(WebContents* web_contents, SkColor color,
+ ColorChooser* OpenColorChooser(
+ WebContents* web_contents,
+ SkColor color,
const std::vector<ColorSuggestion>& suggestions) override;
- void OpenDateTimeDialog(ui::TextInputType dialog_type,
+ void OpenDateTimeDialog(
+ ui::TextInputType dialog_type,
double dialog_value,
double min,
double max,
bool PreHandleGestureEvent(WebContents* source,
const blink::WebGestureEvent& event) override;
- void TitleWasSet(content::NavigationEntry* entry,
- bool explicit_set) override;
-
-
// WebContentsObserver---------------------------------------------------
-
- void DidFailProvisionalLoad(
- RenderFrameHost* render_frame_host,
- const GURL& validated_url,
- int error_code,
- const base::string16& error_description,
- bool was_ignored_by_handler) override;
-
void DidFailLoad(RenderFrameHost* render_frame_host,
const GURL& validated_url,
int error_code,
- const base::string16& error_description,
- bool was_ignored_by_handler) override;
+ const base::string16& error_description) override;
+
+ // EWK_BRINGUP: These APIs are removed in upstream.
+ void TitleWasSet(content::NavigationEntry* entry, bool explicit_set);
+
+ void LoadProgressChanged(WebContents* source, double progress);
+ void DidFinishLoad(RenderFrameHost* render_frame_host,
+ const GURL& validated_url);
+
+ void DidStartProvisionalLoadForFrame(RenderFrameHost* render_frame_host,
+ const GURL& validated_url,
+ bool is_error_page,
+ bool is_iframe_srcdoc);
+
+ void DidUpdateFaviconURL(const std::vector<FaviconURL>& candidates);
+
+ void DidCommitProvisionalLoadForFrame(RenderFrameHost* render_frame_host,
+ const GURL& url,
+ ui::PageTransition transition_type);
+
+ void DidNavigateMainFrame(const LoadCommittedDetails& details,
+ const FrameNavigateParams& params);
+ void DocumentOnLoadCompletedInMainFrame();
+
+ void DidNavigateAnyFrame(RenderFrameHost* render_frame_host,
+ const LoadCommittedDetails& details,
+ const FrameNavigateParams& params);
+
+ void DidFailProvisionalLoad(RenderFrameHost* render_frame_host,
+ const GURL& validated_url,
+ int error_code,
+ const base::string16& error_description,
+ bool was_ignored_by_handler);
+ // EWK_BRINGUP end.
+
+ void OnAuthRequired(net::URLRequest* request,
+ const std::string& realm,
+ LoginDelegateEfl* login_delegate);
+
+ void DidDownloadFavicon(bool success,
+ const GURL& icon_url,
+ const SkBitmap& bitmap);
+
+ EWebView* web_view() const { return web_view_; }
+ WebContents& web_contents() const { return web_contents_; }
private:
void OnGetContentSecurityPolicy(IPC::Message* reply_msg);
struct ContentSecurityPolicy {
ContentSecurityPolicy(const std::string& p, Ewk_CSP_Header_Type type)
- : policy(p),
- header_type(type) {
- }
+ : policy(p), header_type(type) {}
std::string policy;
Ewk_CSP_Header_Type header_type;
};
JavaScriptDialogManagerEfl* dialog_manager_;
std::unique_ptr<FaviconDownloader> favicon_downloader_;
base::WeakPtrFactory<WebContentsDelegateEfl> weak_ptr_factory_;
- std::unique_ptr<_Ewk_Certificate_Policy_Decision> certificate_policy_decision_;
+ std::unique_ptr<_Ewk_Certificate_Policy_Decision>
+ certificate_policy_decision_;
DISALLOW_COPY_AND_ASSIGN(WebContentsDelegateEfl);
};
-
}
#endif
const bool is_file = net::FileURLToFilePath(request->url(), &file_path);
// Check file access permissions.
+ // FIXME: The third parameter of net::URLRequestErrorJob sould be absolute_path.
if (!network_delegate ||
- !network_delegate->CanAccessFile(*request, file_path)) {
+ !network_delegate->CanAccessFile(*request, file_path, file_path)) {
return new net::URLRequestErrorJob(request, network_delegate, net::ERR_ACCESS_DENIED);
}
return false;
}
} // namespace
-
-net::URLRequestJobFactory::ProtocolHandler*
-GetWrtFileProtocolHandler() {
- return
- new WrtFileProtocolHandler(BrowserThread::GetBlockingPool()->GetTaskRunnerWithShutdownBehavior(
- base::SequencedWorkerPool::SKIP_ON_SHUTDOWN));
-}
#include "net/url_request/url_request_job_factory.h"
-net::URLRequestJobFactory::ProtocolHandler* GetWrtFileProtocolHandler();
-
#endif // WRT_FILE_PROTOCOL_HANDLER
WrtWidgetHost* WrtWidgetHost::Get() {
// TODO(z.kostrzewa) LazyInstance is thread-safe but creating
// WrtWidgetHost is not - make it thread-safe.
+#if !defined(EWK_BRINGUP) // FIXME: m67 bringup
+ // FIXME: ‘New’ is not a member of ‘base::internal::ErrorMustSelectLazyOrDestructorAtExitForLazyInstance<std::unique_ptr<WrtWidgetHost> >’
if (!g_wrt_widget_host.Get().get())
g_wrt_widget_host.Get().reset(new WrtWidgetHost);
return g_wrt_widget_host.Get().get();
+#endif
}
WrtWidgetHost::WrtWidgetHost()
static void get_app_cache_usage_cb(int64_t usage, void* user_data)
{
- static int count_usage_callback = 0;
+ static unsigned int count_usage_callback = 0;
Ewk_Security_Origin* origin = (Ewk_Security_Origin*)user_data;
printf("AppCache usage for %s is %ld\n", ewk_security_origin_host_get(origin), (long int)usage);
ewk_context_application_cache_delete(ewk_context_default_get(), origin);
Eina_List* list_iterator = NULL;
void* data = NULL;
web_database_origins = origins;
- static int flag = 0;
+ static unsigned int flag = 0;
EINA_LIST_FOREACH(origins, list_iterator, data) {
Ewk_Security_Origin* origin = (Ewk_Security_Origin*)(data);
printf("Web Database origin : %s\n", ewk_security_origin_host_get(origin));
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include <app.h>
+#include <appfw/app.h>
#include <dlog.h>
#include <Ecore.h>
#include <Ecore_Evas.h>
void Browser::OnToolboxWindowDelRequest(void* data, Evas_Object*, void*) {
Browser* thiz = static_cast<Browser*>(data);
- WindowMap::iterator it = thiz->window_map_.begin();
while (!thiz->window_map_.empty())
thiz->window_map_.begin()->second.window->Close();
thiz->toolbox_window_ = NULL;
#include <unistd.h>
#include <vector>
#if defined(OS_TIZEN)
-#include <app.h>
+#include <appfw/app.h>
#endif // OS_TIZEN
#include "browser.h"
#include "base/logging.h"
#include "build/build_config.h"
+#include "third_party/skia/include/core/SkRegion.h"
#if defined(OS_ANDROID)
#include "base/android/scoped_java_ref.h"