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