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

Side by Side Diff: third_party/WebKit/Source/web/WebViewImpl.cpp

Issue 1423053002: Make document.activeElement work with OOPIF (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@focus-preserve-page-focus-on-subframe-navigations
Patch Set: Remove some plumbing that should instead be introduced in the window.focus() CL. 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) 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 2790 matching lines...) Expand 10 before | Expand all | Expand 10 after
2801 // Clears the focused frame if any. 2801 // Clears the focused frame if any.
2802 Frame* focusedFrame = focusedCoreFrame(); 2802 Frame* focusedFrame = focusedCoreFrame();
2803 if (focusedFrame && focusedFrame->isLocalFrame()) 2803 if (focusedFrame && focusedFrame->isLocalFrame())
2804 toLocalFrame(focusedFrame)->selection().setFocused(false); 2804 toLocalFrame(focusedFrame)->selection().setFocused(false);
2805 return; 2805 return;
2806 } 2806 }
2807 LocalFrame* coreFrame = toWebLocalFrameImpl(frame)->frame(); 2807 LocalFrame* coreFrame = toWebLocalFrameImpl(frame)->frame();
2808 coreFrame->page()->focusController().setFocusedFrame(coreFrame); 2808 coreFrame->page()->focusController().setFocusedFrame(coreFrame);
2809 } 2809 }
2810 2810
2811 void WebViewImpl::focusDocumentView(WebFrame* frame)
2812 {
2813 page()->focusController().focusDocumentView(toCoreFrame(frame));
2814 }
2815
2811 void WebViewImpl::setInitialFocus(bool reverse) 2816 void WebViewImpl::setInitialFocus(bool reverse)
2812 { 2817 {
2813 if (!m_page) 2818 if (!m_page)
2814 return; 2819 return;
2815 Frame* frame = page()->focusController().focusedOrMainFrame(); 2820 Frame* frame = page()->focusController().focusedOrMainFrame();
2816 if (frame->isLocalFrame()) { 2821 if (frame->isLocalFrame()) {
2817 if (Document* document = toLocalFrame(frame)->document()) 2822 if (Document* document = toLocalFrame(frame)->document())
2818 document->setFocusedElement(nullptr); 2823 document->setFocusedElement(nullptr);
2819 } 2824 }
2820 page()->focusController().setInitialFocus(reverse ? WebFocusTypeBackward : W ebFocusTypeForward); 2825 page()->focusController().setInitialFocus(reverse ? WebFocusTypeBackward : W ebFocusTypeForward);
(...skipping 1646 matching lines...) Expand 10 before | Expand all | Expand 10 after
4467 if (m_pageColorOverlay) 4472 if (m_pageColorOverlay)
4468 m_pageColorOverlay->update(); 4473 m_pageColorOverlay->update();
4469 if (InspectorOverlay* overlay = inspectorOverlay()) { 4474 if (InspectorOverlay* overlay = inspectorOverlay()) {
4470 PageOverlay* inspectorPageOverlay = overlay->pageOverlay(); 4475 PageOverlay* inspectorPageOverlay = overlay->pageOverlay();
4471 if (inspectorPageOverlay) 4476 if (inspectorPageOverlay)
4472 inspectorPageOverlay->update(); 4477 inspectorPageOverlay->update();
4473 } 4478 }
4474 } 4479 }
4475 4480
4476 } // namespace blink 4481 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698