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

Side by Side Diff: ui/views/window/dialog_client_view.cc

Issue 10965052: Provide hook to abort dialog cancellation, disable cancellation during install. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 3 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 | Annotate | Revision Log
« no previous file with comments | « chrome/browser/ui/views/web_intent_picker_views.cc ('k') | 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) 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
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
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
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/web_intent_picker_views.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698