Stub out InspectableWebContentsViewWin
This class doesn't implement any devtools behavior yet. Right now it's just a glorified wrapper around a content::WebContents. But it's enough to show web content on screen on Windows!
This commit is contained in:
parent
b970e9d5c3
commit
cf14f09228
4 changed files with 69 additions and 2 deletions
|
@ -50,6 +50,8 @@
|
|||
'browser/notification_presenter_mac.mm',
|
||||
'browser/url_request_context_getter.cc',
|
||||
'browser/url_request_context_getter.h',
|
||||
'browser/win/inspectable_web_contents_view_win.cc',
|
||||
'browser/win/inspectable_web_contents_view_win.h',
|
||||
'common/application_info.h',
|
||||
'common/application_info_mac.mm',
|
||||
'common/application_info_win.cc',
|
||||
|
|
|
@ -41,9 +41,7 @@ InspectableWebContentsImpl::InspectableWebContentsImpl(content::WebContents* web
|
|||
auto context = static_cast<BrowserContext*>(web_contents_->GetBrowserContext());
|
||||
dock_side_ = context->prefs()->GetString(kDockSidePref);
|
||||
|
||||
#if defined(OS_MACOSX)
|
||||
view_.reset(CreateInspectableContentsView(this));
|
||||
#endif
|
||||
}
|
||||
|
||||
InspectableWebContentsImpl::~InspectableWebContentsImpl() {
|
||||
|
|
34
brightray/browser/win/inspectable_web_contents_view_win.cc
Normal file
34
brightray/browser/win/inspectable_web_contents_view_win.cc
Normal file
|
@ -0,0 +1,34 @@
|
|||
#include "browser/win/inspectable_web_contents_view_win.h"
|
||||
|
||||
#include "browser/inspectable_web_contents_impl.h"
|
||||
|
||||
#include "content/public/browser/web_contents_view.h"
|
||||
|
||||
namespace brightray {
|
||||
|
||||
InspectableWebContentsView* CreateInspectableContentsView(InspectableWebContentsImpl* inspectable_web_contents) {
|
||||
return new InspectableWebContentsViewWin(inspectable_web_contents);
|
||||
}
|
||||
|
||||
InspectableWebContentsViewWin::InspectableWebContentsViewWin(InspectableWebContentsImpl* inspectable_web_contents)
|
||||
: inspectable_web_contents_(inspectable_web_contents) {
|
||||
}
|
||||
|
||||
InspectableWebContentsViewWin::~InspectableWebContentsViewWin() {
|
||||
}
|
||||
|
||||
gfx::NativeView InspectableWebContentsViewWin::GetNativeView() const {
|
||||
return inspectable_web_contents_->GetWebContents()->GetView()->GetNativeView();
|
||||
}
|
||||
|
||||
void InspectableWebContentsViewWin::ShowDevTools() {
|
||||
}
|
||||
|
||||
void InspectableWebContentsViewWin::CloseDevTools() {
|
||||
}
|
||||
|
||||
bool InspectableWebContentsViewWin::SetDockSide(const std::string& side) {
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
33
brightray/browser/win/inspectable_web_contents_view_win.h
Normal file
33
brightray/browser/win/inspectable_web_contents_view_win.h
Normal file
|
@ -0,0 +1,33 @@
|
|||
#ifndef BRIGHTRAY_BROWSER_WIN_INSPECTABLE_WEB_CONTENTS_VIEW_WIN_H_
|
||||
#define BRIGHTRAY_BROWSER_WIN_INSPECTABLE_WEB_CONTENTS_VIEW_WIN_H_
|
||||
|
||||
#include "browser/inspectable_web_contents_view.h"
|
||||
|
||||
#include "base/compiler_specific.h"
|
||||
|
||||
namespace brightray {
|
||||
|
||||
class InspectableWebContentsImpl;
|
||||
|
||||
class InspectableWebContentsViewWin : public InspectableWebContentsView {
|
||||
public:
|
||||
InspectableWebContentsViewWin(InspectableWebContentsImpl*);
|
||||
~InspectableWebContentsViewWin();
|
||||
|
||||
virtual gfx::NativeView GetNativeView() const OVERRIDE;
|
||||
virtual void ShowDevTools() OVERRIDE;
|
||||
virtual void CloseDevTools() OVERRIDE;
|
||||
virtual bool SetDockSide(const std::string& side) OVERRIDE;
|
||||
|
||||
InspectableWebContentsImpl* inspectable_web_contents() { return inspectable_web_contents_; }
|
||||
|
||||
private:
|
||||
// Owns us.
|
||||
InspectableWebContentsImpl* inspectable_web_contents_;
|
||||
|
||||
DISALLOW_COPY_AND_ASSIGN(InspectableWebContentsViewWin);
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif
|
Loading…
Reference in a new issue