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 "build/build_config.h" | 9 #include "build/build_config.h" |
10 #include "ui/events/keycodes/keyboard_codes.h" | 10 #include "ui/events/keycodes/keyboard_codes.h" |
(...skipping 378 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
389 const base::string16 title = GetDialogDelegate()->GetDialogButtonLabel(type); | 389 const base::string16 title = GetDialogDelegate()->GetDialogButtonLabel(type); |
390 LabelButton* button = NULL; | 390 LabelButton* button = NULL; |
391 if (GetDialogDelegate()->UseNewStyleForThisDialog() && | 391 if (GetDialogDelegate()->UseNewStyleForThisDialog() && |
392 GetDialogDelegate()->GetDefaultDialogButton() == type && | 392 GetDialogDelegate()->GetDefaultDialogButton() == type && |
393 GetDialogDelegate()->ShouldDefaultButtonBeBlue()) { | 393 GetDialogDelegate()->ShouldDefaultButtonBeBlue()) { |
394 button = new BlueButton(this, title); | 394 button = new BlueButton(this, title); |
395 } else { | 395 } else { |
396 button = new LabelButton(this, title); | 396 button = new LabelButton(this, title); |
397 button->SetStyle(Button::STYLE_BUTTON); | 397 button->SetStyle(Button::STYLE_BUTTON); |
398 } | 398 } |
| 399 |
| 400 #if !defined(OS_MACOSX) |
399 button->SetFocusable(true); | 401 button->SetFocusable(true); |
| 402 #else |
| 403 button->SetFocusable(false); |
| 404 button->SetAccessibilityFocusable(true); |
| 405 #endif |
400 | 406 |
401 const int kDialogMinButtonWidth = 75; | 407 const int kDialogMinButtonWidth = 75; |
402 button->SetMinSize(gfx::Size(kDialogMinButtonWidth, 0)); | 408 button->SetMinSize(gfx::Size(kDialogMinButtonWidth, 0)); |
403 button->SetGroup(kButtonGroup); | 409 button->SetGroup(kButtonGroup); |
404 return button; | 410 return button; |
405 } | 411 } |
406 | 412 |
407 void DialogClientView::UpdateButton(LabelButton* button, | 413 void DialogClientView::UpdateButton(LabelButton* button, |
408 ui::DialogButton type) { | 414 ui::DialogButton type) { |
409 DialogDelegate* dialog = GetDialogDelegate(); | 415 DialogDelegate* dialog = GetDialogDelegate(); |
(...skipping 21 matching lines...) Expand all Loading... |
431 gfx::Insets(0, kButtonHEdgeMarginNew, | 437 gfx::Insets(0, kButtonHEdgeMarginNew, |
432 kButtonVEdgeMarginNew, kButtonHEdgeMarginNew); | 438 kButtonVEdgeMarginNew, kButtonHEdgeMarginNew); |
433 } | 439 } |
434 | 440 |
435 void DialogClientView::Close() { | 441 void DialogClientView::Close() { |
436 GetWidget()->Close(); | 442 GetWidget()->Close(); |
437 GetDialogDelegate()->OnClosed(); | 443 GetDialogDelegate()->OnClosed(); |
438 } | 444 } |
439 | 445 |
440 } // namespace views | 446 } // namespace views |
OLD | NEW |