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

Side by Side Diff: chrome/views/controls/message_box_view.cc

Issue 100013: Allow words to be wrapped in message box.... (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: '' Created 11 years, 7 months 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 | « chrome/views/controls/label.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/views/controls/message_box_view.h" 5 #include "chrome/views/controls/message_box_view.h"
6 6
7 #include "base/message_loop.h" 7 #include "base/message_loop.h"
8 #include "base/scoped_clipboard_writer.h" 8 #include "base/scoped_clipboard_writer.h"
9 #include "base/string_util.h" 9 #include "base/string_util.h"
10 #include "chrome/browser/browser_process.h" 10 #include "chrome/browser/browser_process.h"
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
103 scw.WriteText(message_label_->GetText()); 103 scw.WriteText(message_label_->GetText());
104 return true; 104 return true;
105 } 105 }
106 106
107 /////////////////////////////////////////////////////////////////////////////// 107 ///////////////////////////////////////////////////////////////////////////////
108 // MessageBoxView, private: 108 // MessageBoxView, private:
109 109
110 void MessageBoxView::Init(int dialog_flags, 110 void MessageBoxView::Init(int dialog_flags,
111 const std::wstring& default_prompt) { 111 const std::wstring& default_prompt) {
112 message_label_->SetMultiLine(true); 112 message_label_->SetMultiLine(true);
113 message_label_->SetAllowCharacterBreak(true);
113 if (dialog_flags & MessageBoxFlags::kAutoDetectAlignment) { 114 if (dialog_flags & MessageBoxFlags::kAutoDetectAlignment) {
114 // Determine the alignment and directionality based on the first character 115 // Determine the alignment and directionality based on the first character
115 // with strong directionality. 116 // with strong directionality.
116 l10n_util::TextDirection direction = 117 l10n_util::TextDirection direction =
117 l10n_util::GetFirstStrongCharacterDirection(message_label_->GetText()); 118 l10n_util::GetFirstStrongCharacterDirection(message_label_->GetText());
118 views::Label::Alignment alignment; 119 views::Label::Alignment alignment;
119 if (direction == l10n_util::RIGHT_TO_LEFT) 120 if (direction == l10n_util::RIGHT_TO_LEFT)
120 alignment = views::Label::ALIGN_RIGHT; 121 alignment = views::Label::ALIGN_RIGHT;
121 else 122 else
122 alignment = views::Label::ALIGN_LEFT; 123 alignment = views::Label::ALIGN_LEFT;
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
199 } 200 }
200 201
201 if (checkbox_) { 202 if (checkbox_) {
202 layout->AddPaddingRow(0, kRelatedControlVerticalSpacing); 203 layout->AddPaddingRow(0, kRelatedControlVerticalSpacing);
203 layout->StartRow(0, checkbox_column_view_set_id); 204 layout->StartRow(0, checkbox_column_view_set_id);
204 layout->AddView(checkbox_); 205 layout->AddView(checkbox_);
205 } 206 }
206 207
207 layout->AddPaddingRow(0, kRelatedControlVerticalSpacing); 208 layout->AddPaddingRow(0, kRelatedControlVerticalSpacing);
208 } 209 }
OLDNEW
« no previous file with comments | « chrome/views/controls/label.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698