1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include "android_webview/browser/aw_javascript_dialog_manager.h"
7 #include "android_webview/browser/aw_contents_client_bridge_base.h"
8 #include "content/public/browser/javascript_dialog_manager.h"
9 #include "content/public/browser/web_contents.h"
11 namespace android_webview
{
13 AwJavaScriptDialogManager::AwJavaScriptDialogManager() {}
15 AwJavaScriptDialogManager::~AwJavaScriptDialogManager() {}
17 void AwJavaScriptDialogManager::RunJavaScriptDialog(
18 content::WebContents
* web_contents
,
19 const GURL
& origin_url
,
20 const std::string
& accept_lang
,
21 content::JavaScriptMessageType message_type
,
22 const base::string16
& message_text
,
23 const base::string16
& default_prompt_text
,
24 const DialogClosedCallback
& callback
,
25 bool* did_suppress_message
) {
26 AwContentsClientBridgeBase
* bridge
=
27 AwContentsClientBridgeBase::FromWebContents(web_contents
);
28 bridge
->RunJavaScriptDialog(message_type
,
35 void AwJavaScriptDialogManager::RunBeforeUnloadDialog(
36 content::WebContents
* web_contents
,
37 const base::string16
& message_text
,
39 const DialogClosedCallback
& callback
) {
40 AwContentsClientBridgeBase
* bridge
=
41 AwContentsClientBridgeBase::FromWebContents(web_contents
);
42 bridge
->RunBeforeUnloadDialog(web_contents
->GetURL(),
47 void AwJavaScriptDialogManager::CancelActiveAndPendingDialogs(
48 content::WebContents
* web_contents
) {
51 void AwJavaScriptDialogManager::WebContentsDestroyed(
52 content::WebContents
* web_contents
) {
55 } // namespace android_webview