Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(126)

Side by Side Diff: chrome/views/dialog_client_view.cc

Issue 40183: Guard against a crash that can impact Dialog boxes ... this one seems to have... (Closed) Base URL: svn://chrome-svn.corp.google.com/chrome/trunk/src/
Patch Set: Created 11 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 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 <windows.h> 5 #include <windows.h>
6 #include <uxtheme.h> 6 #include <uxtheme.h>
7 #include <vsstyle.h> 7 #include <vsstyle.h>
8 8
9 #include "chrome/views/dialog_client_view.h" 9 #include "chrome/views/dialog_client_view.h"
10 10
(...skipping 291 matching lines...) Expand 10 before | Expand all | Expand 10 after
302 bool DialogClientView::AcceleratorPressed(const Accelerator& accelerator) { 302 bool DialogClientView::AcceleratorPressed(const Accelerator& accelerator) {
303 DCHECK(accelerator.GetKeyCode() == VK_ESCAPE); // We only expect Escape key. 303 DCHECK(accelerator.GetKeyCode() == VK_ESCAPE); // We only expect Escape key.
304 window()->Close(); 304 window()->Close();
305 return true; 305 return true;
306 } 306 }
307 307
308 //////////////////////////////////////////////////////////////////////////////// 308 ////////////////////////////////////////////////////////////////////////////////
309 // DialogClientView, NativeButton::Listener implementation: 309 // DialogClientView, NativeButton::Listener implementation:
310 310
311 void DialogClientView::ButtonPressed(NativeButton* sender) { 311 void DialogClientView::ButtonPressed(NativeButton* sender) {
312 // We NULL check the delegate here since the buttons can receive WM_COMMAND
313 // messages even after they (and the window containing us) are destroyed.
314 if (GetDialogDelegate())
Mark Larson 2009/03/06 00:34:40 Should this be !GetDialogDelegate() ?
315 return;
316
312 if (sender == ok_button_) { 317 if (sender == ok_button_) {
313 AcceptWindow(); 318 AcceptWindow();
314 } else if (sender == cancel_button_) { 319 } else if (sender == cancel_button_) {
315 CancelWindow(); 320 CancelWindow();
316 } else { 321 } else {
317 NOTREACHED(); 322 NOTREACHED();
318 } 323 }
319 } 324 }
320 325
321 //////////////////////////////////////////////////////////////////////////////// 326 ////////////////////////////////////////////////////////////////////////////////
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
426 static bool initialized = false; 431 static bool initialized = false;
427 if (!initialized) { 432 if (!initialized) {
428 ResourceBundle& rb = ResourceBundle::GetSharedInstance(); 433 ResourceBundle& rb = ResourceBundle::GetSharedInstance();
429 dialog_button_font_ = rb.GetFont(ResourceBundle::BaseFont); 434 dialog_button_font_ = rb.GetFont(ResourceBundle::BaseFont);
430 initialized = true; 435 initialized = true;
431 } 436 }
432 } 437 }
433 438
434 } // namespace views 439 } // namespace views
435 440
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698