diff options
Diffstat (limited to 'ceee/ie/broker/infobar_api_module.cc')
-rw-r--r-- | ceee/ie/broker/infobar_api_module.cc | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/ceee/ie/broker/infobar_api_module.cc b/ceee/ie/broker/infobar_api_module.cc index f857b4a..ca7a46f 100644 --- a/ceee/ie/broker/infobar_api_module.cc +++ b/ceee/ie/broker/infobar_api_module.cc @@ -74,13 +74,18 @@ void ShowInfoBar::Execute(const ListValue& args, int request_id) { return; } - // Store the window information returned by ShowInfobar(). - result->CreateWindowValue(dispatcher->GetWindowHandleFromId(window_handle), - false); - - // Now wait until the document is complete before responding. - dispatcher->RegisterEphemeralEventHandler(kOnDocumentCompleteEventName, - ShowInfoBar::ContinueExecution, result.release()); + // If we created a window then we have to wait until the document is complete + // before responding. If window is not created then we can post result now. + if (0 == window_handle) { + result->PostResult(); + } else { + // Store the window information returned by ShowInfobar(). + result->CreateWindowValue(dispatcher->GetWindowHandleFromId(window_handle), + false); + + dispatcher->RegisterEphemeralEventHandler(kOnDocumentCompleteEventName, + ShowInfoBar::ContinueExecution, result.release()); + } } HRESULT ShowInfoBar::ContinueExecution( |