OLD | NEW |
---|---|
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 320 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
331 | 331 |
332 void DialogClientView::CreateFootnoteView() { | 332 void DialogClientView::CreateFootnoteView() { |
333 if (footnote_view_) | 333 if (footnote_view_) |
334 return; | 334 return; |
335 | 335 |
336 footnote_view_ = GetDialogDelegate()->CreateFootnoteView(); | 336 footnote_view_ = GetDialogDelegate()->CreateFootnoteView(); |
337 if (footnote_view_) | 337 if (footnote_view_) |
338 AddChildView(footnote_view_); | 338 AddChildView(footnote_view_); |
339 } | 339 } |
340 | 340 |
341 void DialogClientView::ChildPreferredSizeChanged(View* child) { | |
Evan Stade
2013/05/07 22:25:11
yes, but also for ChildVisibilityChanged()
Dan Beam
2013/05/08 00:54:10
Done.
| |
342 if (child == footnote_view_ || child == extra_view_) | |
343 Layout(); | |
344 } | |
345 | |
341 //////////////////////////////////////////////////////////////////////////////// | 346 //////////////////////////////////////////////////////////////////////////////// |
342 // DialogClientView, private: | 347 // DialogClientView, private: |
343 | 348 |
344 LabelButton* DialogClientView::CreateDialogButton(ui::DialogButton type) { | 349 LabelButton* DialogClientView::CreateDialogButton(ui::DialogButton type) { |
345 const string16 title = GetDialogDelegate()->GetDialogButtonLabel(type); | 350 const string16 title = GetDialogDelegate()->GetDialogButtonLabel(type); |
346 LabelButton* button = new LabelButton(this, title); | 351 LabelButton* button = new LabelButton(this, title); |
347 button->SetStyle(Button::STYLE_NATIVE_TEXTBUTTON); | 352 button->SetStyle(Button::STYLE_NATIVE_TEXTBUTTON); |
348 button->set_focusable(true); | 353 button->set_focusable(true); |
349 | 354 |
350 const int kDialogMinButtonWidth = 75; | 355 const int kDialogMinButtonWidth = 75; |
(...skipping 26 matching lines...) Expand all Loading... | |
377 gfx::Insets(0, kButtonHEdgeMargin, | 382 gfx::Insets(0, kButtonHEdgeMargin, |
378 kButtonVEdgeMargin, kButtonHEdgeMargin); | 383 kButtonVEdgeMargin, kButtonHEdgeMargin); |
379 } | 384 } |
380 | 385 |
381 void DialogClientView::Close() { | 386 void DialogClientView::Close() { |
382 GetWidget()->Close(); | 387 GetWidget()->Close(); |
383 GetDialogDelegate()->OnClose(); | 388 GetDialogDelegate()->OnClose(); |
384 } | 389 } |
385 | 390 |
386 } // namespace views | 391 } // namespace views |
OLD | NEW |