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

Side by Side Diff: chrome/browser/ui/javascript_dialogs/javascript_dialog_tab_helper.h

Issue 2179923002: Add a JavaScript dialog tab helper. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: comment Created 4 years, 3 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
OLDNEW
(Empty)
1 // Copyright 2016 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_UI_JAVASCRIPT_DIALOGS_JAVASCRIPT_DIALOG_TAB_HELPER_H_
6 #define CHROME_BROWSER_UI_JAVASCRIPT_DIALOGS_JAVASCRIPT_DIALOG_TAB_HELPER_H_
7
8 #include "base/macros.h"
9 #include "content/public/browser/javascript_dialog_manager.h"
10 #include "content/public/browser/web_contents_observer.h"
11 #include "content/public/browser/web_contents_user_data.h"
12
13 class JavaScriptDialogTabHelper
14 : public content::WebContentsObserver,
15 public content::JavaScriptDialogManager,
16 public content::WebContentsUserData<JavaScriptDialogTabHelper> {
17 public:
18 explicit JavaScriptDialogTabHelper(content::WebContents* web_contents);
19 ~JavaScriptDialogTabHelper() override;
20
21 // JavaScriptDialogManager:
22 void RunJavaScriptDialog(content::WebContents* web_contents,
23 const GURL& origin_url,
24 content::JavaScriptMessageType message_type,
25 const base::string16& message_text,
26 const base::string16& default_prompt_text,
27 const DialogClosedCallback& callback,
28 bool* did_suppress_message) override;
29 void RunBeforeUnloadDialog(content::WebContents* web_contents,
30 bool is_reload,
31 const DialogClosedCallback& callback) override;
32 bool HandleJavaScriptDialog(content::WebContents* web_contents,
33 bool accept,
34 const base::string16* prompt_override) override;
35 void CancelActiveAndPendingDialogs(
36 content::WebContents* web_contents) override;
37 void ResetDialogState(content::WebContents* web_contents) override;
38 void WebContentsDestroyed() override;
39
40 private:
41 friend class content::WebContentsUserData<JavaScriptDialogTabHelper>;
42
43 DISALLOW_COPY_AND_ASSIGN(JavaScriptDialogTabHelper);
44 };
45
46 #endif // CHROME_BROWSER_UI_JAVASCRIPT_DIALOGS_JAVASCRIPT_DIALOG_TAB_HELPER_H_
OLDNEW
« no previous file with comments | « chrome/browser/ui/browser.cc ('k') | chrome/browser/ui/javascript_dialogs/javascript_dialog_tab_helper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698