Index: chrome/browser/ui/echo_dialog_chromeos.h |
diff --git a/chrome/browser/ui/echo_dialog_chromeos.h b/chrome/browser/ui/echo_dialog_chromeos.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..188ff490ecaf6989fdaba15a739108dd48862ac4 |
--- /dev/null |
+++ b/chrome/browser/ui/echo_dialog_chromeos.h |
@@ -0,0 +1,62 @@ |
+// Copyright 2013 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 CHROME_BROWSER_UI_ECHO_DIALOG_CHROMEOS_H_ |
+#define CHROME_BROWSER_UI_ECHO_DIALOG_CHROMEOS_H_ |
+ |
+#include "base/string16.h" |
+#include "ui/gfx/native_widget_types.h" |
+ |
+// Dialog shown by echoPrivate extension API when getUserConsent function is |
+// called. The API is used by echo extension when an offer from a service is |
+// being redeemed. The dialog is shown to get an user consent. If the echo |
+// extension is not allowed by policy to redeem offers, the dialog informs user |
+// about this. |
+// This is ChromeOS-only dialog. |
+class EchoDialog { |
+ public: |
+ |
+ // A listener interface for the EchoDialog, so an interested party can be |
+ // notified about changes to the dialog. It is provided during EchoDialog |
+ // construction. |
+ class Listener { |
tfarina
2013/02/26 19:13:00
no nested class. Please, put this in echo_dialog_l
tbarzic
2013/02/26 19:34:55
Done.
|
+ public: |
+ virtual ~Listener() {} |
tfarina
2013/02/26 19:13:00
make this protected
tbarzic
2013/02/26 19:34:55
Done.
|
+ |
+ // Called when the EchoDialog is accepted. After call to this method, the |
+ // listener will not be invoked again. |
+ virtual void OnAccept() = 0; |
tfarina
2013/02/26 19:13:00
put one blank line after each method.
tbarzic
2013/02/26 19:34:55
Done.
|
+ // Called when the EchoDialog is canceled. After call to this method, the |
+ // listener will not be invoked again. |
+ virtual void OnCancel() = 0; |
+ // Called when a link in the EchoDialog is clicked. |
+ virtual void OnMoreInfoLinkClicked() = 0; |
+ }; |
+ |
+ virtual ~EchoDialog() {} |
+ |
+ // Creates platform specific (only ChromeOS) implementation of EchoDialog. |
+ // Implementation in chrome/browser/ui/views/echo_dialog_views_chromeos.cc |
+ static EchoDialog* Create(Listener* listener); |
+ |
+ // Initializes dialog layout that will be showed when echo extension is |
+ // allowed to redeem offers. |service_name| is the name of the service that |
+ // requests user consent to redeem an offer. |origin| is the service's origin |
+ // url. Service name should be underlined in the dialog, and hovering over its |
+ // label should display tooltip containing |origin|. |
+ // The dialog will have both OK and Cancel buttons. |
+ virtual void InitForEnabledEcho(const string16& service_name, |
+ const string16& origin) = 0; |
+ |
+ // Initializes dialog layout that will be shown when echo extension is not |
+ // allowed to redeem offers. The dialog will be showing a message that the |
+ // offer redeeming is disabled by policy. |
+ // The dialog will have only Cancel button. |
+ virtual void InitForDisabledEcho() = 0; |
+ |
+ // Shows the dialog. |
+ virtual void Show(gfx::NativeWindow parent) = 0; |
+}; |
+ |
+#endif // CHROME_BROWSER_UI_ECHO_DIALOG_CHROMEOS_H_ |