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
|
|
|
|
2019-12-05 09:46:34 +00:00
|
|
|
#include "gin/handle.h"
|
2019-06-19 20:46:59 +00:00
|
|
|
#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
|
|
|
|
2019-06-19 21:23:04 +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:
|
2019-12-05 09:46:34 +00:00
|
|
|
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;
|
|
|
|
|
2018-10-23 14:57:13 +00:00
|
|
|
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
|
|
|
|
|
2019-06-19 21:23:04 +00:00
|
|
|
} // 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_
|