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/events/keycodes/keyboard_codes.h" | 9 #include "ui/events/keycodes/keyboard_codes.h" |
10 #include "ui/views/controls/button/blue_button.h" | 10 #include "ui/views/controls/button/blue_button.h" |
(...skipping 350 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
361 const string16 title = GetDialogDelegate()->GetDialogButtonLabel(type); | 361 const string16 title = GetDialogDelegate()->GetDialogButtonLabel(type); |
362 LabelButton* button = NULL; | 362 LabelButton* button = NULL; |
363 if (GetDialogDelegate()->UseNewStyleForThisDialog() && | 363 if (GetDialogDelegate()->UseNewStyleForThisDialog() && |
364 GetDialogDelegate()->GetDefaultDialogButton() == type && | 364 GetDialogDelegate()->GetDefaultDialogButton() == type && |
365 GetDialogDelegate()->ShouldDefaultButtonBeBlue()) { | 365 GetDialogDelegate()->ShouldDefaultButtonBeBlue()) { |
366 button = new BlueButton(this, title); | 366 button = new BlueButton(this, title); |
367 } else { | 367 } else { |
368 button = new LabelButton(this, title); | 368 button = new LabelButton(this, title); |
369 button->SetStyle(Button::STYLE_NATIVE_TEXTBUTTON); | 369 button->SetStyle(Button::STYLE_NATIVE_TEXTBUTTON); |
370 } | 370 } |
371 button->set_focusable(true); | 371 button->SetFocusable(true); |
372 | 372 |
373 const int kDialogMinButtonWidth = 75; | 373 const int kDialogMinButtonWidth = 75; |
374 button->set_min_size(gfx::Size(kDialogMinButtonWidth, 0)); | 374 button->set_min_size(gfx::Size(kDialogMinButtonWidth, 0)); |
375 button->SetGroup(kButtonGroup); | 375 button->SetGroup(kButtonGroup); |
376 return button; | 376 return button; |
377 } | 377 } |
378 | 378 |
379 void DialogClientView::UpdateButton(LabelButton* button, | 379 void DialogClientView::UpdateButton(LabelButton* button, |
380 ui::DialogButton type) { | 380 ui::DialogButton type) { |
381 DialogDelegate* dialog = GetDialogDelegate(); | 381 DialogDelegate* dialog = GetDialogDelegate(); |
(...skipping 21 matching lines...) Expand all Loading... |
403 gfx::Insets(0, kButtonHEdgeMarginNew, | 403 gfx::Insets(0, kButtonHEdgeMarginNew, |
404 kButtonVEdgeMarginNew, kButtonHEdgeMarginNew); | 404 kButtonVEdgeMarginNew, kButtonHEdgeMarginNew); |
405 } | 405 } |
406 | 406 |
407 void DialogClientView::Close() { | 407 void DialogClientView::Close() { |
408 GetWidget()->Close(); | 408 GetWidget()->Close(); |
409 GetDialogDelegate()->OnClosed(); | 409 GetDialogDelegate()->OnClosed(); |
410 } | 410 } |
411 | 411 |
412 } // namespace views | 412 } // namespace views |
OLD | NEW |