Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2013 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 | |
| 5 #ifndef CHROME_BROWSER_UI_ECHO_DIALOG_CHROMEOS_H_ | |
| 6 #define CHROME_BROWSER_UI_ECHO_DIALOG_CHROMEOS_H_ | |
| 7 | |
| 8 #include "base/string16.h" | |
| 9 #include "ui/gfx/native_widget_types.h" | |
| 10 | |
| 11 // Dialog shown by echoPrivate extension API when getUserConsent function is | |
| 12 // called. The API is used by echo extension when an offer from a service is | |
| 13 // being redeemed. The dialog is shown to get an user consent. If the echo | |
| 14 // extension is not allowed by policy to redeem offers, the dialog informs user | |
| 15 // about this. | |
| 16 // This is ChromeOS-only dialog. | |
| 17 class EchoDialog { | |
| 18 public: | |
| 19 | |
| 20 // A listener interface for the EchoDialog, so an interested party can be | |
| 21 // notified about changes to the dialog. It is provided during EchoDialog | |
| 22 // construction. | |
| 23 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.
| |
| 24 public: | |
| 25 virtual ~Listener() {} | |
|
tfarina
2013/02/26 19:13:00
make this protected
tbarzic
2013/02/26 19:34:55
Done.
| |
| 26 | |
| 27 // Called when the EchoDialog is accepted. After call to this method, the | |
| 28 // listener will not be invoked again. | |
| 29 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.
| |
| 30 // Called when the EchoDialog is canceled. After call to this method, the | |
| 31 // listener will not be invoked again. | |
| 32 virtual void OnCancel() = 0; | |
| 33 // Called when a link in the EchoDialog is clicked. | |
| 34 virtual void OnMoreInfoLinkClicked() = 0; | |
| 35 }; | |
| 36 | |
| 37 virtual ~EchoDialog() {} | |
| 38 | |
| 39 // Creates platform specific (only ChromeOS) implementation of EchoDialog. | |
| 40 // Implementation in chrome/browser/ui/views/echo_dialog_views_chromeos.cc | |
| 41 static EchoDialog* Create(Listener* listener); | |
| 42 | |
| 43 // Initializes dialog layout that will be showed when echo extension is | |
| 44 // allowed to redeem offers. |service_name| is the name of the service that | |
| 45 // requests user consent to redeem an offer. |origin| is the service's origin | |
| 46 // url. Service name should be underlined in the dialog, and hovering over its | |
| 47 // label should display tooltip containing |origin|. | |
| 48 // The dialog will have both OK and Cancel buttons. | |
| 49 virtual void InitForEnabledEcho(const string16& service_name, | |
| 50 const string16& origin) = 0; | |
| 51 | |
| 52 // Initializes dialog layout that will be shown when echo extension is not | |
| 53 // allowed to redeem offers. The dialog will be showing a message that the | |
| 54 // offer redeeming is disabled by policy. | |
| 55 // The dialog will have only Cancel button. | |
| 56 virtual void InitForDisabledEcho() = 0; | |
| 57 | |
| 58 // Shows the dialog. | |
| 59 virtual void Show(gfx::NativeWindow parent) = 0; | |
| 60 }; | |
| 61 | |
| 62 #endif // CHROME_BROWSER_UI_ECHO_DIALOG_CHROMEOS_H_ | |
| OLD | NEW |