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.
4
5 #include "android_webview/browser/aw_javascript_dialog_manager.h"
6
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"
10
11 namespace android_webview {
12
AwJavaScriptDialogManager()13 AwJavaScriptDialogManager::AwJavaScriptDialogManager() {}
14
~AwJavaScriptDialogManager()15 AwJavaScriptDialogManager::~AwJavaScriptDialogManager() {}
16
RunJavaScriptDialog(content::WebContents * web_contents,const GURL & origin_url,const std::string & accept_lang,content::JavaScriptMessageType message_type,const string16 & message_text,const string16 & default_prompt_text,const DialogClosedCallback & callback,bool * did_suppress_message)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 string16& message_text,
23 const 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,
29 origin_url,
30 message_text,
31 default_prompt_text,
32 callback);
33 }
34
RunBeforeUnloadDialog(content::WebContents * web_contents,const string16 & message_text,bool is_reload,const DialogClosedCallback & callback)35 void AwJavaScriptDialogManager::RunBeforeUnloadDialog(
36 content::WebContents* web_contents,
37 const string16& message_text,
38 bool is_reload,
39 const DialogClosedCallback& callback) {
40 AwContentsClientBridgeBase* bridge =
41 AwContentsClientBridgeBase::FromWebContents(web_contents);
42 bridge->RunBeforeUnloadDialog(web_contents->GetURL(),
43 message_text,
44 callback);
45 }
46
CancelActiveAndPendingDialogs(content::WebContents * web_contents)47 void AwJavaScriptDialogManager::CancelActiveAndPendingDialogs(
48 content::WebContents* web_contents) {
49 }
50
WebContentsDestroyed(content::WebContents * web_contents)51 void AwJavaScriptDialogManager::WebContentsDestroyed(
52 content::WebContents* web_contents) {
53 }
54
55 } // namespace android_webview
56