electron/shell/browser/api/views/atom_api_button.h

41 lines
1 KiB
C
Raw Normal View History

2018-05-24 07:56:02 +00:00
// Copyright (c) 2018 GitHub, Inc.
// Use of this source code is governed by the MIT license that can be
// found in the LICENSE file.
2019-06-19 20:56:58 +00:00
#ifndef SHELL_BROWSER_API_VIEWS_ATOM_API_BUTTON_H_
#define SHELL_BROWSER_API_VIEWS_ATOM_API_BUTTON_H_
2018-05-24 07:56:02 +00:00
#include "gin/handle.h"
#include "shell/browser/api/atom_api_view.h"
2018-05-24 08:11:08 +00:00
#include "ui/views/controls/button/button.h"
2018-05-24 07:56:02 +00:00
namespace electron {
2018-05-24 07:56:02 +00:00
namespace api {
2018-05-24 08:11:08 +00:00
class Button : public View, public views::ButtonListener {
2018-05-24 07:56:02 +00:00
public:
static gin_helper::WrappableBase* New(gin_helper::Arguments* args);
2018-05-24 07:56:02 +00:00
static void BuildPrototype(v8::Isolate* isolate,
v8::Local<v8::FunctionTemplate> prototype);
2018-05-24 08:11:08 +00:00
protected:
2018-05-24 07:56:02 +00:00
explicit Button(views::Button* view);
~Button() override;
2018-05-24 08:11:08 +00:00
// views::ButtonListener:
void ButtonPressed(views::Button* sender, const ui::Event& event) override;
views::Button* button() const { return static_cast<views::Button*>(view()); }
2018-05-24 07:56:02 +00:00
private:
DISALLOW_COPY_AND_ASSIGN(Button);
};
} // namespace api
} // namespace electron
2018-05-24 07:56:02 +00:00
2019-06-19 20:56:58 +00:00
#endif // SHELL_BROWSER_API_VIEWS_ATOM_API_BUTTON_H_