OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CHROME_BROWSER_CHROMEOS_UI_ECHO_DIALOG_VIEW_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_UI_ECHO_DIALOG_VIEW_H_ |
6 #define CHROME_BROWSER_CHROMEOS_UI_ECHO_DIALOG_VIEW_H_ | 6 #define CHROME_BROWSER_CHROMEOS_UI_ECHO_DIALOG_VIEW_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
10 #include "ui/views/controls/styled_label_listener.h" | 10 #include "ui/views/controls/styled_label_listener.h" |
(...skipping 17 matching lines...) Expand all Loading... |
28 public: | 28 public: |
29 explicit EchoDialogView(EchoDialogListener* listener); | 29 explicit EchoDialogView(EchoDialogListener* listener); |
30 virtual ~EchoDialogView(); | 30 virtual ~EchoDialogView(); |
31 | 31 |
32 // Initializes dialog layout that will be showed when echo extension is | 32 // Initializes dialog layout that will be showed when echo extension is |
33 // allowed to redeem offers. |service_name| is the name of the service that | 33 // allowed to redeem offers. |service_name| is the name of the service that |
34 // requests user consent to redeem an offer. |origin| is the service's origin | 34 // requests user consent to redeem an offer. |origin| is the service's origin |
35 // url. Service name should be underlined in the dialog, and hovering over its | 35 // url. Service name should be underlined in the dialog, and hovering over its |
36 // label should display tooltip containing |origin|. | 36 // label should display tooltip containing |origin|. |
37 // The dialog will have both OK and Cancel buttons. | 37 // The dialog will have both OK and Cancel buttons. |
38 void InitForEnabledEcho(const string16& service_name, const string16& origin); | 38 void InitForEnabledEcho(const base::string16& service_name, const base::string
16& origin); |
39 | 39 |
40 // Initializes dialog layout that will be shown when echo extension is not | 40 // Initializes dialog layout that will be shown when echo extension is not |
41 // allowed to redeem offers. The dialog will be showing a message that the | 41 // allowed to redeem offers. The dialog will be showing a message that the |
42 // offer redeeming is disabled by policy. | 42 // offer redeeming is disabled by policy. |
43 // The dialog will have only Cancel button. | 43 // The dialog will have only Cancel button. |
44 void InitForDisabledEcho(); | 44 void InitForDisabledEcho(); |
45 | 45 |
46 // Shows the dialog. | 46 // Shows the dialog. |
47 void Show(gfx::NativeWindow parent); | 47 void Show(gfx::NativeWindow parent); |
48 | 48 |
49 private: | 49 private: |
50 friend class ExtensionEchoPrivateApiTest; | 50 friend class ExtensionEchoPrivateApiTest; |
51 | 51 |
52 // views::DialogDelegate overrides. | 52 // views::DialogDelegate overrides. |
53 virtual int GetDialogButtons() const OVERRIDE; | 53 virtual int GetDialogButtons() const OVERRIDE; |
54 virtual int GetDefaultDialogButton() const OVERRIDE; | 54 virtual int GetDefaultDialogButton() const OVERRIDE; |
55 virtual string16 GetDialogButtonLabel(ui::DialogButton button) const OVERRIDE; | 55 virtual base::string16 GetDialogButtonLabel(ui::DialogButton button) const OVE
RRIDE; |
56 virtual bool Cancel() OVERRIDE; | 56 virtual bool Cancel() OVERRIDE; |
57 virtual bool Accept() OVERRIDE; | 57 virtual bool Accept() OVERRIDE; |
58 | 58 |
59 // views::WidgetDelegate overrides. | 59 // views::WidgetDelegate overrides. |
60 virtual ui::ModalType GetModalType() const OVERRIDE; | 60 virtual ui::ModalType GetModalType() const OVERRIDE; |
61 virtual bool ShouldShowWindowTitle() const OVERRIDE; | 61 virtual bool ShouldShowWindowTitle() const OVERRIDE; |
62 virtual bool ShouldShowWindowIcon() const OVERRIDE; | 62 virtual bool ShouldShowWindowIcon() const OVERRIDE; |
63 | 63 |
64 // views::LinkListener override. | 64 // views::LinkListener override. |
65 virtual void StyledLabelLinkClicked(const gfx::Range& range, | 65 virtual void StyledLabelLinkClicked(const gfx::Range& range, |
(...skipping 10 matching lines...) Expand all Loading... |
76 EchoDialogListener* listener_; | 76 EchoDialogListener* listener_; |
77 int ok_button_label_id_; | 77 int ok_button_label_id_; |
78 int cancel_button_label_id_; | 78 int cancel_button_label_id_; |
79 | 79 |
80 DISALLOW_COPY_AND_ASSIGN(EchoDialogView); | 80 DISALLOW_COPY_AND_ASSIGN(EchoDialogView); |
81 }; | 81 }; |
82 | 82 |
83 } // namespace chromeos | 83 } // namespace chromeos |
84 | 84 |
85 #endif // CHROME_BROWSER_CHROMEOS_UI_ECHO_DIALOG_VIEW_H_ | 85 #endif // CHROME_BROWSER_CHROMEOS_UI_ECHO_DIALOG_VIEW_H_ |
OLD | NEW |