OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "android_webview/browser/aw_javascript_dialog_manager.h" | 5 #include "android_webview/browser/aw_javascript_dialog_manager.h" |
6 | 6 |
7 #include "android_webview/browser/aw_contents_client_bridge_base.h" | 7 #include "android_webview/browser/aw_contents_client_bridge_base.h" |
8 #include "content/public/browser/javascript_dialog_manager.h" | 8 #include "content/public/browser/javascript_dialog_manager.h" |
9 #include "content/public/browser/web_contents.h" | 9 #include "content/public/browser/web_contents.h" |
10 | 10 |
(...skipping 21 matching lines...) Expand all Loading... |
32 | 32 |
33 bridge->RunJavaScriptDialog(message_type, | 33 bridge->RunJavaScriptDialog(message_type, |
34 origin_url, | 34 origin_url, |
35 message_text, | 35 message_text, |
36 default_prompt_text, | 36 default_prompt_text, |
37 callback); | 37 callback); |
38 } | 38 } |
39 | 39 |
40 void AwJavaScriptDialogManager::RunBeforeUnloadDialog( | 40 void AwJavaScriptDialogManager::RunBeforeUnloadDialog( |
41 content::WebContents* web_contents, | 41 content::WebContents* web_contents, |
42 const base::string16& message_text, | |
43 bool is_reload, | 42 bool is_reload, |
44 const DialogClosedCallback& callback) { | 43 const DialogClosedCallback& callback) { |
45 AwContentsClientBridgeBase* bridge = | 44 AwContentsClientBridgeBase* bridge = |
46 AwContentsClientBridgeBase::FromWebContents(web_contents); | 45 AwContentsClientBridgeBase::FromWebContents(web_contents); |
47 if (!bridge) { | 46 if (!bridge) { |
48 callback.Run(false, base::string16()); | 47 callback.Run(false, base::string16()); |
49 return; | 48 return; |
50 } | 49 } |
51 | 50 |
52 bridge->RunBeforeUnloadDialog(web_contents->GetURL(), | 51 bridge->RunBeforeUnloadDialog(web_contents->GetURL(), |
53 message_text, | |
54 callback); | 52 callback); |
55 } | 53 } |
56 | 54 |
57 void AwJavaScriptDialogManager::CancelActiveAndPendingDialogs( | 55 void AwJavaScriptDialogManager::CancelActiveAndPendingDialogs( |
58 content::WebContents* web_contents) { | 56 content::WebContents* web_contents) { |
59 } | 57 } |
60 | 58 |
61 void AwJavaScriptDialogManager::ResetDialogState( | 59 void AwJavaScriptDialogManager::ResetDialogState( |
62 content::WebContents* web_contents) { | 60 content::WebContents* web_contents) { |
63 } | 61 } |
64 | 62 |
65 } // namespace android_webview | 63 } // namespace android_webview |
OLD | NEW |