Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(45)

Side by Side Diff: chrome/browser/guestview/webview/javascript_dialog_helper.h

Issue 239143007: <webview>: Move JavaScript Dialog API to chrome (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@move_pointer_lock_to_chrome
Patch Set: Addressed nits Created 6 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | chrome/browser/guestview/webview/javascript_dialog_helper.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2014 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 #ifndef CHROME_BROWSER_GUESTVIEW_WEBVIEW_JAVASCRIPT_DIALOG_HELPER_H_
6 #define CHROME_BROWSER_GUESTVIEW_WEBVIEW_JAVASCRIPT_DIALOG_HELPER_H_
7
8 #include "content/public/browser/javascript_dialog_manager.h"
9
10 class WebViewGuest;
11
12 class JavaScriptDialogHelper : public content::JavaScriptDialogManager {
13 public:
14 explicit JavaScriptDialogHelper(WebViewGuest* guest);
15 virtual ~JavaScriptDialogHelper();
16
17 // JavaScriptDialogManager implementation.
18 virtual void RunJavaScriptDialog(
19 content::WebContents* web_contents,
20 const GURL& origin_url,
21 const std::string& accept_lang,
22 content::JavaScriptMessageType javascript_message_type,
23 const base::string16& message_text,
24 const base::string16& default_prompt_text,
25 const DialogClosedCallback& callback,
26 bool* did_suppress_message) OVERRIDE;
27 virtual void RunBeforeUnloadDialog(
28 content::WebContents* web_contents,
29 const base::string16& message_text,
30 bool is_reload,
31 const DialogClosedCallback& callback) OVERRIDE;
32 virtual bool HandleJavaScriptDialog(
33 content::WebContents* web_contents,
34 bool accept,
35 const base::string16* prompt_override) OVERRIDE;
36 virtual void CancelActiveAndPendingDialogs(
37 content::WebContents* web_contents) OVERRIDE;
38 virtual void WebContentsDestroyed(
39 content::WebContents* web_contents) OVERRIDE;
40
41 private:
42 void OnPermissionResponse(
43 const DialogClosedCallback& callback,
44 bool allow,
45 const std::string& user_input);
46
47 // Pointer to the webview that is being helped.
48 WebViewGuest* const webview_guest_;
49
50 DISALLOW_COPY_AND_ASSIGN(JavaScriptDialogHelper);
51 };
52
53 #endif // CHROME_BROWSER_GUESTVIEW_WEBVIEW_JAVASCRIPT_DIALOG_HELPER_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/guestview/webview/javascript_dialog_helper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698