summaryrefslogtreecommitdiffstats
path: root/components/app_modal/javascript_dialog_extensions_client.h
blob: f85976e99b16df944ddebbb3b837c02276611f02 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef COMPONENTS_APP_MODAL_JAVASCRIPT_DIALOG_EXTENSIONS_CLIENT_H_
#define COMPONENTS_APP_MODAL_JAVASCRIPT_DIALOG_EXTENSIONS_CLIENT_H_

#include <string>

class GURL;

namespace content {
class WebContents;
}

namespace app_modal {

// A client interface to access and control extensions/apps
// that opened a JavaScript dialog.
class JavaScriptDialogExtensionsClient {
 public:
  virtual ~JavaScriptDialogExtensionsClient() {}

  // Called when the extension associated with |web_contents| opened
  // a dialog.
  virtual void OnDialogOpened(content::WebContents* web_contents) = 0;

  // Called when a dialog created by the extension associated with
  // |web_contents| is closed.
  virtual void OnDialogClosed(content::WebContents* web_contents) = 0;

  // Sets the name of the extensions associated with the
  // |web_contents| in the |name_out| if there is one, returning true;
  // returns false otherwise.
  virtual bool GetExtensionName(content::WebContents* web_contents,
                                const GURL& origin_url,
                                std::string* name_out) = 0;
};

}  // namespace app_modal

#endif  // COMPONENTS_APP_MODAL_JAVASCRIPT_DIALOG_EXTENSIONS_CLIENT_H_