Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 UI_VIEWS_CONTROLS_MESSAGE_BOX_VIEW_H_ | 5 #ifndef UI_VIEWS_CONTROLS_MESSAGE_BOX_VIEW_H_ |
| 6 #define UI_VIEWS_CONTROLS_MESSAGE_BOX_VIEW_H_ | 6 #define UI_VIEWS_CONTROLS_MESSAGE_BOX_VIEW_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 19 matching lines...) Expand all Loading... | |
| 30 // dialog text, each paragraph's directionality is auto-detected using the | 30 // dialog text, each paragraph's directionality is auto-detected using the |
| 31 // directionality of the paragraph's first strong character's. Please refer | 31 // directionality of the paragraph's first strong character's. Please refer |
| 32 // to HTML5 spec for details. | 32 // to HTML5 spec for details. |
| 33 // http://dev.w3.org/html5/spec/Overview.html#text-rendered-in-native-user-i nterfaces: | 33 // http://dev.w3.org/html5/spec/Overview.html#text-rendered-in-native-user-i nterfaces: |
| 34 // The spec does not say anything about alignment. And we choose to | 34 // The spec does not say anything about alignment. And we choose to |
| 35 // align all paragraphs according to the direction of the first paragraph. | 35 // align all paragraphs according to the direction of the first paragraph. |
| 36 DETECT_DIRECTIONALITY = 1 << 0, | 36 DETECT_DIRECTIONALITY = 1 << 0, |
| 37 HAS_PROMPT_FIELD = 1 << 1, | 37 HAS_PROMPT_FIELD = 1 << 1, |
| 38 }; | 38 }; |
| 39 | 39 |
| 40 MessageBoxView(int options, | 40 struct InitParams { |
| 41 const string16& message, | 41 InitParams(const string16& message); |
|
sky
2012/05/11 17:31:10
Explicit and add a destructor.
tfarina
2012/05/11 17:41:42
Done.
| |
| 42 const string16& default_prompt, | |
| 43 int message_width); | |
| 44 | 42 |
| 45 MessageBoxView(int options, | 43 uint16 options; |
| 46 const string16& message, | 44 string16 message; |
| 47 const string16& default_prompt); | 45 string16 default_prompt; |
| 46 int message_width; | |
| 47 }; | |
| 48 | |
| 49 MessageBoxView(const InitParams& params); | |
|
sky
2012/05/11 17:31:10
explicit
tfarina
2012/05/11 17:41:42
Done.
| |
| 48 | 50 |
| 49 virtual ~MessageBoxView(); | 51 virtual ~MessageBoxView(); |
| 50 | 52 |
| 51 // Returns the text box. | 53 // Returns the text box. |
| 52 views::Textfield* text_box() { return prompt_field_; } | 54 views::Textfield* text_box() { return prompt_field_; } |
| 53 | 55 |
| 54 // Returns user entered data in the prompt field. | 56 // Returns user entered data in the prompt field. |
| 55 string16 GetInputText(); | 57 string16 GetInputText(); |
| 56 | 58 |
| 57 // Returns true if a checkbox is selected, false otherwise. (And false if | 59 // Returns true if a checkbox is selected, false otherwise. (And false if |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 104 | 106 |
| 105 // Maximum width of the message label. | 107 // Maximum width of the message label. |
| 106 int message_width_; | 108 int message_width_; |
| 107 | 109 |
| 108 DISALLOW_COPY_AND_ASSIGN(MessageBoxView); | 110 DISALLOW_COPY_AND_ASSIGN(MessageBoxView); |
| 109 }; | 111 }; |
| 110 | 112 |
| 111 } // namespace views | 113 } // namespace views |
| 112 | 114 |
| 113 #endif // UI_VIEWS_CONTROLS_MESSAGE_BOX_VIEW_H_ | 115 #endif // UI_VIEWS_CONTROLS_MESSAGE_BOX_VIEW_H_ |
| OLD | NEW |