2013-04-30 15:56:50 +00:00
|
|
|
// Copyright (c) 2013 GitHub, Inc. All rights reserved.
|
|
|
|
// Use of this source code is governed by a BSD-style license that can be
|
|
|
|
// found in the LICENSE file.
|
|
|
|
|
2014-03-16 00:30:26 +00:00
|
|
|
#include "atom/browser/atom_javascript_dialog_manager.h"
|
2013-04-30 15:56:50 +00:00
|
|
|
|
2013-12-11 07:48:19 +00:00
|
|
|
#include "base/strings/utf_string_conversions.h"
|
2013-04-30 15:56:50 +00:00
|
|
|
|
|
|
|
namespace atom {
|
|
|
|
|
2014-03-01 11:53:50 +00:00
|
|
|
void AtomJavaScriptDialogManager::RunJavaScriptDialog(
|
|
|
|
content::WebContents* web_contents,
|
|
|
|
const GURL& origin_url,
|
|
|
|
const std::string& accept_lang,
|
|
|
|
content::JavaScriptMessageType javascript_message_type,
|
|
|
|
const string16& message_text,
|
|
|
|
const string16& default_prompt_text,
|
|
|
|
const DialogClosedCallback& callback,
|
|
|
|
bool* did_suppress_message) {
|
|
|
|
callback.Run(false, string16());
|
|
|
|
}
|
|
|
|
|
2013-04-30 15:56:50 +00:00
|
|
|
void AtomJavaScriptDialogManager::RunBeforeUnloadDialog(
|
|
|
|
content::WebContents* web_contents,
|
|
|
|
const string16& message_text,
|
|
|
|
bool is_reload,
|
|
|
|
const DialogClosedCallback& callback) {
|
2013-09-02 08:39:00 +00:00
|
|
|
|
|
|
|
bool prevent_reload = message_text.empty() ||
|
2013-04-30 15:56:50 +00:00
|
|
|
message_text == ASCIIToUTF16("false");
|
|
|
|
callback.Run(!prevent_reload, message_text);
|
|
|
|
}
|
|
|
|
|
|
|
|
} // namespace atom
|