1 // Copyright 2019 Samsung Electronics. 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 "wrt/src/browser/wrt_inspectable_web_contents_view.h"
7 #include "electron/shell/browser/ui/inspectable_web_contents.h"
8 #include "wrt/src/browser/wrt_web_contents.h"
10 #if defined(TOOLKIT_VIEWS)
11 #include "ui/views/controls/webview/webview.h"
16 WRTInspectableWebContentsView::WRTInspectableWebContentsView(
17 electron::InspectableWebContents* inspectable_web_contents)
18 : InspectableWebContentsView(inspectable_web_contents) {
19 WRTWebContents::WebContentsCreated(inspectable_web_contents->GetWebContents());
22 WRTInspectableWebContentsView::~WRTInspectableWebContentsView() {
23 WRTWebContents::WebContentsDeleted(inspectable_web_contents_->GetWebContents());
26 #if defined(TOOLKIT_VIEWS)
27 views::View* WRTInspectableWebContentsView::GetView() {
28 auto* contents_web_view = new views::WebView(nullptr);
29 contents_web_view->SetWebContents(
30 inspectable_web_contents_->GetWebContents());
31 return contents_web_view;
34 gfx::NativeView WRTInspectableWebContentsView::GetNativeView() const {
35 return inspectable_web_contents_->GetWebContents()->GetNativeView();
39 void WRTInspectableWebContentsView::ShowDevTools(bool activate) {
43 void WRTInspectableWebContentsView::CloseDevTools() {
47 bool WRTInspectableWebContentsView::IsDevToolsViewShowing() {
52 bool WRTInspectableWebContentsView::IsDevToolsViewFocused() {
57 void WRTInspectableWebContentsView::SetIsDocked(bool docked, bool activate) {
61 void WRTInspectableWebContentsView::SetContentsResizingStrategy(
62 const DevToolsContentsResizingStrategy& strategy) {
66 void WRTInspectableWebContentsView::SetTitle(const std::u16string& title) {
70 const std::u16string WRTInspectableWebContentsView::GetTitle() {
72 return std::u16string();
79 InspectableWebContentsView* CreateInspectableContentsView(
80 InspectableWebContents* inspectable_web_contents) {
81 return new wrt::WRTInspectableWebContentsView(inspectable_web_contents);
84 } // namespace electron