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

Side by Side Diff: third_party/WebKit/Source/core/input/EventHandler.cpp

Issue 1420693006: Introduce a struct to store arguments of Element::focus(). (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) 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserv ed. 2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserv ed.
3 * Copyright (C) 2006 Alexey Proskuryakov (ap@webkit.org) 3 * Copyright (C) 2006 Alexey Proskuryakov (ap@webkit.org)
4 * Copyright (C) 2012 Digia Plc. and/or its subsidiary(-ies) 4 * Copyright (C) 2012 Digia Plc. and/or its subsidiary(-ies)
5 * 5 *
6 * Redistribution and use in source and binary forms, with or without 6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions 7 * modification, are permitted provided that the following conditions
8 * are met: 8 * are met:
9 * 1. Redistributions of source code must retain the above copyright 9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 1819 matching lines...) Expand 10 before | Expand all | Expand 10 after
1830 // If the inner element is already focused, do nothing. 1830 // If the inner element is already focused, do nothing.
1831 return true; 1831 return true;
1832 } 1832 }
1833 1833
1834 // If the host has a focusable inner element, focus it. Otherwise, the h ost takes focus. 1834 // If the host has a focusable inner element, focus it. Otherwise, the h ost takes focus.
1835 Page* page = m_frame->page(); 1835 Page* page = m_frame->page();
1836 ASSERT(page); 1836 ASSERT(page);
1837 Element* next = page->focusController().findFocusableElement(WebFocusTyp eForward, *element.authorShadowRoot()); 1837 Element* next = page->focusController().findFocusableElement(WebFocusTyp eForward, *element.authorShadowRoot());
1838 if (next && element.containsIncludingShadowDOM(next)) { 1838 if (next && element.containsIncludingShadowDOM(next)) {
1839 // Use WebFocusTypeForward instead of WebFocusTypeMouse here to mean the focus has slided. 1839 // Use WebFocusTypeForward instead of WebFocusTypeMouse here to mean the focus has slided.
1840 next->focus(false, WebFocusTypeForward); 1840 next->focus(FocusParams(SelectionBehaviorOnFocus::Reset, WebFocusTyp eForward, nullptr));
1841 return true; 1841 return true;
1842 } 1842 }
1843 } 1843 }
1844 return false; 1844 return false;
1845 } 1845 }
1846 1846
1847 namespace { 1847 namespace {
1848 1848
1849 ScrollResult scrollAreaWithWheelEvent(const PlatformWheelEvent& event, Scrollabl eArea& scrollableArea) 1849 ScrollResult scrollAreaWithWheelEvent(const PlatformWheelEvent& event, Scrollabl eArea& scrollableArea)
1850 { 1850 {
(...skipping 2221 matching lines...) Expand 10 before | Expand all | Expand 10 after
4072 PlatformEvent::Modifiers EventHandler::accessKeyModifiers() 4072 PlatformEvent::Modifiers EventHandler::accessKeyModifiers()
4073 { 4073 {
4074 #if OS(MACOSX) 4074 #if OS(MACOSX)
4075 return static_cast<PlatformEvent::Modifiers>(PlatformEvent::CtrlKey | Platfo rmEvent::AltKey); 4075 return static_cast<PlatformEvent::Modifiers>(PlatformEvent::CtrlKey | Platfo rmEvent::AltKey);
4076 #else 4076 #else
4077 return PlatformEvent::AltKey; 4077 return PlatformEvent::AltKey;
4078 #endif 4078 #endif
4079 } 4079 }
4080 4080
4081 } // namespace blink 4081 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698