Permalink
Browse files

[API] Add Window.requestAttention.

  • Loading branch information...
1 parent ee02052 commit dcea43f47b5d517841384b8450fb1c024fbd8992 @zcbenz zcbenz committed Oct 14, 2012
Showing with 9 additions and 0 deletions.
  1. +4 −0 src/api/window/window.cc
  2. +5 −0 src/api/window/window.js
View
@@ -79,6 +79,10 @@ void Window::Call(const std::string& method,
bool resizable;
if (arguments.GetBoolean(0, &resizable))
shell_->window()->SetResizable(resizable);
+ } else if (method == "RequestAttention") {
+ bool flash;
+ if (arguments.GetBoolean(0, &flash))
+ shell_->window()->FlashFrame(flash);
} else {
NOTREACHED() << "Invalid call to Clipboard method:" << method
<< " arguments:" << arguments;
View
@@ -146,6 +146,11 @@ Window.prototype.setResizable = function(resizable) {
nw.callObjectMethod(this, 'SetResizable', [ resizable ]);
}
+Window.prototype.requestAttention = function(flash) {
+ flash = Boolean(flash);
+ nw.callObjectMethod(this, 'RequestAttention', [ flash ]);
+}
+
Window.prototype.setPosition = function(position) {
if (position != 'center' && position != 'mouse')
throw new String('Invalid postion');

0 comments on commit dcea43f

Please sign in to comment.