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

Unified Diff: ui/base/message_box_flags.h

Issue 8536026: Convert MessageBoxFlags class into an enum. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 1 month 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 side-by-side diff with in-line comments
Download patch
Index: ui/base/message_box_flags.h
diff --git a/ui/base/message_box_flags.h b/ui/base/message_box_flags.h
index 207a97c04c2223a1c88f6a3463bd816e218bc246..dfe1a788d2c12a998af7990d4cb11115487d6a0d 100644
--- a/ui/base/message_box_flags.h
+++ b/ui/base/message_box_flags.h
@@ -6,19 +6,16 @@
#define UI_BASE_MESSAGE_BOX_FLAGS_H_
#pragma once
-#include "base/basictypes.h"
-
namespace ui {
-// This class contains flags used to communicate the type of message box
-// to show. E.g., the renderer can request the browser to show a
-// javascript alert or a javascript confirm message.
-class MessageBoxFlags {
- public:
- static const int kFlagHasOKButton = 0x1;
- static const int kFlagHasCancelButton = 0x2;
- static const int kFlagHasPromptField = 0x4;
- static const int kFlagHasMessage = 0x8;
+// Flags used to communicate the type of message box to show. E.g., the renderer
+// can request the browser to show a javascript alert or a javascript confirm
+// message.
+enum MessageBoxFlags {
+ MESSAGE_BOX_HAS_OK_BUTTON = 1 << 0,
+ MESSAGE_BOX_HAS_CANCEL_BUTTON = 1 << 1,
+ MESSAGE_BOX_HAS_PROMPT_FIELD = 1 << 2,
+ MESSAGE_BOX_HAS_MESSAGE = 1 << 3,
// The following flag is used to indicate whether the message's alignment
// should be autodetected or inherited from Chrome UI. Callers should pass
@@ -34,19 +31,20 @@ class MessageBoxFlags {
// TODO(xji): If the message is from a web page, then the message
// directionality should be determined based on the directionality of the web
// page. Please refer to http://crbug.com/7166 for more information.
- static const int kAutoDetectAlignment = 0x10;
-
- static const int kIsConfirmMessageBox = kFlagHasMessage |
- kFlagHasOKButton |
- kFlagHasCancelButton;
- static const int kIsJavascriptAlert = kFlagHasOKButton | kFlagHasMessage;
- static const int kIsJavascriptConfirm = kIsJavascriptAlert |
- kFlagHasCancelButton;
- static const int kIsJavascriptPrompt = kIsJavascriptConfirm |
- kFlagHasPromptField;
-
- private:
- DISALLOW_IMPLICIT_CONSTRUCTORS(MessageBoxFlags);
+ MESSAGE_BOX_AUTO_DETECT_ALIGNMENT = 1 << 4,
+
+ MESSAGE_BOX_IS_CONFIRM_DIALOG = MESSAGE_BOX_HAS_MESSAGE |
sky 2011/11/12 00:11:55 The first 5 are appropriate for an enum, but the r
tfarina 2011/11/12 11:01:55 I really want to get rid of this class, really! I'
+ MESSAGE_BOX_HAS_OK_BUTTON |
+ MESSAGE_BOX_HAS_CANCEL_BUTTON,
+
+ MESSAGE_BOX_IS_JAVASCRIPT_ALERT_DIALOG = MESSAGE_BOX_HAS_OK_BUTTON |
+ MESSAGE_BOX_HAS_MESSAGE,
+
+ MESSAGE_BOX_IS_JAVASCRIPT_CONFIRM_DIALOG =
+ MESSAGE_BOX_IS_JAVASCRIPT_ALERT_DIALOG | MESSAGE_BOX_HAS_CANCEL_BUTTON,
+
+ MESSAGE_BOX_IS_JAVASCRIPT_PROMPT_DIALOG =
+ MESSAGE_BOX_IS_JAVASCRIPT_CONFIRM_DIALOG | MESSAGE_BOX_HAS_PROMPT_FIELD
};
} // namespace ui

Powered by Google App Engine
This is Rietveld 408576698