electron/atom/browser/ui/inspectable_web_contents_view.h

63 lines
1.9 KiB
C
Raw Normal View History

// 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.
#ifndef ATOM_BROWSER_UI_INSPECTABLE_WEB_CONTENTS_VIEW_H_
#define ATOM_BROWSER_UI_INSPECTABLE_WEB_CONTENTS_VIEW_H_
#include "base/strings/string16.h"
#include "ui/gfx/native_widget_types.h"
class DevToolsContentsResizingStrategy;
#if defined(TOOLKIT_VIEWS)
namespace views {
class View;
}
#endif
namespace atom {
2015-06-25 04:29:34 +00:00
class InspectableWebContentsViewDelegate;
class InspectableWebContentsView {
public:
2015-06-25 04:29:34 +00:00
InspectableWebContentsView() : delegate_(nullptr) {}
virtual ~InspectableWebContentsView() {}
2015-06-25 04:29:34 +00:00
// The delegate manages its own life.
void SetDelegate(InspectableWebContentsViewDelegate* delegate) {
delegate_ = delegate;
}
2018-04-18 01:46:27 +00:00
InspectableWebContentsViewDelegate* GetDelegate() const { return delegate_; }
2015-06-25 04:29:34 +00:00
#if defined(TOOLKIT_VIEWS) && !defined(OS_MACOSX)
// Returns the container control, which has devtools view attached.
virtual views::View* GetView() = 0;
// Returns the web view control, which can be used by the
// GetInitiallyFocusedView() to set initial focus to web view.
virtual views::View* GetWebView() = 0;
#else
virtual gfx::NativeView GetNativeView() const = 0;
#endif
virtual void ShowDevTools() = 0;
// Hide the DevTools view.
2013-03-27 14:59:40 +00:00
virtual void CloseDevTools() = 0;
virtual bool IsDevToolsViewShowing() = 0;
2015-09-15 03:04:46 +00:00
virtual bool IsDevToolsViewFocused() = 0;
virtual void SetIsDocked(bool docked) = 0;
virtual void SetContentsResizingStrategy(
const DevToolsContentsResizingStrategy& strategy) = 0;
virtual void SetTitle(const base::string16& title) = 0;
2015-06-25 04:29:34 +00:00
private:
InspectableWebContentsViewDelegate* delegate_; // weak references.
};
} // namespace atom
#endif // ATOM_BROWSER_UI_INSPECTABLE_WEB_CONTENTS_VIEW_H_