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/background.h" | 10 #include "ui/views/background.h" |
(...skipping 365 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
376 GetDialogDelegate()->GetDefaultDialogButton() == type && | 376 GetDialogDelegate()->GetDefaultDialogButton() == type && |
377 GetDialogDelegate()->ShouldDefaultButtonBeBlue()) { | 377 GetDialogDelegate()->ShouldDefaultButtonBeBlue()) { |
378 button = new BlueButton(this, title); | 378 button = new BlueButton(this, title); |
379 } else { | 379 } else { |
380 button = new LabelButton(this, title); | 380 button = new LabelButton(this, title); |
381 button->SetStyle(Button::STYLE_BUTTON); | 381 button->SetStyle(Button::STYLE_BUTTON); |
382 } | 382 } |
383 button->SetFocusable(true); | 383 button->SetFocusable(true); |
384 | 384 |
385 const int kDialogMinButtonWidth = 75; | 385 const int kDialogMinButtonWidth = 75; |
386 button->set_min_width(kDialogMinButtonWidth); | 386 button->set_min_size(gfx::Size(kDialogMinButtonWidth, 0)); |
387 button->SetGroup(kButtonGroup); | 387 button->SetGroup(kButtonGroup); |
388 return button; | 388 return button; |
389 } | 389 } |
390 | 390 |
391 void DialogClientView::UpdateButton(LabelButton* button, | 391 void DialogClientView::UpdateButton(LabelButton* button, |
392 ui::DialogButton type) { | 392 ui::DialogButton type) { |
393 DialogDelegate* dialog = GetDialogDelegate(); | 393 DialogDelegate* dialog = GetDialogDelegate(); |
394 button->SetText(dialog->GetDialogButtonLabel(type)); | 394 button->SetText(dialog->GetDialogButtonLabel(type)); |
395 button->SetEnabled(dialog->IsDialogButtonEnabled(type)); | 395 button->SetEnabled(dialog->IsDialogButtonEnabled(type)); |
396 | 396 |
(...skipping 18 matching lines...) Expand all Loading... |
415 gfx::Insets(0, kButtonHEdgeMarginNew, | 415 gfx::Insets(0, kButtonHEdgeMarginNew, |
416 kButtonVEdgeMarginNew, kButtonHEdgeMarginNew); | 416 kButtonVEdgeMarginNew, kButtonHEdgeMarginNew); |
417 } | 417 } |
418 | 418 |
419 void DialogClientView::Close() { | 419 void DialogClientView::Close() { |
420 GetWidget()->Close(); | 420 GetWidget()->Close(); |
421 GetDialogDelegate()->OnClosed(); | 421 GetDialogDelegate()->OnClosed(); |
422 } | 422 } |
423 | 423 |
424 } // namespace views | 424 } // namespace views |
OLD | NEW |