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