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

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: Combined if clauses. Created 8 years, 2 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') | ui/views/window/dialog_delegate.h » ('j') | 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 241 matching lines...) Expand 10 before | Expand all | Expand 10 after
252 /////////////////////////////////////////////////////////////////////////////// 252 ///////////////////////////////////////////////////////////////////////////////
253 // DialogClientView, ClientView overrides: 253 // DialogClientView, ClientView overrides:
254 254
255 bool DialogClientView::CanClose() { 255 bool DialogClientView::CanClose() {
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 (buttons == ui::DIALOG_BUTTON_NONE))
263 close = dd->Cancel(); 264 close = dd->Cancel();
264 else if (buttons & ui::DIALOG_BUTTON_OK) 265 else if (buttons & ui::DIALOG_BUTTON_OK)
265 close = dd->Accept(true); 266 close = dd->Accept(true);
266 notified_delegate_ = close; 267 notified_delegate_ = close;
267 return close; 268 return close;
268 } 269 }
269 270
270 void DialogClientView::WidgetClosing() { 271 void DialogClientView::WidgetClosing() {
271 if (listening_to_focus_) { 272 if (listening_to_focus_) {
272 DCHECK(saved_focus_manager_); 273 DCHECK(saved_focus_manager_);
(...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after
522 } 523 }
523 saved_focus_manager_ = focus_manager; 524 saved_focus_manager_ = focus_manager;
524 // Listen for focus change events so we can update the default button. 525 // Listen for focus change events so we can update the default button.
525 if (focus_manager) { 526 if (focus_manager) {
526 focus_manager->AddFocusChangeListener(this); 527 focus_manager->AddFocusChangeListener(this);
527 listening_to_focus_ = true; 528 listening_to_focus_ = true;
528 } 529 }
529 } 530 }
530 531
531 } // namespace views 532 } // namespace views
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/web_intent_picker_views.cc ('k') | ui/views/window/dialog_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698