Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright (C) 2011, 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2011, 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 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 2883 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2894 | 2894 |
| 2895 void WebViewImpl::focusDocumentView(WebFrame* frame) | 2895 void WebViewImpl::focusDocumentView(WebFrame* frame) |
| 2896 { | 2896 { |
| 2897 // This is currently only used when replicating focus changes for | 2897 // This is currently only used when replicating focus changes for |
| 2898 // cross-process frames, and |notifyEmbedder| is disabled to avoid sending | 2898 // cross-process frames, and |notifyEmbedder| is disabled to avoid sending |
| 2899 // duplicate frameFocused updates from FocusController to the browser | 2899 // duplicate frameFocused updates from FocusController to the browser |
| 2900 // process, which already knows the latest focused frame. | 2900 // process, which already knows the latest focused frame. |
| 2901 page()->focusController().focusDocumentView(frame->toImplBase()->frame(), fa lse /* notifyEmbedder */); | 2901 page()->focusController().focusDocumentView(frame->toImplBase()->frame(), fa lse /* notifyEmbedder */); |
| 2902 } | 2902 } |
| 2903 | 2903 |
| 2904 void WebViewImpl::unfocusDocumentView(WebFrame* frame) | |
| 2905 { | |
| 2906 if (page()->focusController().focusedFrame() == frame->toImplBase()->frame() ) { | |
|
avallee
2016/05/24 20:07:08
Had to bring this back. See reply to comment on pr
| |
| 2907 page()->focusController().focusDocumentView(nullptr /* frame */, false / * notifyEmbedder */); | |
| 2908 } | |
| 2909 } | |
| 2910 | |
| 2904 void WebViewImpl::setInitialFocus(bool reverse) | 2911 void WebViewImpl::setInitialFocus(bool reverse) |
| 2905 { | 2912 { |
| 2906 if (!m_page) | 2913 if (!m_page) |
| 2907 return; | 2914 return; |
| 2908 Frame* frame = page()->focusController().focusedOrMainFrame(); | 2915 Frame* frame = page()->focusController().focusedOrMainFrame(); |
| 2909 if (frame->isLocalFrame()) { | 2916 if (frame->isLocalFrame()) { |
| 2910 if (Document* document = toLocalFrame(frame)->document()) | 2917 if (Document* document = toLocalFrame(frame)->document()) |
| 2911 document->clearFocusedElement(); | 2918 document->clearFocusedElement(); |
| 2912 } | 2919 } |
| 2913 page()->focusController().setInitialFocus(reverse ? WebFocusTypeBackward : W ebFocusTypeForward); | 2920 page()->focusController().setInitialFocus(reverse ? WebFocusTypeBackward : W ebFocusTypeForward); |
| (...skipping 1610 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 4524 { | 4531 { |
| 4525 // TODO(oshima): Investigate if this should return the ScreenInfo's scale fa ctor rather than | 4532 // TODO(oshima): Investigate if this should return the ScreenInfo's scale fa ctor rather than |
| 4526 // page's scale factor, which can be 1 in use-zoom-for-dsf mode. | 4533 // page's scale factor, which can be 1 in use-zoom-for-dsf mode. |
| 4527 if (!page()) | 4534 if (!page()) |
| 4528 return 1; | 4535 return 1; |
| 4529 | 4536 |
| 4530 return page()->deviceScaleFactor(); | 4537 return page()->deviceScaleFactor(); |
| 4531 } | 4538 } |
| 4532 | 4539 |
| 4533 } // namespace blink | 4540 } // namespace blink |
| OLD | NEW |