2 * Copyright (c) 2015 Samsung Electronics Co., Ltd All Rights Reserved
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
18 #include "runtime/web_view.h"
20 #include <ewk_chromium.h>
24 #include "runtime/native_window.h"
25 #include "runtime/web_view_impl.h"
29 WebView::WebView(wrt::NativeWindow* window, Ewk_Context* context)
30 : impl_(new WebViewImpl(this, window, context)) {
37 void WebView::LoadUrl(const std::string& url) {
41 std::string WebView::GetUrl() {
42 return impl_->GetUrl();
45 void WebView::Suspend() {
49 void WebView::Resume() {
53 void WebView::Reload() {
57 void WebView::SetVisibility(bool show) {
58 impl_->SetVisibility(show);
61 bool WebView::EvalJavascript(const std::string& script) {
62 return impl_->EvalJavascript(script);
65 void WebView::SetEventListener(EventListener* listener) {
66 impl_->SetEventListener(listener);
69 Evas_Object* WebView::evas_object() const {
70 return impl_->evas_object();
73 void WebView::SetAppInfo(const std::string& app_name,
74 const std::string& version) {
75 impl_->SetAppInfo(app_name, version);
78 bool WebView::SetUserAgent(const std::string& user_agent) {
79 return impl_->SetUserAgent(user_agent.c_str());