1 // Copyright 2015 Samsung Electronics Co, Ltd. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include "runtime/web_view.h"
7 #include <ewk_chromium.h>
11 #include "runtime/native_window.h"
12 #include "runtime/web_view_impl.h"
16 WebView::WebView(wrt::NativeWindow* window, Ewk_Context* context)
17 : impl_(new WebViewImpl(this, window, context)) {
24 void WebView::LoadUrl(const std::string& url) {
28 std::string WebView::GetUrl() {
29 return impl_->GetUrl();
32 void WebView::Suspend() {
36 void WebView::Resume() {
40 void WebView::Reload() {
44 void WebView::SetVisibility(bool show) {
45 impl_->SetVisibility(show);
48 bool WebView::EvalJavascript(const std::string& script) {
49 return impl_->EvalJavascript(script);
52 void WebView::SetEventListener(EventListener* listener) {
53 impl_->SetEventListener(listener);
56 Evas_Object* WebView::evas_object() const {
57 return impl_->evas_object();
60 void WebView::SetAppInfo(const std::string& app_name,
61 const std::string& version) {
62 impl_->SetAppInfo(app_name, version);
65 bool WebView::SetUserAgent(const std::string& user_agent) {
66 return impl_->SetUserAgent(user_agent.c_str());