Implement chrome.windows.update(drawAttention=false).
Modified BrowserWindow FlashFrame to take a param to turn flashing on/off.
Prior, drawAttention=false was ignored.
BUG=104807
TEST=Manually tested with extension that uses new API.
Review URL: http://codereview.chromium.org/9112036
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@117738 0039d316-1c4b-4281-b951-d872f2087c98
diff --git a/chrome/browser/ui/cocoa/browser_window_cocoa.mm b/chrome/browser/ui/cocoa/browser_window_cocoa.mm
index c23cf56c..63d7a5df 100644
--- a/chrome/browser/ui/cocoa/browser_window_cocoa.mm
+++ b/chrome/browser/ui/cocoa/browser_window_cocoa.mm
@@ -76,7 +76,8 @@
BrowserWindowController* controller)
: browser_(browser),
controller_(controller),
- confirm_close_factory_(browser) {
+ confirm_close_factory_(browser),
+ attention_request_id_(0) {
pref_change_registrar_.Init(browser_->profile()->GetPrefs());
pref_change_registrar_.Add(prefs::kShowBookmarkBar, this);
@@ -178,8 +179,13 @@
NOTIMPLEMENTED();
}
-void BrowserWindowCocoa::FlashFrame() {
- [NSApp requestUserAttention:NSInformationalRequest];
+void BrowserWindowCocoa::FlashFrame(bool flash) {
+ if (flash) {
+ attention_request_id_ = [NSApp requestUserAttention:NSInformationalRequest];
+ } else {
+ [NSApp cancelUserAttentionRequest:attention_request_id_];
+ attention_request_id_ = 0;
+ }
}
bool BrowserWindowCocoa::IsActive() const {