[WRTjs] Refactor popup
[platform/framework/web/chromium-efl.git] / wrt / src / browser / wrt_inspectable_web_contents_view.cc
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.
4
5 #include "wrt/src/browser/wrt_inspectable_web_contents_view.h"
6
7 #include "electron/shell/browser/ui/inspectable_web_contents.h"
8 #include "wrt/src/browser/wrt_web_contents.h"
9
10 #if defined(TOOLKIT_VIEWS)
11 #include "ui/views/controls/webview/webview.h"
12 #endif
13
14 namespace wrt {
15
16 WRTInspectableWebContentsView::WRTInspectableWebContentsView(
17     electron::InspectableWebContents* inspectable_web_contents)
18     : InspectableWebContentsView(inspectable_web_contents) {
19   WRTWebContents::WebContentsCreated(inspectable_web_contents->GetWebContents());
20 }
21
22 WRTInspectableWebContentsView::~WRTInspectableWebContentsView() {
23   WRTWebContents::WebContentsDeleted(inspectable_web_contents_->GetWebContents());
24 }
25
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;
32 }
33 #else
34 gfx::NativeView WRTInspectableWebContentsView::GetNativeView() const {
35   return inspectable_web_contents_->GetWebContents()->GetNativeView();
36 }
37 #endif
38
39 void WRTInspectableWebContentsView::ShowDevTools(bool activate) {
40   NOTIMPLEMENTED();
41 }
42
43 void WRTInspectableWebContentsView::CloseDevTools() {
44   NOTIMPLEMENTED();
45 }
46
47 bool WRTInspectableWebContentsView::IsDevToolsViewShowing() {
48   NOTIMPLEMENTED();
49   return false;
50 }
51
52 bool WRTInspectableWebContentsView::IsDevToolsViewFocused() {
53   NOTIMPLEMENTED();
54   return false;
55 }
56
57 void WRTInspectableWebContentsView::SetIsDocked(bool docked, bool activate) {
58   NOTIMPLEMENTED();
59 }
60
61 void WRTInspectableWebContentsView::SetContentsResizingStrategy(
62     const DevToolsContentsResizingStrategy& strategy) {
63   NOTIMPLEMENTED();
64 }
65
66 void WRTInspectableWebContentsView::SetTitle(const std::u16string& title) {
67   NOTIMPLEMENTED();
68 }
69
70 const std::u16string WRTInspectableWebContentsView::GetTitle() {
71   NOTIMPLEMENTED();
72   return std::u16string();
73 }
74
75 }  // namespace wrt
76
77 namespace electron {
78
79 InspectableWebContentsView* CreateInspectableContentsView(
80     InspectableWebContents* inspectable_web_contents) {
81   return new wrt::WRTInspectableWebContentsView(inspectable_web_contents);
82 }
83
84 }  // namespace electron