oshima | 758abebc | 2014-11-06 10:55:50 | [diff] [blame] | 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 | |
oshima | f6539842 | 2014-11-18 23:30:42 | [diff] [blame] | 5 | #ifndef COMPONENTS_APP_MODAL_JAVASCRIPT_DIALOG_EXTENSIONS_CLIENT_H_ |
| 6 | #define COMPONENTS_APP_MODAL_JAVASCRIPT_DIALOG_EXTENSIONS_CLIENT_H_ |
oshima | 758abebc | 2014-11-06 10:55:50 | [diff] [blame] | 7 | |
| 8 | #include <string> |
| 9 | |
| 10 | class GURL; |
| 11 | |
| 12 | namespace content { |
| 13 | class WebContents; |
| 14 | } |
| 15 | |
oshima | 0929be2a | 2014-11-19 22:21:03 | [diff] [blame] | 16 | namespace app_modal { |
| 17 | |
oshima | 758abebc | 2014-11-06 10:55:50 | [diff] [blame] | 18 | // A client interface to access and control extensions/apps |
| 19 | // that opened a JavaScript dialog. |
| 20 | class 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 | |
oshima | 0929be2a | 2014-11-19 22:21:03 | [diff] [blame] | 40 | } // namespace app_modal |
| 41 | |
oshima | f6539842 | 2014-11-18 23:30:42 | [diff] [blame] | 42 | #endif // COMPONENTS_APP_MODAL_JAVASCRIPT_DIALOG_EXTENSIONS_CLIENT_H_ |