OLD | NEW |
---|---|
(Empty) | |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | |
sky
2011/11/30 22:43:12
How come this file isn't being shown as deleted?
tfarina
2011/12/01 12:43:26
Seems to be a bug with rietveld. maruel should kno
| |
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 UI_BASE_MESSAGE_BOX_FLAGS_H_ | |
6 #define UI_BASE_MESSAGE_BOX_FLAGS_H_ | |
7 #pragma once | |
8 | |
9 #include "base/basictypes.h" | |
10 | |
11 namespace ui { | |
12 | |
13 // This class contains flags used to communicate the type of message box | |
14 // to show. E.g., the renderer can request the browser to show a | |
15 // javascript alert or a javascript confirm message. | |
16 class MessageBoxFlags { | |
17 public: | |
18 static const int kFlagHasOKButton = 0x1; | |
19 static const int kFlagHasCancelButton = 0x2; | |
20 static const int kFlagHasPromptField = 0x4; | |
21 static const int kFlagHasMessage = 0x8; | |
22 | |
23 // The following flag is used to indicate whether the message's alignment | |
24 // should be autodetected or inherited from Chrome UI. Callers should pass | |
25 // the correct flag based on the origin of the message. If the message is | |
26 // from a web page (such as the JavaScript alert message), its alignment and | |
27 // directionality are based on the first character with strong directionality | |
28 // in the message. Chrome UI strings are localized string and therefore they | |
29 // should have the same alignment and directionality as those of the Chrome | |
30 // UI. For example, in RTL locales, even though some strings might begin with | |
31 // an English character, they should still be right aligned and be displayed | |
32 // Right-To-Left. | |
33 // | |
34 // TODO(xji): If the message is from a web page, then the message | |
35 // directionality should be determined based on the directionality of the web | |
36 // page. Please refer to http://crbug.com/7166 for more information. | |
37 static const int kAutoDetectAlignment = 0x10; | |
38 | |
39 static const int kIsConfirmMessageBox = kFlagHasMessage | | |
40 kFlagHasOKButton | | |
41 kFlagHasCancelButton; | |
42 static const int kIsJavascriptAlert = kFlagHasOKButton | kFlagHasMessage; | |
43 static const int kIsJavascriptConfirm = kIsJavascriptAlert | | |
44 kFlagHasCancelButton; | |
45 static const int kIsJavascriptPrompt = kIsJavascriptConfirm | | |
46 kFlagHasPromptField; | |
47 | |
48 private: | |
49 DISALLOW_IMPLICIT_CONSTRUCTORS(MessageBoxFlags); | |
50 }; | |
51 | |
52 } // namespace ui | |
53 | |
54 #endif // UI_BASE_MESSAGE_BOX_FLAGS_H_ | |
OLD | NEW |