Organize code
This commit is contained in:
parent
0d4c6e327f
commit
29f9929703
3 changed files with 25 additions and 24 deletions
|
@ -105,22 +105,22 @@ bool Notification::GetSilent() const {
|
||||||
return silent_;
|
return silent_;
|
||||||
}
|
}
|
||||||
|
|
||||||
base::string16 Notification::GetReplyPlaceholder() const {
|
|
||||||
return reply_placeholder_;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool Notification::GetHasReply() const {
|
bool Notification::GetHasReply() const {
|
||||||
return has_reply_;
|
return has_reply_;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::vector<brightray::NotificationAction> Notification::GetActions() const {
|
base::string16 Notification::GetReplyPlaceholder() const {
|
||||||
return actions_;
|
return reply_placeholder_;
|
||||||
}
|
}
|
||||||
|
|
||||||
base::string16 Notification::GetSound() const {
|
base::string16 Notification::GetSound() const {
|
||||||
return sound_;
|
return sound_;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::vector<brightray::NotificationAction> Notification::GetActions() const {
|
||||||
|
return actions_;
|
||||||
|
}
|
||||||
|
|
||||||
base::string16 Notification::GetCloseButtonText() const {
|
base::string16 Notification::GetCloseButtonText() const {
|
||||||
return close_button_text_;
|
return close_button_text_;
|
||||||
}
|
}
|
||||||
|
@ -142,12 +142,16 @@ void Notification::SetSilent(bool new_silent) {
|
||||||
silent_ = new_silent;
|
silent_ = new_silent;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Notification::SetHasReply(bool new_has_reply) {
|
||||||
|
has_reply_ = new_has_reply;
|
||||||
|
}
|
||||||
|
|
||||||
void Notification::SetReplyPlaceholder(const base::string16& new_placeholder) {
|
void Notification::SetReplyPlaceholder(const base::string16& new_placeholder) {
|
||||||
reply_placeholder_ = new_placeholder;
|
reply_placeholder_ = new_placeholder;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Notification::SetHasReply(bool new_has_reply) {
|
void Notification::SetSound(const base::string16& new_sound) {
|
||||||
has_reply_ = new_has_reply;
|
sound_ = new_sound;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Notification::SetActions(
|
void Notification::SetActions(
|
||||||
|
@ -155,10 +159,6 @@ void Notification::SetActions(
|
||||||
actions_ = actions;
|
actions_ = actions;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Notification::SetSound(const base::string16& new_sound) {
|
|
||||||
sound_ = new_sound;
|
|
||||||
}
|
|
||||||
|
|
||||||
void Notification::SetCloseButtonText(const base::string16& text) {
|
void Notification::SetCloseButtonText(const base::string16& text) {
|
||||||
close_button_text_ = text;
|
close_button_text_ = text;
|
||||||
}
|
}
|
||||||
|
@ -232,15 +232,16 @@ void Notification::BuildPrototype(v8::Isolate* isolate,
|
||||||
.SetProperty("subtitle", &Notification::GetSubtitle,
|
.SetProperty("subtitle", &Notification::GetSubtitle,
|
||||||
&Notification::SetSubtitle)
|
&Notification::SetSubtitle)
|
||||||
.SetProperty("body", &Notification::GetBody, &Notification::SetBody)
|
.SetProperty("body", &Notification::GetBody, &Notification::SetBody)
|
||||||
.SetProperty("silent", &Notification::GetSilent, &Notification::SetSilent)
|
.SetProperty("silent", &Notification::GetSilent,
|
||||||
.SetProperty("replyPlaceholder", &Notification::GetReplyPlaceholder,
|
&Notification::SetSilent)
|
||||||
&Notification::SetReplyPlaceholder)
|
|
||||||
.SetProperty("hasReply", &Notification::GetHasReply,
|
.SetProperty("hasReply", &Notification::GetHasReply,
|
||||||
&Notification::SetHasReply)
|
&Notification::SetHasReply)
|
||||||
.SetProperty("actions", &Notification::GetActions,
|
.SetProperty("replyPlaceholder", &Notification::GetReplyPlaceholder,
|
||||||
&Notification::SetActions)
|
&Notification::SetReplyPlaceholder)
|
||||||
.SetProperty("sound", &Notification::GetSound,
|
.SetProperty("sound", &Notification::GetSound,
|
||||||
&Notification::SetSound)
|
&Notification::SetSound)
|
||||||
|
.SetProperty("actions", &Notification::GetActions,
|
||||||
|
&Notification::SetActions)
|
||||||
.SetProperty("closeButtonText", &Notification::GetCloseButtonText,
|
.SetProperty("closeButtonText", &Notification::GetCloseButtonText,
|
||||||
&Notification::SetCloseButtonText);
|
&Notification::SetCloseButtonText);
|
||||||
}
|
}
|
||||||
|
|
|
@ -52,10 +52,10 @@ class Notification : public mate::TrackableObject<Notification>,
|
||||||
base::string16 GetSubtitle() const;
|
base::string16 GetSubtitle() const;
|
||||||
base::string16 GetBody() const;
|
base::string16 GetBody() const;
|
||||||
bool GetSilent() const;
|
bool GetSilent() const;
|
||||||
base::string16 GetReplyPlaceholder() const;
|
|
||||||
bool GetHasReply() const;
|
bool GetHasReply() const;
|
||||||
std::vector<brightray::NotificationAction> GetActions() const;
|
base::string16 GetReplyPlaceholder() const;
|
||||||
base::string16 GetSound() const;
|
base::string16 GetSound() const;
|
||||||
|
std::vector<brightray::NotificationAction> GetActions() const;
|
||||||
base::string16 GetCloseButtonText() const;
|
base::string16 GetCloseButtonText() const;
|
||||||
|
|
||||||
// Prop Setters
|
// Prop Setters
|
||||||
|
@ -63,10 +63,10 @@ class Notification : public mate::TrackableObject<Notification>,
|
||||||
void SetSubtitle(const base::string16& new_subtitle);
|
void SetSubtitle(const base::string16& new_subtitle);
|
||||||
void SetBody(const base::string16& new_body);
|
void SetBody(const base::string16& new_body);
|
||||||
void SetSilent(bool new_silent);
|
void SetSilent(bool new_silent);
|
||||||
void SetReplyPlaceholder(const base::string16& new_reply_placeholder);
|
|
||||||
void SetHasReply(bool new_has_reply);
|
void SetHasReply(bool new_has_reply);
|
||||||
void SetActions(const std::vector<brightray::NotificationAction>& actions);
|
void SetReplyPlaceholder(const base::string16& new_reply_placeholder);
|
||||||
void SetSound(const base::string16& sound);
|
void SetSound(const base::string16& sound);
|
||||||
|
void SetActions(const std::vector<brightray::NotificationAction>& actions);
|
||||||
void SetCloseButtonText(const base::string16& text);
|
void SetCloseButtonText(const base::string16& text);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
@ -77,10 +77,10 @@ class Notification : public mate::TrackableObject<Notification>,
|
||||||
base::string16 icon_path_;
|
base::string16 icon_path_;
|
||||||
bool has_icon_ = false;
|
bool has_icon_ = false;
|
||||||
bool silent_ = false;
|
bool silent_ = false;
|
||||||
base::string16 reply_placeholder_;
|
|
||||||
bool has_reply_ = false;
|
bool has_reply_ = false;
|
||||||
std::vector<brightray::NotificationAction> actions_;
|
base::string16 reply_placeholder_;
|
||||||
base::string16 sound_;
|
base::string16 sound_;
|
||||||
|
std::vector<brightray::NotificationAction> actions_;
|
||||||
base::string16 close_button_text_;
|
base::string16 close_button_text_;
|
||||||
|
|
||||||
brightray::NotificationPresenter* presenter_;
|
brightray::NotificationPresenter* presenter_;
|
||||||
|
|
|
@ -28,9 +28,9 @@ struct NotificationOptions {
|
||||||
base::string16 subtitle;
|
base::string16 subtitle;
|
||||||
base::string16 msg;
|
base::string16 msg;
|
||||||
std::string tag;
|
std::string tag;
|
||||||
|
bool silent;
|
||||||
GURL icon_url;
|
GURL icon_url;
|
||||||
SkBitmap icon;
|
SkBitmap icon;
|
||||||
bool silent;
|
|
||||||
bool has_reply;
|
bool has_reply;
|
||||||
base::string16 reply_placeholder;
|
base::string16 reply_placeholder;
|
||||||
base::string16 sound;
|
base::string16 sound;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue