refactor: ginify autoUpdater (#24678)

This commit is contained in:
Jeremy Rose 2020-07-28 11:04:34 -07:00 committed by GitHub
parent e6cf5906f6
commit 38fafe4986
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 68 additions and 55 deletions

View file

@ -8,25 +8,30 @@
#include <string>
#include "gin/handle.h"
#include "gin/wrappable.h"
#include "shell/browser/auto_updater.h"
#include "shell/browser/event_emitter_mixin.h"
#include "shell/browser/window_list_observer.h"
#include "shell/common/gin_helper/event_emitter.h"
namespace electron {
namespace api {
class AutoUpdater : public gin_helper::EventEmitter<AutoUpdater>,
class AutoUpdater : public gin::Wrappable<AutoUpdater>,
public gin_helper::EventEmitterMixin<AutoUpdater>,
public auto_updater::Delegate,
public WindowListObserver {
public:
static gin::Handle<AutoUpdater> Create(v8::Isolate* isolate);
static void BuildPrototype(v8::Isolate* isolate,
v8::Local<v8::FunctionTemplate> prototype);
// gin::Wrappable
static gin::WrapperInfo kWrapperInfo;
gin::ObjectTemplateBuilder GetObjectTemplateBuilder(
v8::Isolate* isolate) override;
const char* GetTypeName() override;
protected:
explicit AutoUpdater(v8::Isolate* isolate);
AutoUpdater();
~AutoUpdater() override;
// Delegate implementations.
@ -47,7 +52,7 @@ class AutoUpdater : public gin_helper::EventEmitter<AutoUpdater>,
private:
std::string GetFeedURL();
void SetFeedURL(gin_helper::Arguments* args);
void SetFeedURL(gin::Arguments* args);
void QuitAndInstall();
DISALLOW_COPY_AND_ASSIGN(AutoUpdater);