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

Unified Diff: components/app_modal_dialogs/javascript_dialog_extensions_client.h

Issue 666533007: Move JavaScriptDialogManager, JavascriptAppModalDialogViews to components/app_modal_dialogs (Closed) Base URL: https://chromium.googlesource.com/chromium/src@master
Patch Set: Created 6 years, 1 month 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 side-by-side diff with in-line comments
Download patch
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..fc00e72e0cf784123af1cc5f364e7358e66435f0
--- /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.
+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(
Yoyo Zhou 2014/11/06 01:05:03 I think I'd prefer if these were called, e.g. OnDi
oshima 2014/11/06 01:47:44 Done.
+ 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|
Yoyo Zhou 2014/11/06 01:05:02 The grammar here is a little unusual. How about: S
oshima 2014/11/06 01:47:43 Done.
+ // 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_

Powered by Google App Engine
This is Rietveld 408576698