Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(386)

Side by Side Diff: ui/base/message_box_flags.h

Issue 8553001: views: Add an Options enum to MessageBoxView control. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: adding an IPC_MESSAGE_EXPORT to line 30 of param_traits_macro.h makes it link in shared build Created 9 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « ui/base/javascript_message_type.h ('k') | ui/ui.gyp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2011 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 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_
OLDNEW
« no previous file with comments | « ui/base/javascript_message_type.h ('k') | ui/ui.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698