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

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

Issue 21439: Fix for focus traversal issue in Gears dialogs (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 10 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/views/dialog_delegate.h ('k') | chrome/views/hwnd_view.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) 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 "chrome/views/dialog_delegate.h" 5 #include "chrome/views/dialog_delegate.h"
6 6
7 #include "chrome/views/window.h" 7 #include "chrome/views/window.h"
8 8
9 namespace views { 9 namespace views {
10 10
11 // Overridden from WindowDelegate: 11 // Overridden from WindowDelegate:
12 12
13 int DialogDelegate::GetDefaultDialogButton() const { 13 int DialogDelegate::GetDefaultDialogButton() const {
14 if (GetDialogButtons() & DIALOGBUTTON_OK) 14 if (GetDialogButtons() & DIALOGBUTTON_OK)
15 return DIALOGBUTTON_OK; 15 return DIALOGBUTTON_OK;
16 if (GetDialogButtons() & DIALOGBUTTON_CANCEL) 16 if (GetDialogButtons() & DIALOGBUTTON_CANCEL)
17 return DIALOGBUTTON_CANCEL; 17 return DIALOGBUTTON_CANCEL;
18 return DIALOGBUTTON_NONE; 18 return DIALOGBUTTON_NONE;
19 } 19 }
20 20
21 View* DialogDelegate::GetInitiallyFocusedView() const { 21 View* DialogDelegate::GetInitiallyFocusedView() {
22 // Focus the default button if any. 22 // Focus the default button if any.
23 DialogClientView* dcv = GetDialogClientView(); 23 DialogClientView* dcv = GetDialogClientView();
24 int default_button = GetDefaultDialogButton(); 24 int default_button = GetDefaultDialogButton();
25 if (default_button == DIALOGBUTTON_NONE) 25 if (default_button == DIALOGBUTTON_NONE)
26 return NULL; 26 return NULL;
27 27
28 if ((default_button & GetDialogButtons()) == 0) { 28 if ((default_button & GetDialogButtons()) == 0) {
29 // The default button is a button we don't have. 29 // The default button is a button we don't have.
30 NOTREACHED(); 30 NOTREACHED();
31 return NULL; 31 return NULL;
(...skipping 12 matching lines...) Expand all
44 44
45 DialogClientView* DialogDelegate::GetDialogClientView() const { 45 DialogClientView* DialogDelegate::GetDialogClientView() const {
46 ClientView* client_view = window()->client_view(); 46 ClientView* client_view = window()->client_view();
47 DialogClientView* dialog_client_view = client_view->AsDialogClientView(); 47 DialogClientView* dialog_client_view = client_view->AsDialogClientView();
48 DCHECK(dialog_client_view); 48 DCHECK(dialog_client_view);
49 return dialog_client_view; 49 return dialog_client_view;
50 } 50 }
51 51
52 } // namespace views 52 } // namespace views
53 53
OLDNEW
« no previous file with comments | « chrome/views/dialog_delegate.h ('k') | chrome/views/hwnd_view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698