2018-10-19 13:50:30 +00:00
|
|
|
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
|
|
|
|
// Copyright (c) 2013 Adam Roben <adam@roben.org>. All rights reserved.
|
|
|
|
// Use of this source code is governed by a BSD-style license that can be
|
|
|
|
// found in the LICENSE-CHROMIUM file.
|
|
|
|
|
2019-06-19 20:56:58 +00:00
|
|
|
#ifndef SHELL_BROWSER_UI_INSPECTABLE_WEB_CONTENTS_H_
|
|
|
|
#define SHELL_BROWSER_UI_INSPECTABLE_WEB_CONTENTS_H_
|
2013-03-14 13:03:50 +00:00
|
|
|
|
2017-05-18 22:06:57 +00:00
|
|
|
#include <string>
|
|
|
|
|
2013-03-14 13:03:50 +00:00
|
|
|
#include "content/public/browser/web_contents.h"
|
|
|
|
|
2015-06-05 04:24:48 +00:00
|
|
|
namespace base {
|
|
|
|
class Value;
|
|
|
|
}
|
|
|
|
|
2015-05-18 13:56:03 +00:00
|
|
|
namespace content {
|
|
|
|
class DevToolsAgentHost;
|
|
|
|
}
|
|
|
|
|
2018-10-04 18:08:56 +00:00
|
|
|
class PrefService;
|
|
|
|
|
2019-06-19 21:23:04 +00:00
|
|
|
namespace electron {
|
2013-03-14 13:03:50 +00:00
|
|
|
|
2014-03-04 08:12:02 +00:00
|
|
|
class InspectableWebContentsDelegate;
|
2013-03-14 13:03:50 +00:00
|
|
|
class InspectableWebContentsView;
|
|
|
|
|
2019-06-13 06:42:21 +00:00
|
|
|
// TODO(zcbenz): Remove this abstract wrapper and rename
|
|
|
|
// InspectableWebContentsImpl to InspectableWebContents instead.
|
2013-03-14 13:03:50 +00:00
|
|
|
class InspectableWebContents {
|
2013-11-17 23:20:54 +00:00
|
|
|
public:
|
|
|
|
// The returned InspectableWebContents takes ownership of the passed-in
|
|
|
|
// WebContents.
|
2018-08-16 22:57:40 +00:00
|
|
|
static InspectableWebContents* Create(content::WebContents* web_contents,
|
2018-10-04 18:08:56 +00:00
|
|
|
PrefService* pref_service,
|
2018-08-16 22:57:40 +00:00
|
|
|
bool is_guest);
|
2013-04-22 12:41:58 +00:00
|
|
|
|
2013-03-14 13:03:50 +00:00
|
|
|
virtual ~InspectableWebContents() {}
|
|
|
|
|
|
|
|
virtual InspectableWebContentsView* GetView() const = 0;
|
|
|
|
virtual content::WebContents* GetWebContents() const = 0;
|
2015-06-05 06:33:37 +00:00
|
|
|
virtual content::WebContents* GetDevToolsWebContents() const = 0;
|
2013-03-14 13:03:50 +00:00
|
|
|
|
2015-06-05 04:24:48 +00:00
|
|
|
// The delegate manages its own life.
|
|
|
|
virtual void SetDelegate(InspectableWebContentsDelegate* delegate) = 0;
|
|
|
|
virtual InspectableWebContentsDelegate* GetDelegate() const = 0;
|
|
|
|
|
2018-08-16 22:57:40 +00:00
|
|
|
virtual bool IsGuest() const = 0;
|
|
|
|
virtual void ReleaseWebContents() = 0;
|
2017-11-30 07:37:26 +00:00
|
|
|
virtual void SetDevToolsWebContents(content::WebContents* devtools) = 0;
|
2016-04-19 12:43:08 +00:00
|
|
|
virtual void SetDockState(const std::string& state) = 0;
|
2018-11-27 09:34:44 +00:00
|
|
|
virtual void ShowDevTools(bool activate) = 0;
|
2014-03-20 01:26:21 +00:00
|
|
|
virtual void CloseDevTools() = 0;
|
2013-12-09 12:34:44 +00:00
|
|
|
virtual bool IsDevToolsViewShowing() = 0;
|
2017-01-10 11:13:16 +00:00
|
|
|
virtual void AttachTo(scoped_refptr<content::DevToolsAgentHost>) = 0;
|
2015-06-05 04:24:48 +00:00
|
|
|
virtual void Detach() = 0;
|
|
|
|
virtual void CallClientFunction(const std::string& function_name,
|
2015-06-05 06:33:37 +00:00
|
|
|
const base::Value* arg1 = nullptr,
|
|
|
|
const base::Value* arg2 = nullptr,
|
|
|
|
const base::Value* arg3 = nullptr) = 0;
|
2017-01-13 08:52:45 +00:00
|
|
|
virtual void InspectElement(int x, int y) = 0;
|
2013-03-14 13:03:50 +00:00
|
|
|
};
|
|
|
|
|
2019-06-19 21:23:04 +00:00
|
|
|
} // namespace electron
|
2013-03-14 13:03:50 +00:00
|
|
|
|
2019-06-19 20:56:58 +00:00
|
|
|
#endif // SHELL_BROWSER_UI_INSPECTABLE_WEB_CONTENTS_H_
|