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 "build/build_config.h" | 7 #include "build/build_config.h" |
8 | 8 |
9 #if defined(OS_WIN) | 9 #if defined(OS_WIN) |
10 #include <windows.h> | 10 #include <windows.h> |
(...skipping 349 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
360 bool DialogClientView::AcceleratorPressed(const ui::Accelerator& accelerator) { | 360 bool DialogClientView::AcceleratorPressed(const ui::Accelerator& accelerator) { |
361 // We only expect Escape key. | 361 // We only expect Escape key. |
362 DCHECK(accelerator.key_code() == ui::VKEY_ESCAPE); | 362 DCHECK(accelerator.key_code() == ui::VKEY_ESCAPE); |
363 Close(); | 363 Close(); |
364 return true; | 364 return true; |
365 } | 365 } |
366 | 366 |
367 //////////////////////////////////////////////////////////////////////////////// | 367 //////////////////////////////////////////////////////////////////////////////// |
368 // DialogClientView, ButtonListener implementation: | 368 // DialogClientView, ButtonListener implementation: |
369 | 369 |
370 void DialogClientView::ButtonPressed( | 370 void DialogClientView::ButtonPressed(Button* sender, const ui::Event& event) { |
371 Button* sender, const views::Event& event) { | |
372 // We NULL check the delegate here since the buttons can receive WM_COMMAND | 371 // We NULL check the delegate here since the buttons can receive WM_COMMAND |
373 // messages even after they (and the window containing us) are destroyed. | 372 // messages even after they (and the window containing us) are destroyed. |
374 if (!GetDialogDelegate()) | 373 if (!GetDialogDelegate()) |
375 return; | 374 return; |
376 | 375 |
377 if (sender == ok_button_) { | 376 if (sender == ok_button_) { |
378 AcceptWindow(); | 377 AcceptWindow(); |
379 } else if (sender == cancel_button_) { | 378 } else if (sender == cancel_button_) { |
380 CancelWindow(); | 379 CancelWindow(); |
381 } else { | 380 } else { |
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
523 } | 522 } |
524 saved_focus_manager_ = focus_manager; | 523 saved_focus_manager_ = focus_manager; |
525 // Listen for focus change events so we can update the default button. | 524 // Listen for focus change events so we can update the default button. |
526 if (focus_manager) { | 525 if (focus_manager) { |
527 focus_manager->AddFocusChangeListener(this); | 526 focus_manager->AddFocusChangeListener(this); |
528 listening_to_focus_ = true; | 527 listening_to_focus_ = true; |
529 } | 528 } |
530 } | 529 } |
531 | 530 |
532 } // namespace views | 531 } // namespace views |
OLD | NEW |