refactor: ginify Screen (#24677)

This commit is contained in:
Jeremy Rose 2020-07-28 11:04:01 -07:00 committed by GitHub
parent 362da77c0a
commit e6cf5906f6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 36 additions and 60 deletions

View file

@ -7,8 +7,9 @@
#include <vector>
#include "gin/wrappable.h"
#include "shell/browser/event_emitter_mixin.h"
#include "shell/common/gin_helper/error_thrower.h"
#include "shell/common/gin_helper/event_emitter.h"
#include "ui/display/display_observer.h"
#include "ui/display/screen.h"
@ -22,13 +23,16 @@ namespace electron {
namespace api {
class Screen : public gin_helper::EventEmitter<Screen>,
class Screen : public gin::Wrappable<Screen>,
public gin_helper::EventEmitterMixin<Screen>,
public display::DisplayObserver {
public:
static v8::Local<v8::Value> Create(gin_helper::ErrorThrower error_thrower);
static void BuildPrototype(v8::Isolate* isolate,
v8::Local<v8::FunctionTemplate> prototype);
static gin::WrapperInfo kWrapperInfo;
gin::ObjectTemplateBuilder GetObjectTemplateBuilder(
v8::Isolate* isolate) override;
const char* GetTypeName() override;
protected:
Screen(v8::Isolate* isolate, display::Screen* screen);