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

Side by Side Diff: third_party/WebKit/Source/modules/accessibility/AXNodeObject.cpp

Issue 1433103002: Use FocusParams in FocusController::setFocusedElement and Document::setFocusedElement arguments. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 1 month 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2012, Google Inc. All rights reserved. 2 * Copyright (C) 2012, Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 7 *
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 2367 matching lines...) Expand 10 before | Expand all | Expand 10 after
2378 return Traversal<HTMLLabelElement>::firstAncestorOrSelf(*node()); 2378 return Traversal<HTMLLabelElement>::firstAncestorOrSelf(*node());
2379 } 2379 }
2380 2380
2381 void AXNodeObject::setFocused(bool on) 2381 void AXNodeObject::setFocused(bool on)
2382 { 2382 {
2383 if (!canSetFocusAttribute()) 2383 if (!canSetFocusAttribute())
2384 return; 2384 return;
2385 2385
2386 Document* document = this->document(); 2386 Document* document = this->document();
2387 if (!on) { 2387 if (!on) {
2388 document->setFocusedElement(nullptr); 2388 document->clearFocusedElement();
2389 } else { 2389 } else {
2390 Node* node = this->node(); 2390 Node* node = this->node();
2391 if (node && node->isElementNode()) { 2391 if (node && node->isElementNode()) {
2392 // If this node is already the currently focused node, then calling focus() won't do anything. 2392 // If this node is already the currently focused node, then calling focus() won't do anything.
2393 // That is a problem when focus is removed from the webpage to chrom e, and then returns. 2393 // That is a problem when focus is removed from the webpage to chrom e, and then returns.
2394 // In these cases, we need to do what keyboard and mouse focus do, w hich is reset focus first. 2394 // In these cases, we need to do what keyboard and mouse focus do, w hich is reset focus first.
2395 if (document->focusedElement() == node) 2395 if (document->focusedElement() == node)
2396 document->setFocusedElement(nullptr); 2396 document->clearFocusedElement();
2397 2397
2398 toElement(node)->focus(); 2398 toElement(node)->focus();
2399 } else { 2399 } else {
2400 document->setFocusedElement(nullptr); 2400 document->clearFocusedElement();
2401 } 2401 }
2402 } 2402 }
2403 } 2403 }
2404 2404
2405 void AXNodeObject::increment() 2405 void AXNodeObject::increment()
2406 { 2406 {
2407 UserGestureIndicator gestureIndicator(DefinitelyProcessingNewUserGesture); 2407 UserGestureIndicator gestureIndicator(DefinitelyProcessingNewUserGesture);
2408 alterSliderValue(true); 2408 alterSliderValue(true);
2409 } 2409 }
2410 2410
(...skipping 700 matching lines...) Expand 10 before | Expand all | Expand 10 after
3111 return String(); 3111 return String();
3112 } 3112 }
3113 3113
3114 DEFINE_TRACE(AXNodeObject) 3114 DEFINE_TRACE(AXNodeObject)
3115 { 3115 {
3116 visitor->trace(m_node); 3116 visitor->trace(m_node);
3117 AXObject::trace(visitor); 3117 AXObject::trace(visitor);
3118 } 3118 }
3119 3119
3120 } // namespace blin 3120 } // namespace blin
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/testing/Internals.cpp ('k') | third_party/WebKit/Source/web/TextFinder.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698