summaryrefslogtreecommitdiffstats
path: root/chrome/views
diff options
context:
space:
mode:
authortc@google.com <tc@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-03-27 23:07:30 +0000
committertc@google.com <tc@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-03-27 23:07:30 +0000
commit2e4bdcdc8cdbffe656700a4028679f0569ad6245 (patch)
tree633b08aad2d776a54eda7296bf2af2ee6aa52e0c /chrome/views
parent698835d3e64c96bb5e7a29ab66d2ecbee375fc63 (diff)
downloadchromium_src-2e4bdcdc8cdbffe656700a4028679f0569ad6245.zip
chromium_src-2e4bdcdc8cdbffe656700a4028679f0569ad6245.tar.gz
chromium_src-2e4bdcdc8cdbffe656700a4028679f0569ad6245.tar.bz2
Move message flags into a separate header that can be used
outside the views system. Mac will need this as well when implementing message boxes. Review URL: http://codereview.chromium.org/56026 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@12722 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/views')
-rw-r--r--chrome/views/controls/message_box_view.cc5
-rw-r--r--chrome/views/controls/message_box_view.h31
2 files changed, 3 insertions, 33 deletions
diff --git a/chrome/views/controls/message_box_view.cc b/chrome/views/controls/message_box_view.cc
index 6a57480..7fc4a26 100644
--- a/chrome/views/controls/message_box_view.cc
+++ b/chrome/views/controls/message_box_view.cc
@@ -8,6 +8,7 @@
#include "base/string_util.h"
#include "chrome/browser/views/standard_layout.h"
#include "chrome/common/l10n_util.h"
+#include "chrome/common/message_box_flags.h"
#include "chrome/views/controls/button/checkbox.h"
#include "chrome/views/window/client_view.h"
#include "grit/generated_resources.h"
@@ -92,7 +93,7 @@ void MessageBoxView::ViewHierarchyChanged(bool is_add,
void MessageBoxView::Init(int dialog_flags,
const std::wstring& default_prompt) {
message_label_->SetMultiLine(true);
- if (dialog_flags & kAutoDetectAlignment) {
+ if (dialog_flags & MessageBox::kAutoDetectAlignment) {
// Determine the alignment and directionality based on the first character
// with strong directionality.
l10n_util::TextDirection direction =
@@ -111,7 +112,7 @@ void MessageBoxView::Init(int dialog_flags,
message_label_->SetHorizontalAlignment(views::Label::ALIGN_LEFT);
}
- if (dialog_flags & kFlagHasPromptField) {
+ if (dialog_flags & MessageBox::kFlagHasPromptField) {
prompt_field_ = new views::TextField;
prompt_field_->SetText(default_prompt);
}
diff --git a/chrome/views/controls/message_box_view.h b/chrome/views/controls/message_box_view.h
index 43589a9..819b56a 100644
--- a/chrome/views/controls/message_box_view.h
+++ b/chrome/views/controls/message_box_view.h
@@ -22,37 +22,6 @@ class Checkbox;
// and Cancel buttons.
class MessageBoxView : public views::View {
public:
- // flags
- static const int kFlagHasOKButton = 0x1;
- static const int kFlagHasCancelButton = 0x2;
- static const int kFlagHasPromptField = 0x4;
- static const int kFlagHasMessage = 0x8;
-
- // The following flag is used to indicate whether the message's alignment
- // should be autodetected or inherited from Chrome UI. Callers should pass
- // the correct flag based on the origin of the message. If the message is
- // from a web page (such as the JavaScript alert message), its alignment and
- // directionality are based on the first character with strong directionality
- // in the message. Chrome UI strings are localized string and therefore they
- // should have the same alignment and directionality as those of the Chrome
- // UI. For example, in RTL locales, even though some strings might begin with
- // an English character, they should still be right aligned and be displayed
- // Right-To-Left.
- //
- // 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;
-
MessageBoxView(int dialog_flags,
const std::wstring& message,
const std::wstring& default_prompt,