blob: f85976e99b16df944ddebbb3b837c02276611f02 [file] [log] [blame]
oshima758abebc2014-11-06 10:55:501// 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
oshimaf65398422014-11-18 23:30:425#ifndef COMPONENTS_APP_MODAL_JAVASCRIPT_DIALOG_EXTENSIONS_CLIENT_H_
6#define COMPONENTS_APP_MODAL_JAVASCRIPT_DIALOG_EXTENSIONS_CLIENT_H_
oshima758abebc2014-11-06 10:55:507
8#include <string>
9
10class GURL;
11
12namespace content {
13class WebContents;
14}
15
oshima0929be2a2014-11-19 22:21:0316namespace app_modal {
17
oshima758abebc2014-11-06 10:55:5018// A client interface to access and control extensions/apps
19// that opened a JavaScript dialog.
20class JavaScriptDialogExtensionsClient {
21 public:
22 virtual ~JavaScriptDialogExtensionsClient() {}
23
24 // Called when the extension associated with |web_contents| opened
25 // a dialog.
26 virtual void OnDialogOpened(content::WebContents* web_contents) = 0;
27
28 // Called when a dialog created by the extension associated with
29 // |web_contents| is closed.
30 virtual void OnDialogClosed(content::WebContents* web_contents) = 0;
31
32 // Sets the name of the extensions associated with the
33 // |web_contents| in the |name_out| if there is one, returning true;
34 // returns false otherwise.
35 virtual bool GetExtensionName(content::WebContents* web_contents,
36 const GURL& origin_url,
37 std::string* name_out) = 0;
38};
39
oshima0929be2a2014-11-19 22:21:0340} // namespace app_modal
41
oshimaf65398422014-11-18 23:30:4242#endif // COMPONENTS_APP_MODAL_JAVASCRIPT_DIALOG_EXTENSIONS_CLIENT_H_