| OLD | NEW |
| (Empty) |
| 1 // Copyright (c) 2009 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 APP_MESSAGE_BOX_FLAGS_H_ | |
| 6 #define APP_MESSAGE_BOX_FLAGS_H_ | |
| 7 #pragma once | |
| 8 | |
| 9 #include "base/basictypes.h" | |
| 10 | |
| 11 // This class contains flags used to communicate the type of message box | |
| 12 // to show. E.g., the renderer can request the browser to show a | |
| 13 // javascript alert or a javascript confirm message. | |
| 14 class MessageBoxFlags { | |
| 15 public: | |
| 16 static const int kFlagHasOKButton = 0x1; | |
| 17 static const int kFlagHasCancelButton = 0x2; | |
| 18 static const int kFlagHasPromptField = 0x4; | |
| 19 static const int kFlagHasMessage = 0x8; | |
| 20 | |
| 21 // The following flag is used to indicate whether the message's alignment | |
| 22 // should be autodetected or inherited from Chrome UI. Callers should pass | |
| 23 // the correct flag based on the origin of the message. If the message is | |
| 24 // from a web page (such as the JavaScript alert message), its alignment and | |
| 25 // directionality are based on the first character with strong directionality | |
| 26 // in the message. Chrome UI strings are localized string and therefore they | |
| 27 // should have the same alignment and directionality as those of the Chrome | |
| 28 // UI. For example, in RTL locales, even though some strings might begin with | |
| 29 // an English character, they should still be right aligned and be displayed | |
| 30 // Right-To-Left. | |
| 31 // | |
| 32 // TODO(xji): If the message is from a web page, then the message | |
| 33 // directionality should be determined based on the directionality of the web | |
| 34 // page. Please refer to http://crbug.com/7166 for more information. | |
| 35 static const int kAutoDetectAlignment = 0x10; | |
| 36 | |
| 37 static const int kIsConfirmMessageBox = kFlagHasMessage | | |
| 38 kFlagHasOKButton | | |
| 39 kFlagHasCancelButton; | |
| 40 static const int kIsJavascriptAlert = kFlagHasOKButton | kFlagHasMessage; | |
| 41 static const int kIsJavascriptConfirm = kIsJavascriptAlert | | |
| 42 kFlagHasCancelButton; | |
| 43 static const int kIsJavascriptPrompt = kIsJavascriptConfirm | | |
| 44 kFlagHasPromptField; | |
| 45 | |
| 46 // Dialog button identifiers used to specify which buttons to show the user. | |
| 47 enum DialogButton { | |
| 48 DIALOGBUTTON_NONE = 0, // No dialog buttons, for WindowType == WINDOW. | |
| 49 DIALOGBUTTON_OK = 1, // Has an OK button. | |
| 50 DIALOGBUTTON_CANCEL = 2, // Has a Cancel button (becomes a Close button if | |
| 51 }; // no OK button). | |
| 52 | |
| 53 private: | |
| 54 MessageBoxFlags() {} | |
| 55 DISALLOW_COPY_AND_ASSIGN(MessageBoxFlags); | |
| 56 }; | |
| 57 | |
| 58 #endif // APP_MESSAGE_BOX_FLAGS_H_ | |
| OLD | NEW |