| 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 2648 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2659 if (!frame || !frame->IsLocalFrame()) | 2659 if (!frame || !frame->IsLocalFrame()) |
| 2660 return nullptr; | 2660 return nullptr; |
| 2661 return WebLocalFrameImpl::FromFrame(ToLocalFrame(frame)); | 2661 return WebLocalFrameImpl::FromFrame(ToLocalFrame(frame)); |
| 2662 } | 2662 } |
| 2663 | 2663 |
| 2664 void WebViewImpl::SetFocusedFrame(WebFrame* frame) { | 2664 void WebViewImpl::SetFocusedFrame(WebFrame* frame) { |
| 2665 if (!frame) { | 2665 if (!frame) { |
| 2666 // Clears the focused frame if any. | 2666 // Clears the focused frame if any. |
| 2667 Frame* focused_frame = FocusedCoreFrame(); | 2667 Frame* focused_frame = FocusedCoreFrame(); |
| 2668 if (focused_frame && focused_frame->IsLocalFrame()) | 2668 if (focused_frame && focused_frame->IsLocalFrame()) |
| 2669 ToLocalFrame(focused_frame)->Selection().SetFocused(false); | 2669 ToLocalFrame(focused_frame)->Selection().SetFrameIsFocused(false); |
| 2670 return; | 2670 return; |
| 2671 } | 2671 } |
| 2672 LocalFrame* core_frame = ToWebLocalFrameImpl(frame)->GetFrame(); | 2672 LocalFrame* core_frame = ToWebLocalFrameImpl(frame)->GetFrame(); |
| 2673 core_frame->GetPage()->GetFocusController().SetFocusedFrame(core_frame); | 2673 core_frame->GetPage()->GetFocusController().SetFocusedFrame(core_frame); |
| 2674 } | 2674 } |
| 2675 | 2675 |
| 2676 void WebViewImpl::FocusDocumentView(WebFrame* frame) { | 2676 void WebViewImpl::FocusDocumentView(WebFrame* frame) { |
| 2677 // This is currently only used when replicating focus changes for | 2677 // This is currently only used when replicating focus changes for |
| 2678 // cross-process frames, and |notifyEmbedder| is disabled to avoid sending | 2678 // cross-process frames, and |notifyEmbedder| is disabled to avoid sending |
| 2679 // duplicate frameFocused updates from FocusController to the browser | 2679 // duplicate frameFocused updates from FocusController to the browser |
| (...skipping 1489 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4169 if (focused_frame->LocalFrameRoot() != MainFrameImpl()->GetFrame()) | 4169 if (focused_frame->LocalFrameRoot() != MainFrameImpl()->GetFrame()) |
| 4170 return nullptr; | 4170 return nullptr; |
| 4171 return focused_frame; | 4171 return focused_frame; |
| 4172 } | 4172 } |
| 4173 | 4173 |
| 4174 LocalFrame* WebViewImpl::FocusedLocalFrameAvailableForIme() const { | 4174 LocalFrame* WebViewImpl::FocusedLocalFrameAvailableForIme() const { |
| 4175 return ime_accept_events_ ? FocusedLocalFrameInWidget() : nullptr; | 4175 return ime_accept_events_ ? FocusedLocalFrameInWidget() : nullptr; |
| 4176 } | 4176 } |
| 4177 | 4177 |
| 4178 } // namespace blink | 4178 } // namespace blink |
| OLD | NEW |