Chromium Code Reviews| Index: components/app_modal_dialogs/javascript_dialog_extensions_client.h |
| diff --git a/components/app_modal_dialogs/javascript_dialog_extensions_client.h b/components/app_modal_dialogs/javascript_dialog_extensions_client.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..d838ccf27ef6dcf1d2b32432a708a42e936e7814 |
| --- /dev/null |
| +++ b/components/app_modal_dialogs/javascript_dialog_extensions_client.h |
| @@ -0,0 +1,43 @@ |
| +// 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_DIALOGS_JAVASCRIPT_DIALOG_EXTENSIONS_CLIENT_H_ |
| +#define COMPONENTS_APP_MODAL_DIALOGS_JAVASCRIPT_DIALOG_EXTENSIONS_CLIENT_H_ |
| + |
| +#include <string> |
| + |
| +class GURL; |
| + |
| +namespace content { |
| +class WebContents; |
| +} |
| + |
| +// A client interface to access and control extensions/apps |
| +// that opened a javascript dialog. |
|
Avi (use Gerrit)
2014/11/04 20:46:41
JavaScript, not javascript.
|
| +class JavaScriptDialogExtensionsClient { |
| + public: |
| + virtual ~JavaScriptDialogExtensionsClient() {} |
| + |
| + // Called when the extension associated with |web_contents| opened |
| + // a dialog. The embedder should increment its keep alive count so |
| + // that its lazy background page can stay alive. |
| + virtual void IncrementLazyKeepaliveCount( |
| + content::WebContents* web_contents) = 0; |
| + |
| + // Called when a dialog created by the extension associated with |
| + // |web_contents| is closed. The embedder should decrement |
| + // its keep alive count so that the extension can shutdown |
| + // its lazy background page. |
| + virtual void DecrementLazyKeepaliveCount( |
| + content::WebContents* web_contents) = 0; |
| + |
| + // Sets the name of the extensions associated with the |web_contents| |
| + // in the |name_out|, and returns true. If there is no extension associated |
| + // with the |web_contents|, returns false. |
| + virtual bool GetExtensionName(content::WebContents* web_contents, |
| + const GURL& origin_url, |
| + std::string* name_out) = 0; |
| +}; |
| + |
| +#endif // COMPONENTS_APP_MODAL_DIALOGS_JAVASCRIPT_DIALOG_EXTENSIONS_CLIENT_H_ |