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

Side by Side Diff: ui/views/focus/focus_manager.cc

Issue 9021002: views: Rename IsAccessibilityFocusableInRootView() to just IsAccessibilityFocusable(). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years 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 | « ui/views/controls/button/text_button.cc ('k') | ui/views/focus/focus_search.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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/focus/focus_manager.h" 5 #include "ui/views/focus/focus_manager.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/auto_reset.h" 9 #include "base/auto_reset.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 279 matching lines...) Expand 10 before | Expand all | Expand 10 after
290 ViewStorage* view_storage = ViewStorage::GetInstance(); 290 ViewStorage* view_storage = ViewStorage::GetInstance();
291 if (!view_storage) { 291 if (!view_storage) {
292 // This should never happen but bug 981648 seems to indicate it could. 292 // This should never happen but bug 981648 seems to indicate it could.
293 NOTREACHED(); 293 NOTREACHED();
294 return; 294 return;
295 } 295 }
296 296
297 View* view = view_storage->RetrieveView(stored_focused_view_storage_id_); 297 View* view = view_storage->RetrieveView(stored_focused_view_storage_id_);
298 if (view) { 298 if (view) {
299 if (ContainsView(view)) { 299 if (ContainsView(view)) {
300 if (!view->IsFocusable() && view->IsAccessibilityFocusableInRootView()) { 300 if (!view->IsFocusable() && view->IsAccessibilityFocusable()) {
301 // RequestFocus would fail, but we want to restore focus to controls 301 // RequestFocus would fail, but we want to restore focus to controls
302 // that had focus in accessibility mode. 302 // that had focus in accessibility mode.
303 SetFocusedViewWithReason(view, kReasonFocusRestore); 303 SetFocusedViewWithReason(view, kReasonFocusRestore);
304 } else { 304 } else {
305 // This usually just sets the focus if this view is focusable, but 305 // This usually just sets the focus if this view is focusable, but
306 // let the view override RequestFocus if necessary. 306 // let the view override RequestFocus if necessary.
307 view->RequestFocus(); 307 view->RequestFocus();
308 308
309 // If it succeeded, the reason would be incorrect; set it to 309 // If it succeeded, the reason would be incorrect; set it to
310 // focus restore. 310 // focus restore.
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
399 399
400 void FocusManager::AddFocusChangeListener(FocusChangeListener* listener) { 400 void FocusManager::AddFocusChangeListener(FocusChangeListener* listener) {
401 focus_change_listeners_.AddObserver(listener); 401 focus_change_listeners_.AddObserver(listener);
402 } 402 }
403 403
404 void FocusManager::RemoveFocusChangeListener(FocusChangeListener* listener) { 404 void FocusManager::RemoveFocusChangeListener(FocusChangeListener* listener) {
405 focus_change_listeners_.RemoveObserver(listener); 405 focus_change_listeners_.RemoveObserver(listener);
406 } 406 }
407 407
408 } // namespace views 408 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/controls/button/text_button.cc ('k') | ui/views/focus/focus_search.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698