Chromium Code Reviews| 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 245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 256 if (notified_delegate_) | 256 if (notified_delegate_) |
| 257 return true; | 257 return true; |
| 258 | 258 |
| 259 DialogDelegate* dd = GetDialogDelegate(); | 259 DialogDelegate* dd = GetDialogDelegate(); |
| 260 int buttons = dd->GetDialogButtons(); | 260 int buttons = dd->GetDialogButtons(); |
| 261 bool close = true; | 261 bool close = true; |
| 262 if (buttons & ui::DIALOG_BUTTON_CANCEL) | 262 if (buttons & ui::DIALOG_BUTTON_CANCEL) |
| 263 close = dd->Cancel(); | 263 close = dd->Cancel(); |
| 264 else if (buttons & ui::DIALOG_BUTTON_OK) | 264 else if (buttons & ui::DIALOG_BUTTON_OK) |
| 265 close = dd->Accept(true); | 265 close = dd->Accept(true); |
| 266 else if (buttons == ui::DIALOG_BUTTON_NONE) | |
|
sky
2012/09/24 13:50:42
combine this with 262.
Also, update the descriptio
groby-ooo-7-16
2012/09/25 17:27:11
Done.
Checked existing dialogs, and three use DIA
| |
| 267 close = dd->Cancel(); | |
| 266 notified_delegate_ = close; | 268 notified_delegate_ = close; |
| 267 return close; | 269 return close; |
| 268 } | 270 } |
| 269 | 271 |
| 270 void DialogClientView::WidgetClosing() { | 272 void DialogClientView::WidgetClosing() { |
| 271 if (listening_to_focus_) { | 273 if (listening_to_focus_) { |
| 272 DCHECK(saved_focus_manager_); | 274 DCHECK(saved_focus_manager_); |
| 273 if (saved_focus_manager_) | 275 if (saved_focus_manager_) |
| 274 saved_focus_manager_->RemoveFocusChangeListener(this); | 276 saved_focus_manager_->RemoveFocusChangeListener(this); |
| 275 } | 277 } |
| (...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 522 } | 524 } |
| 523 saved_focus_manager_ = focus_manager; | 525 saved_focus_manager_ = focus_manager; |
| 524 // Listen for focus change events so we can update the default button. | 526 // Listen for focus change events so we can update the default button. |
| 525 if (focus_manager) { | 527 if (focus_manager) { |
| 526 focus_manager->AddFocusChangeListener(this); | 528 focus_manager->AddFocusChangeListener(this); |
| 527 listening_to_focus_ = true; | 529 listening_to_focus_ = true; |
| 528 } | 530 } |
| 529 } | 531 } |
| 530 | 532 |
| 531 } // namespace views | 533 } // namespace views |
| OLD | NEW |