OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2009 Google Inc. All rights reserved. | 2 * Copyright (C) 2009 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 are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * 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 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 1342 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1353 return; | 1353 return; |
1354 } | 1354 } |
1355 frame()->inputMethodController().extendSelectionAndDelete(before, after); | 1355 frame()->inputMethodController().extendSelectionAndDelete(before, after); |
1356 } | 1356 } |
1357 | 1357 |
1358 void WebLocalFrameImpl::setCaretVisible(bool visible) | 1358 void WebLocalFrameImpl::setCaretVisible(bool visible) |
1359 { | 1359 { |
1360 frame()->selection().setCaretVisible(visible); | 1360 frame()->selection().setCaretVisible(visible); |
1361 } | 1361 } |
1362 | 1362 |
| 1363 void WebLocalFrameImpl::clearFocus() |
| 1364 { |
| 1365 if (!frame()->page()) |
| 1366 return; |
| 1367 |
| 1368 // This uses setFocusedElement rather than setFocusedFrame so that blur |
| 1369 // events are properly dispatched on any currently focused elements. |
| 1370 frame()->page()->focusController().setFocusedElement(nullptr, nullptr); |
| 1371 } |
| 1372 |
1363 VisiblePosition WebLocalFrameImpl::visiblePositionForViewportPoint(const WebPoin
t& pointInViewport) | 1373 VisiblePosition WebLocalFrameImpl::visiblePositionForViewportPoint(const WebPoin
t& pointInViewport) |
1364 { | 1374 { |
1365 return visiblePositionForContentsPoint(frame()->view()->viewportToContents(p
ointInViewport), frame()); | 1375 return visiblePositionForContentsPoint(frame()->view()->viewportToContents(p
ointInViewport), frame()); |
1366 } | 1376 } |
1367 | 1377 |
1368 WebPlugin* WebLocalFrameImpl::focusedPluginIfInputMethodSupported() | 1378 WebPlugin* WebLocalFrameImpl::focusedPluginIfInputMethodSupported() |
1369 { | 1379 { |
1370 WebPluginContainerImpl* container = WebLocalFrameImpl::pluginContainerFromNo
de(frame(), WebNode(frame()->document()->focusedElement())); | 1380 WebPluginContainerImpl* container = WebLocalFrameImpl::pluginContainerFromNo
de(frame(), WebNode(frame()->document()->focusedElement())); |
1371 if (container && container->supportsInputMethod()) | 1381 if (container && container->supportsInputMethod()) |
1372 return container->plugin(); | 1382 return container->plugin(); |
(...skipping 818 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2191 } | 2201 } |
2192 | 2202 |
2193 WebSandboxFlags WebLocalFrameImpl::effectiveSandboxFlags() const | 2203 WebSandboxFlags WebLocalFrameImpl::effectiveSandboxFlags() const |
2194 { | 2204 { |
2195 if (!frame()) | 2205 if (!frame()) |
2196 return WebSandboxFlags::None; | 2206 return WebSandboxFlags::None; |
2197 return static_cast<WebSandboxFlags>(frame()->loader().effectiveSandboxFlags(
)); | 2207 return static_cast<WebSandboxFlags>(frame()->loader().effectiveSandboxFlags(
)); |
2198 } | 2208 } |
2199 | 2209 |
2200 } // namespace blink | 2210 } // namespace blink |
OLD | NEW |