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

Side by Side Diff: ui/views/window/dialog_client_view.cc

Issue 12543032: Add views::RichLabel, a class which creates multi-line text with mixed (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: compile Created 7 years, 9 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 | « ui/views/views.gyp ('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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "ui/views/window/dialog_client_view.h" 5 #include "ui/views/window/dialog_client_view.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "ui/base/keycodes/keyboard_codes.h" 9 #include "ui/base/keycodes/keyboard_codes.h"
10 #include "ui/views/controls/button/label_button.h" 10 #include "ui/views/controls/button/label_button.h"
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after
175 size.set_width(std::max(size.width(), contents_size.width())); 175 size.set_width(std::max(size.width(), contents_size.width()));
176 return size; 176 return size;
177 } 177 }
178 178
179 void DialogClientView::Layout() { 179 void DialogClientView::Layout() {
180 gfx::Rect bounds = GetContentsBounds(); 180 gfx::Rect bounds = GetContentsBounds();
181 bounds.Inset(GetInsets()); 181 bounds.Inset(GetInsets());
182 182
183 // Layout the footnote view. 183 // Layout the footnote view.
184 if (footnote_view_) { 184 if (footnote_view_) {
185 const int height = footnote_view_->GetPreferredSize().height(); 185 const int height = footnote_view_->GetHeightForWidth(bounds.width());
186 footnote_view_->SetBounds(bounds.x(), bounds.bottom() - height, 186 footnote_view_->SetBounds(bounds.x(), bounds.bottom() - height,
187 bounds.width(), height); 187 bounds.width(), height);
188 bounds.Inset(0, 0, 0, height + kRelatedControlVerticalSpacing); 188 bounds.Inset(0, 0, 0, height + kRelatedControlVerticalSpacing);
189 } 189 }
190 190
191 // Layout the row containing the buttons and the extra view. 191 // Layout the row containing the buttons and the extra view.
192 if (has_dialog_buttons() || extra_view_) { 192 if (has_dialog_buttons() || extra_view_) {
193 const int height = GetButtonsAndExtraViewRowHeight(); 193 const int height = GetButtonsAndExtraViewRowHeight();
194 gfx::Rect row_bounds(bounds.x(), bounds.bottom() - height, 194 gfx::Rect row_bounds(bounds.x(), bounds.bottom() - height,
195 bounds.width(), height); 195 bounds.width(), height);
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after
329 DialogDelegate* DialogClientView::GetDialogDelegate() const { 329 DialogDelegate* DialogClientView::GetDialogDelegate() const {
330 return GetWidget()->widget_delegate()->AsDialogDelegate(); 330 return GetWidget()->widget_delegate()->AsDialogDelegate();
331 } 331 }
332 332
333 void DialogClientView::Close() { 333 void DialogClientView::Close() {
334 GetWidget()->Close(); 334 GetWidget()->Close();
335 GetDialogDelegate()->OnClose(); 335 GetDialogDelegate()->OnClose();
336 } 336 }
337 337
338 } // namespace views 338 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/views.gyp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698