2017-05-18 23:11:12 +00:00
|
|
|
#ifndef BRIGHTRAY_BROWSER_VIEWS_INSPECTABLE_WEB_CONTENTS_VIEW_VIEWS_H_
|
|
|
|
#define BRIGHTRAY_BROWSER_VIEWS_INSPECTABLE_WEB_CONTENTS_VIEW_VIEWS_H_
|
2013-11-07 20:02:35 +00:00
|
|
|
|
|
|
|
#include "base/compiler_specific.h"
|
2017-05-18 23:11:12 +00:00
|
|
|
#include "brightray/browser/devtools_contents_resizing_strategy.h"
|
|
|
|
#include "brightray/browser/inspectable_web_contents_view.h"
|
2014-07-04 08:25:59 +00:00
|
|
|
#include "ui/views/view.h"
|
|
|
|
|
|
|
|
namespace views {
|
|
|
|
class WebView;
|
|
|
|
class Widget;
|
2017-03-31 19:27:06 +00:00
|
|
|
class WidgetDelegate;
|
2018-04-18 01:46:27 +00:00
|
|
|
} // namespace views
|
2013-11-07 20:02:35 +00:00
|
|
|
|
|
|
|
namespace brightray {
|
|
|
|
|
|
|
|
class InspectableWebContentsImpl;
|
|
|
|
|
2014-07-04 08:25:59 +00:00
|
|
|
class InspectableWebContentsViewViews : public InspectableWebContentsView,
|
|
|
|
public views::View {
|
2013-11-17 23:52:02 +00:00
|
|
|
public:
|
2014-07-04 08:25:59 +00:00
|
|
|
explicit InspectableWebContentsViewViews(
|
2013-11-17 23:52:02 +00:00
|
|
|
InspectableWebContentsImpl* inspectable_web_contents_impl);
|
2018-04-17 23:03:51 +00:00
|
|
|
~InspectableWebContentsViewViews() override;
|
2013-11-07 20:02:35 +00:00
|
|
|
|
2014-07-04 08:25:59 +00:00
|
|
|
// InspectableWebContentsView:
|
2015-06-05 04:07:27 +00:00
|
|
|
views::View* GetView() override;
|
|
|
|
views::View* GetWebView() override;
|
|
|
|
void ShowDevTools() override;
|
|
|
|
void CloseDevTools() override;
|
|
|
|
bool IsDevToolsViewShowing() override;
|
2015-09-15 03:04:46 +00:00
|
|
|
bool IsDevToolsViewFocused() override;
|
2015-06-05 04:07:27 +00:00
|
|
|
void SetIsDocked(bool docked) override;
|
|
|
|
void SetContentsResizingStrategy(
|
2014-10-23 03:10:39 +00:00
|
|
|
const DevToolsContentsResizingStrategy& strategy) override;
|
2015-08-07 09:00:49 +00:00
|
|
|
void SetTitle(const base::string16& title) override;
|
2013-11-07 20:02:35 +00:00
|
|
|
|
2013-11-17 23:52:02 +00:00
|
|
|
InspectableWebContentsImpl* inspectable_web_contents() {
|
|
|
|
return inspectable_web_contents_;
|
|
|
|
}
|
2013-11-07 20:02:35 +00:00
|
|
|
|
2017-04-01 12:56:51 +00:00
|
|
|
const base::string16& GetTitle() const { return title_; }
|
|
|
|
|
2013-11-17 23:52:02 +00:00
|
|
|
private:
|
2014-07-04 08:25:59 +00:00
|
|
|
// views::View:
|
2015-06-05 04:07:27 +00:00
|
|
|
void Layout() override;
|
2014-07-04 08:25:59 +00:00
|
|
|
|
2013-11-16 04:22:25 +00:00
|
|
|
// Owns us.
|
|
|
|
InspectableWebContentsImpl* inspectable_web_contents_;
|
|
|
|
|
2016-05-23 01:59:07 +00:00
|
|
|
std::unique_ptr<views::Widget> devtools_window_;
|
2014-07-04 12:26:59 +00:00
|
|
|
views::WebView* devtools_window_web_view_;
|
2016-08-04 07:35:09 +00:00
|
|
|
views::View* contents_web_view_;
|
2014-07-04 08:25:59 +00:00
|
|
|
views::WebView* devtools_web_view_;
|
|
|
|
|
2014-07-02 12:59:51 +00:00
|
|
|
DevToolsContentsResizingStrategy strategy_;
|
2014-07-04 12:26:59 +00:00
|
|
|
bool devtools_visible_;
|
2017-03-31 19:27:06 +00:00
|
|
|
views::WidgetDelegate* devtools_window_delegate_;
|
2017-04-01 12:56:51 +00:00
|
|
|
base::string16 title_;
|
2013-11-16 04:22:25 +00:00
|
|
|
|
2014-07-04 08:25:59 +00:00
|
|
|
DISALLOW_COPY_AND_ASSIGN(InspectableWebContentsViewViews);
|
2013-11-07 20:02:35 +00:00
|
|
|
};
|
|
|
|
|
2013-11-17 23:20:17 +00:00
|
|
|
} // namespace brightray
|
2013-11-07 20:02:35 +00:00
|
|
|
|
2017-05-18 23:11:12 +00:00
|
|
|
#endif // BRIGHTRAY_BROWSER_VIEWS_INSPECTABLE_WEB_CONTENTS_VIEW_VIEWS_H_
|