<https://webkit.org/b/119826> Page::focusController() should return a reference.
authorakling@apple.com <akling@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 15 Aug 2013 19:59:05 +0000 (19:59 +0000)
committerakling@apple.com <akling@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 15 Aug 2013 19:59:05 +0000 (19:59 +0000)
Reviewed by Anders Carlsson.

Page::focusController() is never null so make it return a reference.
Some unnecessary checks were removed as a result.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@154122 268f45cc-cd09-0410-ab3c-d52691b4dbfc

64 files changed:
Source/WebCore/ChangeLog
Source/WebCore/accessibility/AXObjectCache.cpp
Source/WebCore/css/SelectorChecker.cpp
Source/WebCore/dom/Element.cpp
Source/WebCore/dom/TreeScope.cpp
Source/WebCore/editing/Editor.cpp
Source/WebCore/editing/FrameSelection.cpp
Source/WebCore/history/CachedFrame.cpp
Source/WebCore/history/CachedPage.cpp
Source/WebCore/html/HTMLDocument.cpp
Source/WebCore/html/HTMLFrameElementBase.cpp
Source/WebCore/page/DOMWindow.cpp
Source/WebCore/page/EventHandler.cpp
Source/WebCore/page/Frame.cpp
Source/WebCore/page/FrameView.cpp
Source/WebCore/page/Page.cpp
Source/WebCore/page/Page.h
Source/WebCore/page/blackberry/EventHandlerBlackBerry.cpp
Source/WebCore/page/efl/EventHandlerEfl.cpp
Source/WebCore/page/gtk/EventHandlerGtk.cpp
Source/WebCore/page/mac/EventHandlerMac.mm
Source/WebCore/page/qt/EventHandlerQt.cpp
Source/WebCore/page/win/EventHandlerWin.cpp
Source/WebCore/plugins/PluginView.cpp
Source/WebCore/plugins/gtk/PluginViewGtk.cpp
Source/WebCore/plugins/mac/PluginViewMac.mm
Source/WebCore/plugins/qt/PluginViewQt.cpp
Source/WebCore/rendering/RenderLayer.cpp
Source/WebCore/rendering/RenderListBox.cpp
Source/WebCore/rendering/RenderTheme.cpp
Source/WebKit/blackberry/Api/WebPage.cpp
Source/WebKit/blackberry/WebKitSupport/BackingStoreClient.cpp
Source/WebKit/blackberry/WebKitSupport/InputHandler.cpp
Source/WebKit/blackberry/WebKitSupport/SelectionHandler.cpp
Source/WebKit/blackberry/WebKitSupport/TouchEventHandler.cpp
Source/WebKit/efl/WebCoreSupport/DumpRenderTreeSupportEfl.cpp
Source/WebKit/efl/ewk/ewk_frame.cpp
Source/WebKit/efl/ewk/ewk_view.cpp
Source/WebKit/gtk/WebCoreSupport/ChromeClientGtk.cpp
Source/WebKit/gtk/WebCoreSupport/DumpRenderTreeSupportGtk.cpp
Source/WebKit/gtk/WebCoreSupport/EditorClientGtk.cpp
Source/WebKit/gtk/WebCoreSupport/WebViewInputMethodFilter.cpp
Source/WebKit/gtk/webkit/webkitwebinspector.cpp
Source/WebKit/gtk/webkit/webkitwebview.cpp
Source/WebKit/mac/WebCoreSupport/WebFrameLoaderClient.mm
Source/WebKit/mac/WebView/WebHTMLView.mm
Source/WebKit/mac/WebView/WebView.mm
Source/WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.cpp
Source/WebKit/qt/WebCoreSupport/EditorClientQt.cpp
Source/WebKit/qt/WebCoreSupport/QWebFrameAdapter.cpp
Source/WebKit/qt/WebCoreSupport/QWebPageAdapter.cpp
Source/WebKit/win/WebView.cpp
Source/WebKit/wince/WebView.cpp
Source/WebKit2/WebProcess/Plugins/PDF/PDFPlugin.mm
Source/WebKit2/WebProcess/Plugins/PDF/SimplePDFPlugin.mm
Source/WebKit2/WebProcess/Plugins/PluginView.cpp
Source/WebKit2/WebProcess/WebCoreSupport/efl/WebEditorClientEfl.cpp
Source/WebKit2/WebProcess/WebCoreSupport/mac/WebEditorClientMac.mm
Source/WebKit2/WebProcess/WebPage/FindController.cpp
Source/WebKit2/WebProcess/WebPage/WebPage.cpp
Source/WebKit2/WebProcess/WebPage/efl/WebPageEfl.cpp
Source/WebKit2/WebProcess/WebPage/gtk/WebPageGtk.cpp
Source/WebKit2/WebProcess/WebPage/mac/WebPageMac.mm
Source/WebKit2/WebProcess/WebPage/qt/WebPageQt.cpp

index 3d22ab2..866d8f4 100644 (file)
@@ -1,3 +1,12 @@
+2013-08-15  Andreas Kling  <akling@apple.com>
+
+        <https://webkit.org/b/119826> Page::focusController() should return a reference.
+
+        Reviewed by Anders Carlsson.
+
+        Page::focusController() is never null so make it return a reference.
+        Some unnecessary checks were removed as a result.
+
 2013-08-15  Rob Buis  <rwlbuis@webkit.org>
 
         ASSERTION FAILED: !m_adoptionIsRequired in void WebCore::TreeShared<NodeType>::ref()
index b503d20..9c224ba 100644 (file)
@@ -161,7 +161,7 @@ AccessibilityObject* AXObjectCache::focusedUIElementForPage(const Page* page)
         return 0;
 
     // get the focused node in the page
-    Document* focusedDocument = page->focusController()->focusedOrMainFrame()->document();
+    Document* focusedDocument = page->focusController().focusedOrMainFrame()->document();
     Element* focusedElement = focusedDocument->focusedElement();
     if (focusedElement && isHTMLAreaElement(focusedElement))
         return focusedImageMapUIElement(toHTMLAreaElement(focusedElement));
index acb230e..243ed10 100644 (file)
@@ -426,7 +426,7 @@ bool SelectorChecker::checkOne(const SelectorCheckingContext& context) const
             return checkScrollbarPseudoClass(context, element->document(), selector);
         } else if (context.hasSelectionPseudo) {
             if (selector->pseudoType() == CSSSelector::PseudoWindowInactive)
-                return !element->document()->page()->focusController()->isActive();
+                return !element->document()->page()->focusController().isActive();
         }
 
         // Normal element pseudo class checking.
@@ -814,7 +814,7 @@ bool SelectorChecker::checkScrollbarPseudoClass(const SelectorCheckingContext& c
     // FIXME: This is a temporary hack for resizers and scrollbar corners. Eventually :window-inactive should become a real
     // pseudo class and just apply to everything.
     if (selector->pseudoType() == CSSSelector::PseudoWindowInactive)
-        return !document->page()->focusController()->isActive();
+        return !document->page()->focusController().isActive();
 
     if (!scrollbar)
         return false;
index eed1981..f66f36a 100644 (file)
@@ -2079,7 +2079,7 @@ void Element::focus(bool restorePreviousSelection, FocusDirection direction)
         // If a focus event handler changes the focus to a different node it
         // does not make sense to continue and update appearence.
         protect = this;
-        if (!page->focusController()->setFocusedElement(this, doc->frame(), direction))
+        if (!page->focusController().setFocusedElement(this, doc->frame(), direction))
             return;
     }
 
@@ -2123,7 +2123,7 @@ void Element::blur()
     Document* doc = document();
     if (treeScope()->focusedElement() == this) {
         if (doc->frame())
-            doc->frame()->page()->focusController()->setFocusedElement(0, doc->frame());
+            doc->frame()->page()->focusController().setFocusedElement(0, doc->frame());
         else
             doc->setFocusedElement(0);
     }
index 3892254..c6ab321 100644 (file)
@@ -395,7 +395,7 @@ Element* TreeScope::focusedElement()
     Element* element = document->focusedElement();
 
     if (!element && document->page())
-        element = focusedFrameOwnerElement(document->page()->focusController()->focusedFrame(), document->frame());
+        element = focusedFrameOwnerElement(document->page()->focusController().focusedFrame(), document->frame());
     if (!element)
         return 0;
     TreeScope* treeScope = element->treeScope();
index 8c1c4b6..d93e6b4 100644 (file)
@@ -994,7 +994,7 @@ bool Editor::insertTextWithoutSendingTextEvent(const String& text, bool selectIn
             // Reveal the current selection
             if (Frame* editedFrame = document->frame())
                 if (Page* page = editedFrame->page())
-                    page->focusController()->focusedOrMainFrame()->selection()->revealSelection(ScrollAlignment::alignCenterIfNeeded);
+                    page->focusController().focusedOrMainFrame()->selection()->revealSelection(ScrollAlignment::alignCenterIfNeeded);
         }
     }
 
index 012bff1..d288126 100644 (file)
@@ -112,7 +112,7 @@ FrameSelection::FrameSelection(Frame* frame)
     , m_absCaretBoundsDirty(true)
     , m_caretPaint(true)
     , m_isCaretBlinkingSuspended(false)
-    , m_focused(frame && frame->page() && frame->page()->focusController()->focusedFrame() == frame)
+    , m_focused(frame && frame->page() && frame->page()->focusController().focusedFrame() == frame)
     , m_shouldShowBlockCursor(false)
 {
     if (shouldAlwaysUseDirectionalSelection(m_frame))
@@ -1627,7 +1627,7 @@ void FrameSelection::selectFrameElementInParentIfFullySelected()
     // Focus on the parent frame, and then select from before this element to after.
     VisibleSelection newSelection(beforeOwnerElement, afterOwnerElement);
     if (parent->selection()->shouldChangeSelection(newSelection)) {
-        page->focusController()->setFocusedFrame(parent);
+        page->focusController().setFocusedFrame(parent);
         parent->selection()->setSelection(newSelection);
     }
 }
@@ -1749,7 +1749,7 @@ void FrameSelection::setFocused(bool flag)
 
 bool FrameSelection::isFocusedAndActive() const
 {
-    return m_focused && m_frame->page() && m_frame->page()->focusController()->isActive();
+    return m_focused && m_frame->page() && m_frame->page()->focusController().isActive();
 }
 
 inline static bool shouldStopBlinkingDueToTypingCommand(Frame* frame)
@@ -1887,7 +1887,7 @@ void FrameSelection::setFocusedElementIfNeeded()
     bool caretBrowsing = m_frame->settings() && m_frame->settings()->caretBrowsingEnabled();
     if (caretBrowsing) {
         if (Element* anchor = enclosingAnchorElement(base())) {
-            m_frame->page()->focusController()->setFocusedElement(anchor, m_frame);
+            m_frame->page()->focusController().setFocusedElement(anchor, m_frame);
             return;
         }
     }
@@ -1899,7 +1899,7 @@ void FrameSelection::setFocusedElementIfNeeded()
             // so add the !isFrameElement check here. There's probably a better way to make this
             // work in the long term, but this is the safest fix at this time.
             if (target->isMouseFocusable() && !isFrameElement(target)) {
-                m_frame->page()->focusController()->setFocusedElement(target, m_frame);
+                m_frame->page()->focusController().setFocusedElement(target, m_frame);
                 return;
             }
             target = target->parentOrShadowHostElement();
@@ -1908,7 +1908,7 @@ void FrameSelection::setFocusedElementIfNeeded()
     }
 
     if (caretBrowsing)
-        m_frame->page()->focusController()->setFocusedElement(0, m_frame);
+        m_frame->page()->focusController().setFocusedElement(0, m_frame);
 }
 
 void DragCaretController::paintDragCaret(Frame* frame, GraphicsContext* p, const LayoutPoint& paintOffset, const LayoutRect& clipRect) const
index d3d7cb0..2062719 100644 (file)
@@ -159,8 +159,8 @@ CachedFrame::CachedFrame(Frame* frame)
     ASSERT(m_documentLoader);
     ASSERT(m_view);
 
-    if (frame->page()->focusController()->focusedFrame() == frame)
-        frame->page()->focusController()->setFocusedFrame(frame->page()->mainFrame());
+    if (frame->page()->focusController().focusedFrame() == frame)
+        frame->page()->focusController().setFocusedFrame(frame->page()->mainFrame());
 
     // Custom scrollbar renderers will get reattached when the document comes out of the page cache
     m_view->detachCustomScrollbars();
index 54f41c9..d574e7c 100644 (file)
@@ -84,7 +84,7 @@ void CachedPage::restore(Page* page)
     
     // Restore the focus appearance for the focused element.
     // FIXME: Right now we don't support pages w/ frames in the b/f cache.  This may need to be tweaked when we add support for that.
-    Document* focusedDocument = page->focusController()->focusedOrMainFrame()->document();
+    Document* focusedDocument = page->focusController().focusedOrMainFrame()->document();
     if (Element* element = focusedDocument->focusedElement())
         element->updateFocusAppearance(true);
 
index 2ef926e..9f2de62 100644 (file)
@@ -149,9 +149,9 @@ bool HTMLDocument::hasFocus()
     Page* page = this->page();
     if (!page)
         return false;
-    if (!page->focusController()->isActive())
+    if (!page->focusController().isActive())
         return false;
-    if (Frame* focusedFrame = page->focusController()->focusedFrame()) {
+    if (Frame* focusedFrame = page->focusController().focusedFrame()) {
         if (focusedFrame->tree()->isDescendantOf(frame()))
             return true;
     }
index 754031e..12b0187 100644 (file)
@@ -211,9 +211,9 @@ void HTMLFrameElementBase::setFocus(bool received)
     HTMLFrameOwnerElement::setFocus(received);
     if (Page* page = document()->page()) {
         if (received)
-            page->focusController()->setFocusedFrame(contentFrame());
-        else if (page->focusController()->focusedFrame() == contentFrame()) // Focus may have already been given to another frame, don't take it away.
-            page->focusController()->setFocusedFrame(0);
+            page->focusController().setFocusedFrame(contentFrame());
+        else if (page->focusController().focusedFrame() == contentFrame()) // Focus may have already been given to another frame, don't take it away.
+            page->focusController().setFocusedFrame(0);
     }
 }
 
index d47a81d..729f641 100644 (file)
@@ -939,7 +939,7 @@ void DOMWindow::focus(ScriptExecutionContext* context)
         return;
 
     // Clear the current frame's focused node if a new frame is about to be focused.
-    Frame* focusedFrame = page->focusController()->focusedFrame();
+    Frame* focusedFrame = page->focusController().focusedFrame();
     if (focusedFrame && focusedFrame != m_frame)
         focusedFrame->document()->setFocusedElement(0);
 
index ea7e148..7492017 100644 (file)
@@ -1964,7 +1964,7 @@ bool EventHandler::handlePasteGlobalSelection(const PlatformMouseEvent& mouseEve
 
     if (!m_frame->page())
         return false;
-    Frame* focusFrame = m_frame->page()->focusController()->focusedOrMainFrame();
+    Frame* focusFrame = m_frame->page()->focusController().focusedOrMainFrame();
     // Do not paste here if the focus was moved somewhere else.
     if (m_frame == focusFrame && m_frame->editor().client()->supportsGlobalSelection())
         return m_frame->editor().command(ASCIILiteral("PasteGlobalSelection")).execute();
@@ -2354,10 +2354,10 @@ bool EventHandler::dispatchMouseEvent(const AtomicString& eventType, Node* targe
         // if the page already set it (e.g., by canceling default behavior).
         if (Page* page = m_frame->page()) {
             if (element && element->isMouseFocusable()) {
-                if (!page->focusController()->setFocusedElement(element, m_frame))
+                if (!page->focusController().setFocusedElement(element, m_frame))
                     swallowEvent = true;
             } else if (!element || !element->focused()) {
-                if (!page->focusController()->setFocusedElement(0, m_frame))
+                if (!page->focusController().setFocusedElement(0, m_frame))
                     swallowEvent = true;
             }
         }
@@ -3078,7 +3078,7 @@ void EventHandler::fakeMouseMoveEventTimerFired(Timer<EventHandler>* timer)
     if (!view)
         return;
 
-    if (!m_frame->page() || !m_frame->page()->isOnscreen() || !m_frame->page()->focusController()->isActive())
+    if (!m_frame->page() || !m_frame->page()->isOnscreen() || !m_frame->page()->focusController().isActive())
         return;
 
     bool shiftKey;
@@ -3230,7 +3230,7 @@ bool EventHandler::keyEvent(const PlatformKeyboardEvent& initialKeyEvent)
     if (initialKeyEvent.type() == PlatformEvent::RawKeyDown) {
         node->dispatchEvent(keydown, IGNORE_EXCEPTION);
         // If frame changed as a result of keydown dispatch, then return true to avoid sending a subsequent keypress message to the new frame.
-        bool changedFocusedFrame = m_frame->page() && m_frame != m_frame->page()->focusController()->focusedOrMainFrame();
+        bool changedFocusedFrame = m_frame->page() && m_frame != m_frame->page()->focusController().focusedOrMainFrame();
         return keydown->defaultHandled() || keydown->defaultPrevented() || changedFocusedFrame;
     }
 
@@ -3252,7 +3252,7 @@ bool EventHandler::keyEvent(const PlatformKeyboardEvent& initialKeyEvent)
 
     node->dispatchEvent(keydown, IGNORE_EXCEPTION);
     // If frame changed as a result of keydown dispatch, then return early to avoid sending a subsequent keypress message to the new frame.
-    bool changedFocusedFrame = m_frame->page() && m_frame != m_frame->page()->focusController()->focusedOrMainFrame();
+    bool changedFocusedFrame = m_frame->page() && m_frame != m_frame->page()->focusController().focusedOrMainFrame();
     bool keydownResult = keydown->defaultHandled() || keydown->defaultPrevented() || changedFocusedFrame;
     if (handledByInputMethod || (keydownResult && !backwardCompatibilityMode))
         return keydownResult;
@@ -3739,7 +3739,7 @@ void EventHandler::defaultArrowEventHandler(FocusDirection focusDirection, Keybo
     if (m_frame->document()->inDesignMode())
         return;
 
-    if (page->focusController()->advanceFocus(focusDirection, event))
+    if (page->focusController().advanceFocus(focusDirection, event))
         event->setDefaultHandled();
 }
 
@@ -3763,7 +3763,7 @@ void EventHandler::defaultTabEventHandler(KeyboardEvent* event)
     if (m_frame->document()->inDesignMode())
         return;
 
-    if (page->focusController()->advanceFocus(focusDirection, event))
+    if (page->focusController().advanceFocus(focusDirection, event))
         event->setDefaultHandled();
 }
 
index ff74a8f..86d7b35 100644 (file)
@@ -671,8 +671,8 @@ void Frame::willDetachPage()
 
     // FIXME: It's unclear as to why this is called more than once, but it is,
     // so page() could be NULL.
-    if (page() && page()->focusController()->focusedFrame() == this)
-        page()->focusController()->setFocusedFrame(0);
+    if (page() && page()->focusController().focusedFrame() == this)
+        page()->focusController().setFocusedFrame(0);
 
     if (page() && page()->scrollingCoordinator() && m_view)
         page()->scrollingCoordinator()->willDestroyScrollableArea(m_view.get());
index 18e99de..f7a9060 100644 (file)
@@ -1680,7 +1680,7 @@ bool FrameView::isHandlingWheelEvent() const
 bool FrameView::shouldSetCursor() const
 {
     Page* page = frame()->page();
-    return page && page->isOnscreen() && page->focusController()->isActive();
+    return page && page->isOnscreen() && page->focusController().isActive();
 }
 
 bool FrameView::scrollContentsFastPath(const IntSize& scrollDelta, const IntRect& rectToScroll, const IntRect& clipRect)
@@ -3086,7 +3086,7 @@ IntRect FrameView::windowClipRectForFrameOwner(const HTMLFrameOwnerElement* owne
 bool FrameView::isActive() const
 {
     Page* page = frame()->page();
-    return page && page->focusController()->isActive();
+    return page && page->focusController().isActive();
 }
 
 void FrameView::scrollTo(const IntSize& newOffset)
index bb65e7a..8910d2b 100644 (file)
@@ -568,13 +568,13 @@ bool Page::findString(const String& target, FindOptions options)
         return false;
 
     bool shouldWrap = options & WrapAround;
-    Frame* frame = focusController()->focusedOrMainFrame();
+    Frame* frame = focusController().focusedOrMainFrame();
     Frame* startFrame = frame;
     do {
         if (frame->editor().findString(target, (options & ~WrapAround) | StartInSelection)) {
             if (frame != startFrame)
                 startFrame->selection()->clear();
-            focusController()->setFocusedFrame(frame);
+            focusController().setFocusedFrame(frame);
             return true;
         }
         frame = incrementFrame(frame, !(options & Backwards), shouldWrap);
@@ -584,7 +584,7 @@ bool Page::findString(const String& target, FindOptions options)
     // We cheat a bit and just research with wrap on
     if (shouldWrap && !startFrame->selection()->isNone()) {
         bool found = startFrame->editor().findString(target, options | WrapAround | StartInSelection);
-        focusController()->setFocusedFrame(frame);
+        focusController().setFocusedFrame(frame);
         return found;
     }
 
@@ -705,7 +705,7 @@ void Page::unmarkAllTextMatches()
 
 const VisibleSelection& Page::selection() const
 {
-    return focusController()->focusedOrMainFrame()->selection()->selection();
+    return focusController().focusedOrMainFrame()->selection()->selection();
 }
 
 void Page::setDefersLoading(bool defers)
index f202f32..7e69f4f 100644 (file)
@@ -189,7 +189,7 @@ public:
 #if ENABLE(DRAG_SUPPORT)
     DragController* dragController() const { return m_dragController.get(); }
 #endif
-    FocusController* focusController() const { return m_focusController.get(); }
+    FocusController& focusController() const { return *m_focusController; }
 #if ENABLE(CONTEXT_MENUS)
     ContextMenuController* contextMenuController() const { return m_contextMenuController.get(); }
 #endif
@@ -445,7 +445,7 @@ private:
 #if ENABLE(DRAG_SUPPORT)
     OwnPtr<DragController> m_dragController;
 #endif
-    OwnPtr<FocusController> m_focusController;
+    const OwnPtr<FocusController> m_focusController;
 #if ENABLE(CONTEXT_MENUS)
     OwnPtr<ContextMenuController> m_contextMenuController;
 #endif
index 4cf99f4..ba5d8a2 100644 (file)
@@ -83,7 +83,7 @@ void EventHandler::focusDocumentView()
     Page* page = m_frame->page();
     if (!page)
         return;
-    page->focusController()->setFocusedFrame(m_frame);
+    page->focusController().setFocusedFrame(m_frame);
 }
 
 } // namespace WebCore
index 5017ef5..b9c49e8 100644 (file)
@@ -57,7 +57,7 @@ bool EventHandler::tabsToAllFormControls(KeyboardEvent*) const
 void EventHandler::focusDocumentView()
 {
     if (Page* page = m_frame->page())
-        page->focusController()->setFocusedFrame(m_frame);
+        page->focusController().setFocusedFrame(m_frame);
 }
 
 bool EventHandler::passWidgetMouseDownEventToWidget(const MouseEventWithHitTestResults& event)
index 10176f7..f2ae520 100644 (file)
@@ -53,7 +53,7 @@ bool EventHandler::tabsToAllFormControls(KeyboardEvent* event) const
 void EventHandler::focusDocumentView()
 {
     if (Page* page = m_frame->page())
-        page->focusController()->setFocusedFrame(m_frame);
+        page->focusController().setFocusedFrame(m_frame);
 }
 
 bool EventHandler::passWidgetMouseDownEventToWidget(const MouseEventWithHitTestResults& event)
index efa03a9..52d550a 100644 (file)
@@ -132,7 +132,7 @@ void EventHandler::focusDocumentView()
             page->chrome().focusNSView(documentView);
     }
 
-    page->focusController()->setFocusedFrame(m_frame);
+    page->focusController().setFocusedFrame(m_frame);
 }
 
 bool EventHandler::passWidgetMouseDownEventToWidget(const MouseEventWithHitTestResults& event)
index f45f81d..7e19dfb 100644 (file)
@@ -68,7 +68,7 @@ void EventHandler::focusDocumentView()
     Page* page = m_frame->page();
     if (!page)
         return;
-    page->focusController()->setFocusedFrame(m_frame);
+    page->focusController().setFocusedFrame(m_frame);
 }
 
 bool EventHandler::passWidgetMouseDownEventToWidget(const MouseEventWithHitTestResults&)
index d3a0582..00daad5 100644 (file)
@@ -107,7 +107,7 @@ void EventHandler::focusDocumentView()
     Page* page = m_frame->page();
     if (!page)
         return;
-    page->focusController()->setFocusedFrame(m_frame);
+    page->focusController().setFocusedFrame(m_frame);
 }
 
 bool EventHandler::passWidgetMouseDownEventToWidget(const MouseEventWithHitTestResults&)
index 2b0f5dc..f57a234 100644 (file)
@@ -876,7 +876,7 @@ PluginView::PluginView(Frame* parentFrame, const IntSize& size, PluginPackage* p
 void PluginView::focusPluginElement()
 {
     if (Page* page = m_parentFrame->page())
-        page->focusController()->setFocusedElement(m_element, m_parentFrame);
+        page->focusController().setFocusedElement(m_element, m_parentFrame);
     else
         m_parentFrame->document()->setFocusedElement(m_element);
 }
index ce145dc..862cf70 100644 (file)
@@ -400,7 +400,7 @@ void PluginView::handleMouseEvent(MouseEvent* event)
 
     if (event->type() == eventNames().mousedownEvent) {
         if (Page* page = m_parentFrame->page())
-            page->focusController()->setActive(true);
+            page->focusController().setActive(true);
         focusPluginElement();
     }
 
index 0a7650f..c5fa48f 100644 (file)
@@ -464,7 +464,7 @@ void PluginView::handleMouseEvent(MouseEvent* event)
             eventType = NPCocoaEventMouseDown;
             // The plugin needs focus to receive keyboard events
             if (Page* page = m_parentFrame->page())
-                page->focusController()->setFocusedFrame(m_parentFrame);
+                page->focusController().setFocusedFrame(m_parentFrame);
             m_parentFrame->document()->setFocusedElement(m_element);
             break;
 
index 94ef7eb..b2036cb 100644 (file)
@@ -442,7 +442,7 @@ void PluginView::handleMouseEvent(MouseEvent* event)
     if (event->type() == eventNames().mousedownEvent) {
         // Give focus to the plugin on click
         if (Page* page = m_parentFrame->page())
-            page->focusController()->setActive(true);
+            page->focusController().setActive(true);
 
         focusPluginElement();
     }
index 1218fa4..9f44173 100644 (file)
@@ -2610,7 +2610,7 @@ IntSize RenderLayer::overhangAmount() const
 bool RenderLayer::isActive() const
 {
     Page* page = renderer()->frame()->page();
-    return page && page->focusController()->isActive();
+    return page && page->focusController().isActive();
 }
 
 static int cornerStart(const RenderLayer* layer, int minX, int maxX, int thickness)
index 53aaea3..b822101 100644 (file)
@@ -731,7 +731,7 @@ LayoutRect RenderListBox::controlClipRect(const LayoutPoint& additionalOffset) c
 bool RenderListBox::isActive() const
 {
     Page* page = frame()->page();
-    return page && page->focusController()->isActive();
+    return page && page->focusController().isActive();
 }
 
 void RenderListBox::invalidateScrollbarRect(Scrollbar* scrollbar, const IntRect& rect)
index 8d040a8..8644de5 100644 (file)
@@ -755,7 +755,7 @@ bool RenderTheme::isActive(const RenderObject* o) const
     if (!page)
         return false;
 
-    return page->focusController()->isActive();
+    return page->focusController().isActive();
 }
 
 bool RenderTheme::isChecked(const RenderObject* o) const
index 24aee85..6474e75 100644 (file)
@@ -2513,7 +2513,7 @@ void WebPagePrivate::assignFocus(Platform::FocusDirection direction)
     switch (direction) {
     case FocusDirectionForward:
     case FocusDirectionBackward:
-        m_page->focusController()->setInitialFocus((FocusDirection) direction, 0);
+        m_page->focusController().setInitialFocus((FocusDirection) direction, 0);
         break;
     case FocusDirectionNone:
         break;
@@ -2573,7 +2573,7 @@ PassRefPtr<Node> WebPagePrivate::contextNode(TargetDetectionStrategy strategy)
     // Check if we're using LinkToLink and the user is not touching the screen.
     if (m_webSettings->doesGetFocusNodeContext() && !isTouching) {
         RefPtr<Node> node;
-        node = m_page->focusController()->focusedOrMainFrame()->document()->focusedElement();
+        node = m_page->focusController().focusedOrMainFrame()->document()->focusedElement();
         if (node) {
             IntRect visibleRect = IntRect(IntPoint(), actualVisibleSize());
             if (!visibleRect.intersects(getNodeWindowRect(node.get())))
@@ -3222,7 +3222,7 @@ void WebPagePrivate::selectionChanged(Frame* frame)
     // FIXME: This is a hack!
     // To ensure the selection being changed has its frame 'focused', lets
     // set it as focused ourselves (PR #104724).
-    m_page->focusController()->setFocusedFrame(frame);
+    m_page->focusController().setFocusedFrame(frame);
 }
 
 void WebPagePrivate::updateSelectionScrollView(const Node* node)
@@ -4170,7 +4170,7 @@ void WebPage::touchEventCancel()
 
 Frame* WebPagePrivate::focusedOrMainFrame() const
 {
-    return m_page->focusController()->focusedOrMainFrame();
+    return m_page->focusController().focusedOrMainFrame();
 }
 
 void WebPagePrivate::clearFocusNode()
@@ -4181,7 +4181,7 @@ void WebPagePrivate::clearFocusNode()
     ASSERT(frame->document());
 
     if (frame->document()->focusedElement())
-        frame->page()->focusController()->setFocusedElement(0, frame);
+        frame->page()->focusController().setFocusedElement(0, frame);
 }
 
 BlackBerry::Platform::String WebPage::textEncoding()
@@ -4224,8 +4224,6 @@ bool WebPage::keyEvent(const Platform::KeyboardEvent& keyboardEvent)
     if (d->m_page->defersLoading())
         return false;
 
-    ASSERT(d->m_page->focusController());
-
     return d->m_inputHandler->handleKeyboardInput(keyboardEvent);
 }
 
@@ -4710,14 +4708,14 @@ void WebPage::setFocused(bool focused)
         return;
     }
     DeferredTaskSetFocused::finishOrCancel(d);
-    FocusController* focusController = d->m_page->focusController();
-    focusController->setActive(focused);
+    FocusController& focusController = d->m_page->focusController();
+    focusController.setActive(focused);
     if (focused) {
-        Frame* frame = focusController->focusedFrame();
+        Frame* frame = focusController.focusedFrame();
         if (!frame)
-            focusController->setFocusedFrame(d->m_mainFrame);
+            focusController.setFocusedFrame(d->m_mainFrame);
     }
-    focusController->setFocused(focused);
+    focusController.setFocused(focused);
 }
 
 bool WebPage::findNextString(const char* text, bool forward, bool caseSensitive, bool wrap, bool highlightAllMatches, bool selectActiveMatchOnClear)
@@ -5897,7 +5895,7 @@ void WebPagePrivate::didChangeSettings(WebSettings* webSettings)
 
 BlackBerry::Platform::String WebPage::textHasAttribute(const BlackBerry::Platform::String& query) const
 {
-    if (Document* doc = d->m_page->focusController()->focusedOrMainFrame()->document())
+    if (Document* doc = d->m_page->focusController().focusedOrMainFrame()->document())
         return doc->queryCommandValue(query);
 
     return BlackBerry::Platform::String::emptyString();
index a9588e3..85b576d 100644 (file)
@@ -189,8 +189,7 @@ bool BackingStoreClient::isLoading() const
 
 bool BackingStoreClient::isFocused() const
 {
-    return m_frame && m_frame->page() && m_frame->page()->focusController()
-        && m_frame->page()->focusController()->focusedFrame() == m_frame;
+    return m_frame && m_frame->page() && m_frame->page()->focusController().focusedFrame() == m_frame;
 }
 
 bool BackingStoreClient::isClientGeneratedScroll() const
index 1fbf050..43433e0 100644 (file)
@@ -422,8 +422,7 @@ BlackBerryInputType InputHandler::elementType(Element* element) const
 
 void InputHandler::focusedNodeChanged()
 {
-    ASSERT(m_webPage->m_page->focusController());
-    Frame* frame = m_webPage->m_page->focusController()->focusedOrMainFrame();
+    Frame* frame = m_webPage->m_page->focusController().focusedOrMainFrame();
     if (!frame || !frame->document())
         return;
 
@@ -1842,9 +1841,8 @@ bool InputHandler::handleKeyboardInput(const Platform::KeyboardEvent& keyboardEv
     if (WTF::isASCIIUpper(keyboardEvent.character()))
         adjustedModifiers |= KEYMOD_SHIFT;
 
-    ASSERT(m_webPage->m_page->focusController());
     bool keyboardEventHandled = false;
-    if (Frame* focusedFrame = m_webPage->m_page->focusController()->focusedFrame()) {
+    if (Frame* focusedFrame = m_webPage->m_page->focusController().focusedFrame()) {
         bool isKeyChar = type == Platform::KeyboardEvent::KeyChar;
 
         // If this is a KeyChar type then we handle it as a keydown followed by a key up.
index d224241..ae7fdab 100644 (file)
@@ -897,7 +897,7 @@ void SelectionHandler::selectObject(const WebCore::IntPoint& location, TextGranu
     if (!m_webPage->m_inputHandler->boundingBoxForInputField().contains(relativePoint)) {
         Node* anchorNode = selection.start().anchorNode();
         if (!anchorNode || anchorNode->isElementNode())
-            m_webPage->m_page->focusController()->setFocusedElement(toElement(anchorNode), focusedFrame);
+            m_webPage->m_page->focusController().setFocusedElement(toElement(anchorNode), focusedFrame);
     }
 
     m_selectionActive = expandSelectionToGranularity(focusedFrame, selection, granularity, m_webPage->m_inputHandler->isInputMode());
index f1f4eab..5709b82 100644 (file)
@@ -100,7 +100,7 @@ void TouchEventHandler::handleTouchHold()
     if (nodeUnderFatFinger && nodeUnderFatFinger->document()->frame() != m_webPage->focusedOrMainFrame()) {
         m_webPage->clearFocusNode();
         m_webPage->m_selectionHandler->cancelSelection();
-        m_webPage->m_page->focusController()->setFocusedFrame(nodeUnderFatFinger->document()->frame());
+        m_webPage->m_page->focusController().setFocusedFrame(nodeUnderFatFinger->document()->frame());
     }
 }
 
index d043c17..90d8fdc 100644 (file)
@@ -302,7 +302,7 @@ void DumpRenderTreeSupportEfl::executeCoreCommandByName(const Evas_Object* ewkVi
 {
     DRT_SUPPRT_PAGE_GET_OR_RETURN(ewkView, page);
 
-    page->focusController()->focusedOrMainFrame()->editor().command(name).execute(value);
+    page->focusController().focusedOrMainFrame()->editor().command(name).execute(value);
 }
 
 bool DumpRenderTreeSupportEfl::findString(const Evas_Object* ewkView, const String& text, WebCore::FindOptions options)
@@ -351,7 +351,7 @@ bool DumpRenderTreeSupportEfl::isCommandEnabled(const Evas_Object* ewkView, cons
 {
     DRT_SUPPRT_PAGE_GET_OR_RETURN(ewkView, page, false);
 
-    return page->focusController()->focusedOrMainFrame()->editor().command(name).isEnabled();
+    return page->focusController().focusedOrMainFrame()->editor().command(name).isEnabled();
 }
 
 void DumpRenderTreeSupportEfl::forceLayout(Evas_Object* ewkFrame)
@@ -570,10 +570,10 @@ void DumpRenderTreeSupportEfl::setComposition(Evas_Object* ewkView, const char*
 {
     DRT_SUPPRT_PAGE_GET_OR_RETURN(ewkView, page);
 
-    if (!page->focusController() || !page->focusController()->focusedOrMainFrame())
+    if (!page->focusController().focusedOrMainFrame())
         return;
 
-    WebCore::Editor& editor = page->focusController()->focusedOrMainFrame()->editor();
+    WebCore::Editor& editor = page->focusController().focusedOrMainFrame()->editor();
     if (!editor.canEdit() && !editor.hasComposition())
         return;
 
@@ -587,10 +587,10 @@ bool DumpRenderTreeSupportEfl::hasComposition(const Evas_Object* ewkView)
 {
     DRT_SUPPRT_PAGE_GET_OR_RETURN(ewkView, page, false);
 
-    if (!page->focusController() || !page->focusController()->focusedOrMainFrame())
+    if (!page->focusController().focusedOrMainFrame())
         return false;
 
-    return page->focusController()->focusedOrMainFrame()->editor().hasComposition();
+    return page->focusController().focusedOrMainFrame()->editor().hasComposition();
 }
 
 bool DumpRenderTreeSupportEfl::compositionRange(Evas_Object* ewkView, int* start, int* length)
@@ -599,10 +599,10 @@ bool DumpRenderTreeSupportEfl::compositionRange(Evas_Object* ewkView, int* start
 
     DRT_SUPPRT_PAGE_GET_OR_RETURN(ewkView, page, false);
 
-    if (!page->focusController() || !page->focusController()->focusedOrMainFrame())
+    if (!page->focusController().focusedOrMainFrame())
         return false;
 
-    WebCore::Editor& editor = page->focusController()->focusedOrMainFrame()->editor();
+    WebCore::Editor& editor = page->focusController().focusedOrMainFrame()->editor();
     if (!editor.hasComposition())
         return false;
 
@@ -615,10 +615,10 @@ void DumpRenderTreeSupportEfl::confirmComposition(Evas_Object* ewkView, const ch
 {
     DRT_SUPPRT_PAGE_GET_OR_RETURN(ewkView, page);
 
-    if (!page->focusController() || !page->focusController()->focusedOrMainFrame())
+    if (!page->focusController().focusedOrMainFrame())
         return;
 
-    WebCore::Editor& editor = page->focusController()->focusedOrMainFrame()->editor();
+    WebCore::Editor& editor = page->focusController().focusedOrMainFrame()->editor();
 
     if (!editor.hasComposition()) {
         editor.insertText(String::fromUTF8(text), 0);
@@ -636,13 +636,13 @@ WebCore::IntRect DumpRenderTreeSupportEfl::firstRectForCharacterRange(Evas_Objec
 {
     DRT_SUPPRT_PAGE_GET_OR_RETURN(ewkView, page, WebCore::IntRect());
 
-    if (!page->focusController() || !page->focusController()->focusedOrMainFrame())
+    if (!page->focusController().focusedOrMainFrame())
         return WebCore::IntRect();
 
     if ((location + length < location) && (location + length))
         length = 0;
 
-    WebCore::Frame* frame = page->focusController()->focusedOrMainFrame();
+    WebCore::Frame* frame = page->focusController().focusedOrMainFrame();
 
     RefPtr<WebCore::Range> range = WebCore::TextIterator::rangeFromLocationAndLength(frame->selection()->rootEditableElementOrDocumentElement(), location, length);
     if (!range)
@@ -658,10 +658,10 @@ bool DumpRenderTreeSupportEfl::selectedRange(Evas_Object* ewkView, int* start, i
 
     DRT_SUPPRT_PAGE_GET_OR_RETURN(ewkView, page, false);
 
-    if (!page->focusController() || !page->focusController()->focusedOrMainFrame())
+    if (!page->focusController().focusedOrMainFrame())
         return false;
 
-    WebCore::Frame* frame = page->focusController()->focusedOrMainFrame();
+    WebCore::Frame* frame = page->focusController().focusedOrMainFrame();
     RefPtr<WebCore::Range> range = frame->selection()->toNormalizedRange().get();
     if (!range)
         return false;
index bd981aa..3736f40 100644 (file)
@@ -851,8 +851,7 @@ Eina_Bool ewk_frame_feed_focus_in(Evas_Object* ewkFrame)
 {
     EWK_FRAME_SD_GET_OR_RETURN(ewkFrame, smartData, false);
     EINA_SAFETY_ON_NULL_RETURN_VAL(smartData->frame, false);
-    WebCore::FocusController* focusController = smartData->frame->page()->focusController();
-    focusController->setFocusedFrame(smartData->frame);
+    smartData->frame->page()->focusController().setFocusedFrame(smartData->frame);
     return true;
 }
 
index ab332ef..5419b93 100644 (file)
@@ -489,9 +489,8 @@ static void _ewk_view_scrolls_flush(Ewk_View_Private_Data* priv)
 static Eina_Bool _ewk_view_smart_focus_in(Ewk_View_Smart_Data* smartData)
 {
     EWK_VIEW_PRIV_GET(smartData, priv);
-    WebCore::FocusController* focusController = priv->page->focusController();
+    WebCore::FocusController* focusController = &priv->page->focusController();
     DBG("ewkView=%p, focusController=%p", smartData->self, focusController);
-    EINA_SAFETY_ON_NULL_RETURN_VAL(focusController, false);
 
     focusController->setActive(true);
     focusController->setFocused(true);
@@ -501,9 +500,8 @@ static Eina_Bool _ewk_view_smart_focus_in(Ewk_View_Smart_Data* smartData)
 static Eina_Bool _ewk_view_smart_focus_out(Ewk_View_Smart_Data* smartData)
 {
     EWK_VIEW_PRIV_GET(smartData, priv);
-    WebCore::FocusController* focusController = priv->page->focusController();
+    WebCore::FocusController* focusController = &priv->page->focusController();
     DBG("ewkView=%p, fc=%p", smartData->self, focusController);
-    EINA_SAFETY_ON_NULL_RETURN_VAL(focusController, false);
 
     focusController->setActive(false);
     focusController->setFocused(false);
@@ -1395,7 +1393,7 @@ Evas_Object* ewk_view_frame_focused_get(const Evas_Object* ewkView)
     EWK_VIEW_SD_GET_OR_RETURN(ewkView, smartData, 0);
     EWK_VIEW_PRIV_GET_OR_RETURN(smartData, priv, 0);
 
-    WebCore::Frame* core = priv->page->focusController()->focusedFrame();
+    WebCore::Frame* core = priv->page->focusController().focusedFrame();
     if (!core)
         return 0;
 
@@ -1577,7 +1575,7 @@ const char* ewk_view_selection_get(const Evas_Object* ewkView)
 {
     EWK_VIEW_SD_GET_OR_RETURN(ewkView, smartData, 0);
     EWK_VIEW_PRIV_GET_OR_RETURN(smartData, priv, 0);
-    CString selectedString = priv->page->focusController()->focusedOrMainFrame()->editor().selectedText().utf8();
+    CString selectedString = priv->page->focusController().focusedOrMainFrame()->editor().selectedText().utf8();
     if (selectedString.isNull())
         return 0;
     return eina_stringshare_add(selectedString.data());
@@ -1592,7 +1590,7 @@ Eina_Bool ewk_view_editor_command_execute(const Evas_Object* ewkView, const Ewk_
     if (!commandString)
         return false;
 
-    return priv->page->focusController()->focusedOrMainFrame()->editor().command(commandString).execute(WTF::String::fromUTF8(value));
+    return priv->page->focusController().focusedOrMainFrame()->editor().command(commandString).execute(WTF::String::fromUTF8(value));
 }
 
 Eina_Bool ewk_view_context_menu_forward_event(Evas_Object* ewkView, const Evas_Event_Mouse_Down* downEvent)
@@ -2949,7 +2947,7 @@ void ewk_view_input_method_state_set(Evas_Object* ewkView, bool active)
 {
     EWK_VIEW_SD_GET_OR_RETURN(ewkView, smartData);
     EWK_VIEW_PRIV_GET(smartData, priv);
-    WebCore::Frame* focusedFrame = priv->page->focusController()->focusedOrMainFrame();
+    WebCore::Frame* focusedFrame = priv->page->focusController().focusedOrMainFrame();
 
     priv->imh = 0;
     if (focusedFrame
@@ -4015,7 +4013,7 @@ void ewk_view_text_direction_set(Evas_Object* ewkView, Ewk_Text_Direction direct
     // the text direction of the selected node and updates its DOM "dir"
     // attribute and its CSS "direction" property.
     // So, we just call the function as Safari does.
-    WebCore::Frame* focusedFrame = priv->page->focusController()->focusedOrMainFrame();
+    WebCore::Frame* focusedFrame = priv->page->focusController().focusedOrMainFrame();
     if (!focusedFrame)
         return;
 
index 9ac1df3..3c67f8b 100644 (file)
@@ -623,7 +623,7 @@ void ChromeClient::paint(WebCore::Timer<ChromeClient>*)
     // We update the IM context window location here, because we want it to be
     // synced with cursor movement. For instance, a text field can move without
     // the selection changing.
-    Frame* focusedFrame = core(m_webView)->focusController()->focusedOrMainFrame();
+    Frame* focusedFrame = core(m_webView)->focusController().focusedOrMainFrame();
     if (focusedFrame && focusedFrame->editor().canEdit())
         m_webView->priv->imFilter.setCursorRect(frame->selection()->absoluteCaretBounds());
 }
index 7f59905..bd6a9f9 100644 (file)
@@ -276,7 +276,7 @@ void DumpRenderTreeSupportGtk::executeCoreCommandByName(WebKitWebView* webView,
     g_return_if_fail(name);
     g_return_if_fail(value);
 
-    core(webView)->focusController()->focusedOrMainFrame()->editor().command(name).execute(value);
+    core(webView)->focusController().focusedOrMainFrame()->editor().command(name).execute(value);
 }
 
 bool DumpRenderTreeSupportGtk::isCommandEnabled(WebKitWebView* webView, const gchar* name)
@@ -284,7 +284,7 @@ bool DumpRenderTreeSupportGtk::isCommandEnabled(WebKitWebView* webView, const gc
     g_return_val_if_fail(WEBKIT_IS_WEB_VIEW(webView), FALSE);
     g_return_val_if_fail(name, FALSE);
 
-    return core(webView)->focusController()->focusedOrMainFrame()->editor().command(name).isEnabled();
+    return core(webView)->focusController().focusedOrMainFrame()->editor().command(name).isEnabled();
 }
 
 void DumpRenderTreeSupportGtk::setComposition(WebKitWebView* webView, const char* text, int start, int length)
@@ -292,7 +292,7 @@ void DumpRenderTreeSupportGtk::setComposition(WebKitWebView* webView, const char
     g_return_if_fail(WEBKIT_IS_WEB_VIEW(webView));
     g_return_if_fail(text);
 
-    Frame* frame = core(webView)->focusController()->focusedOrMainFrame();
+    Frame* frame = core(webView)->focusController().focusedOrMainFrame();
     if (!frame)
         return;
 
@@ -309,7 +309,7 @@ void DumpRenderTreeSupportGtk::setComposition(WebKitWebView* webView, const char
 bool DumpRenderTreeSupportGtk::hasComposition(WebKitWebView* webView)
 {
     g_return_val_if_fail(WEBKIT_IS_WEB_VIEW(webView), false);
-    Frame* frame = core(webView)->focusController()->focusedOrMainFrame();
+    Frame* frame = core(webView)->focusController().focusedOrMainFrame();
     if (!frame)
         return false;
 
@@ -322,7 +322,7 @@ bool DumpRenderTreeSupportGtk::compositionRange(WebKitWebView* webView, int* sta
     *start = *length = 0;
 
     g_return_val_if_fail(WEBKIT_IS_WEB_VIEW(webView), false);
-    Frame* frame = core(webView)->focusController()->focusedOrMainFrame();
+    Frame* frame = core(webView)->focusController().focusedOrMainFrame();
     if (!frame)
         return false;
 
@@ -339,7 +339,7 @@ void DumpRenderTreeSupportGtk::confirmComposition(WebKitWebView* webView, const
 {
     g_return_if_fail(WEBKIT_IS_WEB_VIEW(webView));
 
-    Frame* frame = core(webView)->focusController()->focusedOrMainFrame();
+    Frame* frame = core(webView)->focusController().focusedOrMainFrame();
     if (!frame)
         return;
 
@@ -359,7 +359,7 @@ void DumpRenderTreeSupportGtk::confirmComposition(WebKitWebView* webView, const
 void DumpRenderTreeSupportGtk::doCommand(WebKitWebView* webView, const char* command)
 {
     g_return_if_fail(WEBKIT_IS_WEB_VIEW(webView));
-    Frame* frame = core(webView)->focusController()->focusedOrMainFrame();
+    Frame* frame = core(webView)->focusController().focusedOrMainFrame();
     if (!frame)
         return;
 
@@ -387,7 +387,7 @@ bool DumpRenderTreeSupportGtk::firstRectForCharacterRange(WebKitWebView* webView
     if ((location + length < location) && (location + length))
         length = 0;
 
-    Frame* frame = core(webView)->focusController()->focusedOrMainFrame();
+    Frame* frame = core(webView)->focusController().focusedOrMainFrame();
     if (!frame)
         return false;
 
@@ -406,7 +406,7 @@ bool DumpRenderTreeSupportGtk::selectedRange(WebKitWebView* webView, int* start,
     g_return_val_if_fail(WEBKIT_IS_WEB_VIEW(webView), false);
     g_return_val_if_fail(start && length, false);
 
-    Frame* frame = core(webView)->focusController()->focusedOrMainFrame();
+    Frame* frame = core(webView)->focusController().focusedOrMainFrame();
     if (!frame)
         return false;
 
index 89aba87..497278d 100644 (file)
@@ -209,10 +209,10 @@ static void collapseSelection(GtkClipboard* clipboard, WebKitWebView* webView)
         return;
 
     WebCore::Page* corePage = core(webView);
-    if (!corePage || !corePage->focusController())
+    if (!corePage)
         return;
 
-    Frame* frame = corePage->focusController()->focusedOrMainFrame();
+    Frame* frame = corePage->focusController().focusedOrMainFrame();
 
     // Collapse the selection without clearing it
     ASSERT(frame);
@@ -228,7 +228,7 @@ static void setSelectionPrimaryClipboardIfNeeded(WebKitWebView* webView)
     GtkClipboard* clipboard = gtk_widget_get_clipboard(GTK_WIDGET(webView), GDK_SELECTION_PRIMARY);
     DataObjectGtk* dataObject = DataObjectGtk::forClipboard(clipboard);
     WebCore::Page* corePage = core(webView);
-    Frame* targetFrame = corePage->focusController()->focusedOrMainFrame();
+    Frame* targetFrame = corePage->focusController().focusedOrMainFrame();
 
     if (!targetFrame->selection()->isRange())
         return;
index 9877fca..b19ccda 100644 (file)
@@ -39,7 +39,7 @@ Frame* WebViewInputMethodFilter::focusedOrMainFrame()
     if (!page)
         return 0;
 
-    return page->focusController()->focusedOrMainFrame();
+    return page->focusController().focusedOrMainFrame();
 }
 
 void WebViewInputMethodFilter::setWebView(WebKitWebView* webView)
index 400de04..fb04aa6 100644 (file)
@@ -485,7 +485,7 @@ void webkit_web_inspector_show(WebKitWebInspector* webInspector)
 
     WebKitWebInspectorPrivate* priv = webInspector->priv;
 
-    Frame* frame = priv->page->focusController()->focusedOrMainFrame();
+    Frame* frame = priv->page->focusController().focusedOrMainFrame();
     FrameView* view = frame->view();
 
     if (!view)
@@ -535,7 +535,7 @@ void webkit_web_inspector_inspect_coordinates(WebKitWebInspector* webInspector,
 
     WebKitWebInspectorPrivate* priv = webInspector->priv;
 
-    Frame* frame = priv->page->focusController()->focusedOrMainFrame();
+    Frame* frame = priv->page->focusController().focusedOrMainFrame();
     FrameView* view = frame->view();
 
     if (!view)
index bd0376e..7c7d104 100644 (file)
@@ -361,9 +361,9 @@ static gboolean webkit_web_view_forward_context_menu_event(WebKitWebView* webVie
         if (!targetFrame)
             targetFrame = mainFrame;
 
-        focusedFrame = page->focusController()->focusedOrMainFrame();
+        focusedFrame = page->focusController().focusedOrMainFrame();
         if (targetFrame != focusedFrame) {
-            page->focusController()->setFocusedFrame(targetFrame);
+            page->focusController().setFocusedFrame(targetFrame);
             focusedFrame = targetFrame;
         }
         if (focusedFrame == mainFrame)
@@ -448,7 +448,7 @@ static IntPoint getLocationForKeyboardGeneratedContextMenu(Frame* frame)
 
 static gboolean webkit_web_view_popup_menu_handler(GtkWidget* widget)
 {
-    Frame* frame = core(WEBKIT_WEB_VIEW(widget))->focusController()->focusedOrMainFrame();
+    Frame* frame = core(WEBKIT_WEB_VIEW(widget))->focusController().focusedOrMainFrame();
     IntPoint location = getLocationForKeyboardGeneratedContextMenu(frame);
 
     FrameView* view = frame->view();
@@ -908,14 +908,14 @@ static void webkit_web_view_grab_focus(GtkWidget* widget)
 
     if (gtk_widget_is_sensitive(widget)) {
         WebKitWebView* webView = WEBKIT_WEB_VIEW(widget);
-        FocusController* focusController = core(webView)->focusController();
+        FocusController& focusController = core(webView)->focusController();
 
-        focusController->setActive(true);
+        focusController.setActive(true);
 
-        if (focusController->focusedFrame())
-            focusController->setFocused(true);
+        if (focusController.focusedFrame())
+            focusController.setFocused(true);
         else
-            focusController->setFocusedFrame(core(webView)->mainFrame());
+            focusController.setFocusedFrame(core(webView)->mainFrame());
     }
 
     return GTK_WIDGET_CLASS(webkit_web_view_parent_class)->grab_focus(widget);
@@ -930,15 +930,15 @@ static gboolean webkit_web_view_focus_in_event(GtkWidget* widget, GdkEventFocus*
         return GTK_WIDGET_CLASS(webkit_web_view_parent_class)->focus_in_event(widget, event);
 
     WebKitWebView* webView = WEBKIT_WEB_VIEW(widget);
-    FocusController* focusController = core(webView)->focusController();
+    FocusController& focusController = core(webView)->focusController();
 
-    focusController->setActive(true);
-    if (focusController->focusedFrame())
-        focusController->setFocused(true);
+    focusController.setActive(true);
+    if (focusController.focusedFrame())
+        focusController.setFocused(true);
     else
-        focusController->setFocusedFrame(core(webView)->mainFrame());
+        focusController.setFocusedFrame(core(webView)->mainFrame());
 
-    if (focusController->focusedFrame()->editor().canEdit())
+    if (focusController.focusedFrame()->editor().canEdit())
         webView->priv->imFilter.notifyFocusedIn();
     return GTK_WIDGET_CLASS(webkit_web_view_parent_class)->focus_in_event(widget, event);
 }
@@ -950,8 +950,8 @@ static gboolean webkit_web_view_focus_out_event(GtkWidget* widget, GdkEventFocus
     // We may hit this code while destroying the widget, and we might
     // no longer have a page, then.
     if (Page* page = core(webView)) {
-        page->focusController()->setActive(false);
-        page->focusController()->setFocused(false);
+        page->focusController().setActive(false);
+        page->focusController().setFocused(false);
     }
 
     webView->priv->imFilter.notifyFocusedOut();
@@ -1180,31 +1180,31 @@ static gboolean webkit_web_view_real_console_message(WebKitWebView* webView, con
 
 static void webkit_web_view_real_select_all(WebKitWebView* webView)
 {
-    Frame* frame = core(webView)->focusController()->focusedOrMainFrame();
+    Frame* frame = core(webView)->focusController().focusedOrMainFrame();
     frame->editor().command("SelectAll").execute();
 }
 
 static void webkit_web_view_real_cut_clipboard(WebKitWebView* webView)
 {
-    Frame* frame = core(webView)->focusController()->focusedOrMainFrame();
+    Frame* frame = core(webView)->focusController().focusedOrMainFrame();
     frame->editor().command("Cut").execute();
 }
 
 static void webkit_web_view_real_copy_clipboard(WebKitWebView* webView)
 {
-    Frame* frame = core(webView)->focusController()->focusedOrMainFrame();
+    Frame* frame = core(webView)->focusController().focusedOrMainFrame();
     frame->editor().command("Copy").execute();
 }
 
 static void webkit_web_view_real_undo(WebKitWebView* webView)
 {
-    Frame* frame = core(webView)->focusController()->focusedOrMainFrame();
+    Frame* frame = core(webView)->focusController().focusedOrMainFrame();
     frame->editor().command("Undo").execute();
 }
 
 static void webkit_web_view_real_redo(WebKitWebView* webView)
 {
-    Frame* frame = core(webView)->focusController()->focusedOrMainFrame();
+    Frame* frame = core(webView)->focusController().focusedOrMainFrame();
     frame->editor().command("Redo").execute();
 }
 
@@ -1254,7 +1254,7 @@ static gboolean webkit_web_view_real_move_cursor (WebKitWebView* webView, GtkMov
         return false;
     }
 
-    Frame* frame = core(webView)->focusController()->focusedOrMainFrame();
+    Frame* frame = core(webView)->focusController().focusedOrMainFrame();
     if (!frame->eventHandler()->scrollOverflow(direction, granularity))
         frame->view()->scroll(direction, granularity);
 
@@ -1263,7 +1263,7 @@ static gboolean webkit_web_view_real_move_cursor (WebKitWebView* webView, GtkMov
 
 static void webkit_web_view_real_paste_clipboard(WebKitWebView* webView)
 {
-    Frame* frame = core(webView)->focusController()->focusedOrMainFrame();
+    Frame* frame = core(webView)->focusController().focusedOrMainFrame();
     frame->editor().command("Paste").execute();
 }
 
@@ -1493,7 +1493,7 @@ static void webkit_web_view_drag_end(GtkWidget* widget, GdkDragContext* context)
     if (!webView->priv->dragAndDropHelper.handleDragEnd(context))
         return;
 
-    Frame* frame = core(webView)->focusController()->focusedOrMainFrame();
+    Frame* frame = core(webView)->focusController().focusedOrMainFrame();
     if (!frame)
         return;
 
@@ -1592,7 +1592,7 @@ static gboolean webkit_web_view_query_tooltip(GtkWidget *widget, gint x, gint y,
         WebKitWebView* webView = WEBKIT_WEB_VIEW(widget);
 
         // Get the title of the current focused element.
-        Frame* coreFrame = core(webView)->focusController()->focusedOrMainFrame();
+        Frame* coreFrame = core(webView)->focusController().focusedOrMainFrame();
         if (!coreFrame)
             return FALSE;
 
@@ -4439,7 +4439,7 @@ WebKitWebFrame* webkit_web_view_get_focused_frame(WebKitWebView* webView)
 {
     g_return_val_if_fail(WEBKIT_IS_WEB_VIEW(webView), NULL);
 
-    Frame* focusedFrame = core(webView)->focusController()->focusedFrame();
+    Frame* focusedFrame = core(webView)->focusController().focusedFrame();
     return kit(focusedFrame);
 }
 
@@ -4463,7 +4463,7 @@ gboolean webkit_web_view_can_cut_clipboard(WebKitWebView* webView)
 {
     g_return_val_if_fail(WEBKIT_IS_WEB_VIEW(webView), FALSE);
 
-    Frame* frame = core(webView)->focusController()->focusedOrMainFrame();
+    Frame* frame = core(webView)->focusController().focusedOrMainFrame();
     return frame->editor().canCut() || frame->editor().canDHTMLCut();
 }
 
@@ -4479,7 +4479,7 @@ gboolean webkit_web_view_can_copy_clipboard(WebKitWebView* webView)
 {
     g_return_val_if_fail(WEBKIT_IS_WEB_VIEW(webView), FALSE);
 
-    Frame* frame = core(webView)->focusController()->focusedOrMainFrame();
+    Frame* frame = core(webView)->focusController().focusedOrMainFrame();
     return frame->editor().canCopy() || frame->editor().canDHTMLCopy();
 }
 
@@ -4495,7 +4495,7 @@ gboolean webkit_web_view_can_paste_clipboard(WebKitWebView* webView)
 {
     g_return_val_if_fail(WEBKIT_IS_WEB_VIEW(webView), FALSE);
 
-    Frame* frame = core(webView)->focusController()->focusedOrMainFrame();
+    Frame* frame = core(webView)->focusController().focusedOrMainFrame();
     return frame->editor().canPaste() || frame->editor().canDHTMLPaste();
 }
 
@@ -4551,7 +4551,7 @@ void webkit_web_view_delete_selection(WebKitWebView* webView)
 {
     g_return_if_fail(WEBKIT_IS_WEB_VIEW(webView));
 
-    Frame* frame = core(webView)->focusController()->focusedOrMainFrame();
+    Frame* frame = core(webView)->focusController().focusedOrMainFrame();
     frame->editor().performDelete();
 }
 
@@ -5094,7 +5094,7 @@ gboolean webkit_web_view_can_undo(WebKitWebView* webView)
 {
     g_return_val_if_fail(WEBKIT_IS_WEB_VIEW(webView), FALSE);
 
-    Frame* frame = core(webView)->focusController()->focusedOrMainFrame();
+    Frame* frame = core(webView)->focusController().focusedOrMainFrame();
     return frame->editor().canUndo();
 }
 
@@ -5129,7 +5129,7 @@ gboolean webkit_web_view_can_redo(WebKitWebView* webView)
 {
     g_return_val_if_fail(WEBKIT_IS_WEB_VIEW(webView), FALSE);
 
-    Frame* frame = core(webView)->focusController()->focusedOrMainFrame();
+    Frame* frame = core(webView)->focusController().focusedOrMainFrame();
     return frame->editor().canRedo();
 }
 
@@ -5315,7 +5315,7 @@ WebKitHitTestResult* webkit_web_view_get_hit_test_result(WebKitWebView* webView,
     g_return_val_if_fail(event, NULL);
 
     PlatformMouseEvent mouseEvent = PlatformMouseEvent(event);
-    Frame* frame = core(webView)->focusController()->focusedOrMainFrame();
+    Frame* frame = core(webView)->focusController().focusedOrMainFrame();
     HitTestRequest request(HitTestRequest::Active | HitTestRequest::DisallowShadowContent);
     IntPoint documentPoint = documentPointForWindowPoint(frame, mouseEvent.position());
     MouseEventWithHitTestResults mev = frame->document()->prepareMouseEvent(request, documentPoint, mouseEvent);
@@ -5502,7 +5502,7 @@ void webkitWebViewDirectionChanged(WebKitWebView* webView, GtkTextDirection prev
 
     GtkTextDirection direction = gtk_widget_get_direction(GTK_WIDGET(webView));
 
-    Frame* focusedFrame = core(webView)->focusController()->focusedFrame();
+    Frame* focusedFrame = core(webView)->focusController().focusedFrame();
     if (!focusedFrame)
         return;
 
index f7ec78f..21f3455 100644 (file)
@@ -1297,8 +1297,8 @@ void WebFrameLoaderClient::transitionToCommittedForNewPage()
         
     // If the document view implicitly became first responder, make sure to set the focused frame properly.
     if ([[documentView window] firstResponder] == documentView) {
-        page->focusController()->setFocusedFrame(coreFrame);
-        page->focusController()->setFocused(true);
+        page->focusController().setFocusedFrame(coreFrame);
+        page->focusController().setFocused(true);
     }
 }
 
index 14d027b..cb4a85e 100644 (file)
@@ -3819,16 +3819,16 @@ static PassRefPtr<KeyboardEvent> currentKeyboardEvent(Frame* coreFrame)
         return YES;
 
     if (![[self _webView] _isPerformingProgrammaticFocus])
-        page->focusController()->setFocusedFrame(frame);
+        page->focusController().setFocusedFrame(frame);
 
-    page->focusController()->setFocused(true);
+    page->focusController().setFocused(true);
 
     if (direction == NSDirectSelection)
         return YES;
 
     if (Document* document = frame->document())
         document->setFocusedElement(0);
-    page->focusController()->setInitialFocus(direction == NSSelectingNext ? FocusDirectionForward : FocusDirectionBackward,
+    page->focusController().setInitialFocus(direction == NSSelectingNext ? FocusDirectionForward : FocusDirectionBackward,
                                              currentKeyboardEvent(frame).get());
     return YES;
 }
@@ -3858,7 +3858,7 @@ static PassRefPtr<KeyboardEvent> currentKeyboardEvent(Frame* coreFrame)
         bool nextResponderIsInWebView = [nextResponder isKindOfClass:[NSView class]]
             && [nextResponder isDescendantOf:[[[self _webView] mainFrame] frameView]];
         if (!nextResponderIsInWebView)
-            page->focusController()->setFocused(false);
+            page->focusController().setFocused(false);
     }
     return resign;
 }
index 6f145ba..0c2bc45 100644 (file)
@@ -2653,7 +2653,7 @@ static inline IMP getMethod(id o, SEL s)
 - (void)_updateActiveState
 {
     if (_private && _private->page)
-        _private->page->focusController()->setActive([[self window] _hasKeyAppearance]);
+        _private->page->focusController().setActive([[self window] _hasKeyAppearance]);
 }
 
 static Vector<String> toStringVector(NSArray* patterns)
@@ -3761,7 +3761,7 @@ static NSString * const backingPropertyOldScaleFactorKey = @"NSBackingPropertyOl
 
     if (_private && _private->page) {
         _private->page->resumeScriptedAnimations();
-        _private->page->focusController()->setContainingWindowIsVisible(true);
+        _private->page->focusController().setContainingWindowIsVisible(true);
     }
 }
 
@@ -3774,7 +3774,7 @@ static NSString * const backingPropertyOldScaleFactorKey = @"NSBackingPropertyOl
 {
     if (_private && _private->page) {
         _private->page->suspendScriptedAnimations();
-        _private->page->focusController()->setContainingWindowIsVisible(false);
+        _private->page->focusController().setContainingWindowIsVisible(false);
     }
 }
 
index 3df5597..7f30bf8 100644 (file)
@@ -329,17 +329,17 @@ void DumpRenderTreeSupportQt::setAuthorAndUserStylesEnabled(QWebPageAdapter* ada
 
 void DumpRenderTreeSupportQt::executeCoreCommandByName(QWebPageAdapter* adapter, const QString& name, const QString& value)
 {
-    adapter->page->focusController()->focusedOrMainFrame()->editor().command(name).execute(value);
+    adapter->page->focusController().focusedOrMainFrame()->editor().command(name).execute(value);
 }
 
 bool DumpRenderTreeSupportQt::isCommandEnabled(QWebPageAdapter *adapter, const QString& name)
 {
-    return adapter->page->focusController()->focusedOrMainFrame()->editor().command(name).isEnabled();
+    return adapter->page->focusController().focusedOrMainFrame()->editor().command(name).isEnabled();
 }
 
 QVariantList DumpRenderTreeSupportQt::selectedRange(QWebPageAdapter *adapter)
 {
-    WebCore::Frame* frame = adapter->page->focusController()->focusedOrMainFrame();
+    WebCore::Frame* frame = adapter->page->focusController().focusedOrMainFrame();
     QVariantList selectedRange;
     RefPtr<Range> range = frame->selection()->toNormalizedRange().get();
 
@@ -363,7 +363,7 @@ QVariantList DumpRenderTreeSupportQt::selectedRange(QWebPageAdapter *adapter)
 
 QVariantList DumpRenderTreeSupportQt::firstRectForCharacterRange(QWebPageAdapter *adapter, int location, int length)
 {
-    WebCore::Frame* frame = adapter->page->focusController()->focusedOrMainFrame();
+    WebCore::Frame* frame = adapter->page->focusController().focusedOrMainFrame();
     QVariantList rect;
 
     if ((location + length < location) && (location + length))
@@ -747,7 +747,7 @@ void DumpRenderTreeSupportQt::setAlternateHtml(QWebFrameAdapter* adapter, const
 
 void DumpRenderTreeSupportQt::confirmComposition(QWebPageAdapter *adapter, const char* text)
 {
-    Frame* frame = adapter->page->focusController()->focusedOrMainFrame();
+    Frame* frame = adapter->page->focusController().focusedOrMainFrame();
     if (!frame)
         return;
 
index dec8cd8..1c30162 100644 (file)
@@ -247,7 +247,7 @@ bool EditorClientQt::selectWordBeforeMenuEvent()
 void EditorClientQt::registerUndoStep(WTF::PassRefPtr<WebCore::UndoStep> step)
 {
 #ifndef QT_NO_UNDOSTACK
-    Frame* frame = m_page->page->focusController()->focusedOrMainFrame();
+    Frame* frame = m_page->page->focusController().focusedOrMainFrame();
     if (m_inUndoRedo || (frame && !frame->editor().lastEditCommand() /* HACK!! Don't recreate undos */))
         return;
     m_page->registerUndoStep(step);
@@ -422,7 +422,7 @@ const char* editorCommandForKeyDownEvent(const KeyboardEvent* event)
 
 void EditorClientQt::handleKeyboardEvent(KeyboardEvent* event)
 {
-    Frame* frame = m_page->page->focusController()->focusedOrMainFrame();
+    Frame* frame = m_page->page->focusController().focusedOrMainFrame();
     if (!frame)
         return;
 
@@ -617,7 +617,7 @@ void EditorClientQt::setInputMethodState(bool active)
         Qt::InputMethodHints hints;
 
         HTMLInputElement* inputElement = 0;
-        Frame* frame = m_page->page->focusController()->focusedOrMainFrame();
+        Frame* frame = m_page->page->focusController().focusedOrMainFrame();
         if (frame && frame->document() && frame->document()->focusedElement())
             if (isHTMLInputElement(frame->document()->focusedElement()))
                 inputElement = toHTMLInputElement(frame->document()->focusedElement());
index 60548eb..290566c 100644 (file)
@@ -703,13 +703,13 @@ QList<QObject*> QWebFrameAdapter::childFrames() const
 
 bool QWebFrameAdapter::hasFocus() const
 {
-    Frame* ff = frame->page()->focusController()->focusedFrame();
+    Frame* ff = frame->page()->focusController().focusedFrame();
     return ff && QWebFrameAdapter::kit(ff) == this;
 }
 
 void QWebFrameAdapter::setFocus()
 {
-    frame->page()->focusController()->setFocusedFrame(frame);
+    frame->page()->focusController().setFocusedFrame(frame);
 }
 
 void QWebFrameAdapter::setScrollBarPolicy(Qt::Orientation orientation, Qt::ScrollBarPolicy policy)
index 672111f..1e0bbc4 100644 (file)
@@ -353,7 +353,7 @@ QNetworkAccessManager* QWebPageAdapter::networkAccessManager()
 
 bool QWebPageAdapter::hasSelection() const
 {
-    Frame* frame = page->focusController()->focusedOrMainFrame();
+    Frame* frame = page->focusController().focusedOrMainFrame();
     if (frame)
         return (frame->selection()->selection().selectionType() != VisibleSelection::NoSelection);
     return false;
@@ -361,7 +361,7 @@ bool QWebPageAdapter::hasSelection() const
 
 QString QWebPageAdapter::selectedText() const
 {
-    Frame* frame = page->focusController()->focusedOrMainFrame();
+    Frame* frame = page->focusController().focusedOrMainFrame();
     if (frame->selection()->selection().selectionType() == VisibleSelection::NoSelection)
         return QString();
     return frame->editor().selectedText();
@@ -369,7 +369,7 @@ QString QWebPageAdapter::selectedText() const
 
 QString QWebPageAdapter::selectedHtml() const
 {
-    return page->focusController()->focusedOrMainFrame()->editor().selectedRange()->toHTML();
+    return page->focusController().focusedOrMainFrame()->editor().selectedRange()->toHTML();
 }
 
 bool QWebPageAdapter::isContentEditable() const
@@ -486,7 +486,7 @@ void QWebPageAdapter::mousePressEvent(QMouseEvent* ev)
         return;
 
     RefPtr<WebCore::Node> oldNode;
-    Frame* focusedFrame = page->focusController()->focusedFrame();
+    Frame* focusedFrame = page->focusController().focusedFrame();
     if (Document* focusedDocument = focusedFrame ? focusedFrame->document() : 0)
         oldNode = focusedDocument->focusedElement();
 
@@ -504,7 +504,7 @@ void QWebPageAdapter::mousePressEvent(QMouseEvent* ev)
     ev->setAccepted(accepted);
 
     RefPtr<WebCore::Node> newNode;
-    focusedFrame = page->focusController()->focusedFrame();
+    focusedFrame = page->focusController().focusedFrame();
     if (Document* focusedDocument = focusedFrame ? focusedFrame->document() : 0)
         newNode = focusedDocument->focusedElement();
 
@@ -561,7 +561,7 @@ void QWebPageAdapter::mouseReleaseEvent(QMouseEvent *ev)
 
 void QWebPageAdapter::handleSoftwareInputPanel(Qt::MouseButton button, const QPoint& pos)
 {
-    Frame* frame = page->focusController()->focusedFrame();
+    Frame* frame = page->focusController().focusedFrame();
     if (!frame)
         return;
 
@@ -621,7 +621,7 @@ bool QWebPageAdapter::performDrag(const QMimeData *data, const QPoint &pos, Qt::
 
 void QWebPageAdapter::inputMethodEvent(QInputMethodEvent *ev)
 {
-    WebCore::Frame *frame = page->focusController()->focusedOrMainFrame();
+    WebCore::Frame *frame = page->focusController().focusedOrMainFrame();
     WebCore::Editor &editor = frame->editor();
 
     if (!editor.canEdit()) {
@@ -701,7 +701,7 @@ void QWebPageAdapter::inputMethodEvent(QInputMethodEvent *ev)
 
 QVariant QWebPageAdapter::inputMethodQuery(Qt::InputMethodQuery property) const
 {
-    Frame* frame = page->focusController()->focusedFrame();
+    Frame* frame = page->focusController().focusedFrame();
     if (!frame)
         return QVariant();
 
@@ -911,7 +911,7 @@ QList<MenuItem> descriptionForPlatformMenu(const Vector<ContextMenuItem>& items,
 QWebHitTestResultPrivate* QWebPageAdapter::updatePositionDependentMenuActions(const QPoint& pos, QBitArray* visitedWebActions)
 {
     ASSERT(visitedWebActions);
-    WebCore::Frame* focusedFrame = page->focusController()->focusedOrMainFrame();
+    WebCore::Frame* focusedFrame = page->focusController().focusedOrMainFrame();
     HitTestResult result = focusedFrame->eventHandler()->hitTestResultAtPoint(focusedFrame->view()->windowToContents(pos));
     page->contextMenuController()->setHitTestResult(result);
 
@@ -1012,7 +1012,7 @@ void QWebPageAdapter::didCloseInspector()
 void QWebPageAdapter::updateActionInternal(QWebPageAdapter::MenuAction action, const char* commandName, bool* enabled, bool* checked)
 {
     WebCore::FrameLoader* loader = mainFrameAdapter()->frame->loader();
-    WebCore::Editor& editor = page->focusController()->focusedOrMainFrame()->editor();
+    WebCore::Editor& editor = page->focusController().focusedOrMainFrame()->editor();
 
     switch (action) {
     case QWebPageAdapter::Back:
@@ -1051,7 +1051,7 @@ void QWebPageAdapter::updateActionInternal(QWebPageAdapter::MenuAction action, c
 
 void QWebPageAdapter::triggerAction(QWebPageAdapter::MenuAction action, QWebHitTestResultPrivate* hitTestResult, const char* commandName, bool endToEndReload)
 {
-    Frame* frame = page->focusController()->focusedOrMainFrame();
+    Frame* frame = page->focusController().focusedOrMainFrame();
     if (!frame)
         return;
     Editor& editor = frame->editor();
@@ -1256,14 +1256,14 @@ bool QWebPageAdapter::treatSchemeAsLocal(const QString& scheme)
 
 QObject* QWebPageAdapter::currentFrame() const
 {
-    Frame* frame = page->focusController()->focusedOrMainFrame();
+    Frame* frame = page->focusController().focusedOrMainFrame();
     return frame->loader()->networkingContext()->originatingObject();
 }
 
 bool QWebPageAdapter::hasFocusedNode() const
 {
     bool hasFocus = false;
-    Frame* frame = page->focusController()->focusedFrame();
+    Frame* frame = page->focusController().focusedFrame();
     if (frame) {
         Document* document = frame->document();
         hasFocus = document && document->focusedElement();
@@ -1297,13 +1297,13 @@ QWebPageAdapter::ViewportAttributes QWebPageAdapter::viewportAttributesForSize(c
 
 bool QWebPageAdapter::handleKeyEvent(QKeyEvent *ev)
 {
-    Frame* frame = page->focusController()->focusedOrMainFrame();
+    Frame* frame = page->focusController().focusedOrMainFrame();
     return frame->eventHandler()->keyEvent(PlatformKeyboardEvent(ev, m_useNativeVirtualKeyAsDOMKey));
 }
 
 bool QWebPageAdapter::handleScrolling(QKeyEvent *ev)
 {
-    Frame* frame = page->focusController()->focusedOrMainFrame();
+    Frame* frame = page->focusController().focusedOrMainFrame();
     WebCore::ScrollDirection direction;
     WebCore::ScrollGranularity granularity;
 
@@ -1350,11 +1350,11 @@ bool QWebPageAdapter::handleScrolling(QKeyEvent *ev)
 
 void QWebPageAdapter::focusInEvent(QFocusEvent *)
 {
-    FocusController* focusController = page->focusController();
-    focusController->setActive(true);
-    focusController->setFocused(true);
-    if (!focusController->focusedFrame())
-        focusController->setFocusedFrame(mainFrameAdapter()->frame);
+    FocusController& focusController = page->focusController();
+    focusController.setActive(true);
+    focusController.setFocused(true);
+    if (!focusController.focusedFrame())
+        focusController.setFocusedFrame(mainFrameAdapter()->frame);
 }
 
 void QWebPageAdapter::focusOutEvent(QFocusEvent *)
@@ -1362,15 +1362,15 @@ void QWebPageAdapter::focusOutEvent(QFocusEvent *)
     // only set the focused frame inactive so that we stop painting the caret
     // and the focus frame. But don't tell the focus controller so that upon
     // focusInEvent() we can re-activate the frame.
-    FocusController* focusController = page->focusController();
+    FocusController& focusController = page->focusController();
     // Call setFocused first so that window.onblur doesn't get called twice
-    focusController->setFocused(false);
-    focusController->setActive(false);
+    focusController.setFocused(false);
+    focusController.setActive(false);
 }
 
 bool QWebPageAdapter::handleShortcutOverrideEvent(QKeyEvent* event)
 {
-    WebCore::Frame* frame = page->focusController()->focusedOrMainFrame();
+    WebCore::Frame* frame = page->focusController().focusedOrMainFrame();
     WebCore::Editor& editor = frame->editor();
     if (!editor.canEdit())
         return false;
@@ -1453,7 +1453,7 @@ bool QWebPageAdapter::swallowContextMenuEvent(QContextMenuEvent *event, QWebFram
         }
     }
 
-    WebCore::Frame* focusedFrame = page->focusController()->focusedOrMainFrame();
+    WebCore::Frame* focusedFrame = page->focusController().focusedOrMainFrame();
     focusedFrame->eventHandler()->sendContextMenuEvent(convertMouseEvent(event, 1));
     ContextMenu* menu = page->contextMenuController()->contextMenu();
     // If the website defines its own handler then sendContextMenuEvent takes care of
index 078fabc..3ba6ac0 100644 (file)
@@ -1336,7 +1336,7 @@ bool WebView::handleContextMenuEvent(WPARAM wParam, LPARAM lParam)
         // not run.
         m_page->contextMenuController()->clearContextMenu();
 
-        Frame* focusedFrame = m_page->focusController()->focusedOrMainFrame();
+        Frame* focusedFrame = m_page->focusController().focusedOrMainFrame();
         return focusedFrame->eventHandler()->sendContextMenuEventForKey();
 
     } else {
@@ -1350,7 +1350,7 @@ bool WebView::handleContextMenuEvent(WPARAM wParam, LPARAM lParam)
 
     IntPoint documentPoint(m_page->mainFrame()->view()->windowToContents(coords));
     HitTestResult result = m_page->mainFrame()->eventHandler()->hitTestResultAtPoint(documentPoint);
-    Frame* targetFrame = result.innerNonSharedNode() ? result.innerNonSharedNode()->document()->frame() : m_page->focusController()->focusedOrMainFrame();
+    Frame* targetFrame = result.innerNonSharedNode() ? result.innerNonSharedNode()->document()->frame() : m_page->focusController().focusedOrMainFrame();
 
     targetFrame->view()->setCursor(pointerCursor());
     PlatformMouseEvent mouseEvent(m_viewWindow, WM_RBUTTONUP, wParam, lParam);
@@ -1788,7 +1788,7 @@ bool WebView::verticalScroll(WPARAM wParam, LPARAM /*lParam*/)
         break;
     }
     
-    Frame* frame = m_page->focusController()->focusedOrMainFrame();
+    Frame* frame = m_page->focusController().focusedOrMainFrame();
     return frame->eventHandler()->scrollRecursively(direction, granularity);
 }
 
@@ -1817,14 +1817,14 @@ bool WebView::horizontalScroll(WPARAM wParam, LPARAM /*lParam*/)
         return false;
     }
 
-    Frame* frame = m_page->focusController()->focusedOrMainFrame();
+    Frame* frame = m_page->focusController().focusedOrMainFrame();
     return frame->eventHandler()->scrollRecursively(direction, granularity);
 }
 
 
 bool WebView::execCommand(WPARAM wParam, LPARAM /*lParam*/)
 {
-    Frame* frame = m_page->focusController()->focusedOrMainFrame();
+    Frame* frame = m_page->focusController().focusedOrMainFrame();
     switch (LOWORD(wParam)) {
         case SelectAll:
             return frame->editor().command("SelectAll").execute();
@@ -1840,7 +1840,7 @@ bool WebView::keyUp(WPARAM virtualKeyCode, LPARAM keyData, bool systemKeyDown)
 {
     PlatformKeyboardEvent keyEvent(m_viewWindow, virtualKeyCode, keyData, PlatformEvent::KeyUp, systemKeyDown);
 
-    Frame* frame = m_page->focusController()->focusedOrMainFrame();
+    Frame* frame = m_page->focusController().focusedOrMainFrame();
     m_currentCharacterCode = 0;
 
     return frame->eventHandler()->keyEvent(keyEvent);
@@ -2006,7 +2006,7 @@ bool WebView::keyDown(WPARAM virtualKeyCode, LPARAM keyData, bool systemKeyDown)
         return false;
     }
 #endif
-    Frame* frame = m_page->focusController()->focusedOrMainFrame();
+    Frame* frame = m_page->focusController().focusedOrMainFrame();
 
     PlatformKeyboardEvent keyEvent(m_viewWindow, virtualKeyCode, keyData, PlatformEvent::RawKeyDown, systemKeyDown);
     bool handled = frame->eventHandler()->keyEvent(keyEvent);
@@ -2078,7 +2078,7 @@ bool WebView::keyDown(WPARAM virtualKeyCode, LPARAM keyData, bool systemKeyDown)
 
 bool WebView::keyPress(WPARAM charCode, LPARAM keyData, bool systemKeyDown)
 {
-    Frame* frame = m_page->focusController()->focusedOrMainFrame();
+    Frame* frame = m_page->focusController().focusedOrMainFrame();
 
     PlatformKeyboardEvent keyEvent(m_viewWindow, charCode, keyData, PlatformEvent::Char, systemKeyDown);
     // IE does not dispatch keypress event for WM_SYSCHAR.
@@ -2270,14 +2270,14 @@ LRESULT CALLBACK WebView::WebViewWndProc(HWND hWnd, UINT message, WPARAM wParam,
                 && SUCCEEDED(uiDelegate->QueryInterface(IID_IWebUIDelegatePrivate, (void**) &uiDelegatePrivate)) && uiDelegatePrivate)
                 uiDelegatePrivate->webViewReceivedFocus(webView);
 
-            FocusController* focusController = webView->page()->focusController();
-            if (Frame* frame = focusController->focusedFrame()) {
+            FocusController& focusController = webView->page()->focusController();
+            if (Frame* frame = focusController.focusedFrame()) {
                 // Send focus events unless the previously focused window is a
                 // child of ours (for example a plugin).
                 if (!IsChild(hWnd, reinterpret_cast<HWND>(wParam)))
-                    focusController->setFocused(true);
+                    focusController.setFocused(true);
             } else
-                focusController->setFocused(true);
+                focusController.setFocused(true);
             break;
         }
         case WM_KILLFOCUS: {
@@ -2288,12 +2288,12 @@ LRESULT CALLBACK WebView::WebViewWndProc(HWND hWnd, UINT message, WPARAM wParam,
                 && SUCCEEDED(uiDelegate->QueryInterface(IID_IWebUIDelegatePrivate, (void**) &uiDelegatePrivate)) && uiDelegatePrivate)
                 uiDelegatePrivate->webViewLostFocus(webView, (OLE_HANDLE)(ULONG64)newFocusWnd);
 
-            FocusController* focusController = webView->page()->focusController();
-            Frame* frame = focusController->focusedOrMainFrame();
+            FocusController& focusController = webView->page()->focusController();
+            Frame* frame = focusController.focusedOrMainFrame();
             webView->resetIME(frame);
             // Send blur events unless we're losing focus to a child of ours.
             if (!IsChild(hWnd, newFocusWnd))
-                focusController->setFocused(false);
+                focusController.setFocused(false);
 
             // If we are pan-scrolling when we lose focus, stop the pan scrolling.
             frame->eventHandler()->stopAutoscrollTimer();
@@ -3018,7 +3018,7 @@ HRESULT STDMETHODCALLTYPE WebView::focusedFrame(
     }
 
     *frame = 0;
-    Frame* f = m_page->focusController()->focusedFrame();
+    Frame* f = m_page->focusController().focusedFrame();
     if (!f)
         return E_FAIL;
 
@@ -3477,16 +3477,16 @@ bool WebView::active()
 
 void WebView::updateActiveState()
 {
-    m_page->focusController()->setActive(active());
+    m_page->focusController().setActive(active());
 }
 
 HRESULT STDMETHODCALLTYPE WebView::updateFocusedAndActiveState()
 {
     updateActiveState();
 
-    bool active = m_page->focusController()->isActive();
+    bool active = m_page->focusController().isActive();
     Frame* mainFrame = m_page->mainFrame();
-    Frame* focusedFrame = m_page->focusController()->focusedOrMainFrame();
+    Frame* focusedFrame = m_page->focusController().focusedOrMainFrame();
     mainFrame->selection()->setFocused(active && mainFrame == focusedFrame);
 
     return S_OK;
@@ -3494,7 +3494,7 @@ HRESULT STDMETHODCALLTYPE WebView::updateFocusedAndActiveState()
 
 HRESULT STDMETHODCALLTYPE WebView::executeCoreCommandByName(BSTR name, BSTR value)
 {
-    m_page->focusController()->focusedOrMainFrame()->editor().command(toString(name)).execute(toString(value));
+    m_page->focusController().focusedOrMainFrame()->editor().command(toString(name)).execute(toString(value));
 
     return S_OK;
 }
@@ -3560,7 +3560,7 @@ HRESULT STDMETHODCALLTYPE WebView::generateSelectionImage(BOOL forceWhiteText, O
 {
     *hBitmap = 0;
 
-    WebCore::Frame* frame = m_page->focusController()->focusedOrMainFrame();
+    WebCore::Frame* frame = m_page->focusController().focusedOrMainFrame();
 
     if (frame) {
         OwnPtr<HBITMAP> bitmap = imageFromSelection(frame, forceWhiteText ? TRUE : FALSE);
@@ -3572,7 +3572,7 @@ HRESULT STDMETHODCALLTYPE WebView::generateSelectionImage(BOOL forceWhiteText, O
 
 HRESULT STDMETHODCALLTYPE WebView::selectionRect(RECT* rc)
 {
-    WebCore::Frame* frame = m_page->focusController()->focusedOrMainFrame();
+    WebCore::Frame* frame = m_page->focusController().focusedOrMainFrame();
 
     if (frame) {
         IntRect ir = enclosingIntRect(frame->selection()->bounds());
@@ -3717,7 +3717,7 @@ HRESULT STDMETHODCALLTYPE WebView::selectedText(
 
     *text = 0;
 
-    Frame* focusedFrame = (m_page && m_page->focusController()) ? m_page->focusController()->focusedOrMainFrame() : 0;
+    Frame* focusedFrame = m_page ? m_page->focusController().focusedOrMainFrame() : 0;
     if (!focusedFrame)
         return E_FAIL;
 
@@ -4306,7 +4306,7 @@ HRESULT STDMETHODCALLTYPE WebView::hasSelectedRange(
 HRESULT STDMETHODCALLTYPE WebView::cutEnabled( 
         /* [retval][out] */ BOOL* enabled)
 {
-    Editor& editor = m_page->focusController()->focusedOrMainFrame()->editor();
+    Editor& editor = m_page->focusController().focusedOrMainFrame()->editor();
     *enabled = editor.canCut() || editor.canDHTMLCut();
     return S_OK;
 }
@@ -4314,7 +4314,7 @@ HRESULT STDMETHODCALLTYPE WebView::cutEnabled(
 HRESULT STDMETHODCALLTYPE WebView::copyEnabled( 
         /* [retval][out] */ BOOL* enabled)
 {
-    Editor& editor = m_page->focusController()->focusedOrMainFrame()->editor();
+    Editor& editor = m_page->focusController().focusedOrMainFrame()->editor();
     *enabled = editor.canCopy() || editor.canDHTMLCopy();
     return S_OK;
 }
@@ -4322,7 +4322,7 @@ HRESULT STDMETHODCALLTYPE WebView::copyEnabled(
 HRESULT STDMETHODCALLTYPE WebView::pasteEnabled( 
         /* [retval][out] */ BOOL* enabled)
 {
-    Editor& editor = m_page->focusController()->focusedOrMainFrame()->editor();
+    Editor& editor = m_page->focusController().focusedOrMainFrame()->editor();
     *enabled = editor.canPaste() || editor.canDHTMLPaste();
     return S_OK;
 }
@@ -4330,14 +4330,14 @@ HRESULT STDMETHODCALLTYPE WebView::pasteEnabled(
 HRESULT STDMETHODCALLTYPE WebView::deleteEnabled( 
         /* [retval][out] */ BOOL* enabled)
 {
-    *enabled = m_page->focusController()->focusedOrMainFrame()->editor().canDelete();
+    *enabled = m_page->focusController().focusedOrMainFrame()->editor().canDelete();
     return S_OK;
 }
     
 HRESULT STDMETHODCALLTYPE WebView::editingEnabled( 
         /* [retval][out] */ BOOL* enabled)
 {
-    *enabled = m_page->focusController()->focusedOrMainFrame()->editor().canEdit();
+    *enabled = m_page->focusController().focusedOrMainFrame()->editor().canEdit();
     return S_OK;
 }
 
@@ -4389,7 +4389,7 @@ HRESULT STDMETHODCALLTYPE WebView::replaceSelectionWithText(
         /* [in] */ BSTR text)
 {
     Position start = m_page->mainFrame()->selection()->selection().start();
-    m_page->focusController()->focusedOrMainFrame()->editor().insertText(toString(text), 0);
+    m_page->focusController().focusedOrMainFrame()->editor().insertText(toString(text), 0);
     m_page->mainFrame()->selection()->setBase(start);
     return S_OK;
 }
@@ -4410,14 +4410,14 @@ HRESULT STDMETHODCALLTYPE WebView::replaceSelectionWithArchive(
     
 HRESULT STDMETHODCALLTYPE WebView::deleteSelection( void)
 {
-    Editor& editor = m_page->focusController()->focusedOrMainFrame()->editor();
+    Editor& editor = m_page->focusController().focusedOrMainFrame()->editor();
     editor.deleteSelectionWithSmartDelete(editor.canSmartCopyOrDelete());
     return S_OK;
 }
 
 HRESULT STDMETHODCALLTYPE WebView::clearSelection( void)
 {
-    m_page->focusController()->focusedOrMainFrame()->selection()->clear();
+    m_page->focusController().focusedOrMainFrame()->selection()->clear();
     return S_OK;
 }
     
@@ -4433,28 +4433,28 @@ HRESULT STDMETHODCALLTYPE WebView::applyStyle(
 HRESULT STDMETHODCALLTYPE WebView::copy( 
         /* [in] */ IUnknown* /*sender*/)
 {
-    m_page->focusController()->focusedOrMainFrame()->editor().command("Copy").execute();
+    m_page->focusController().focusedOrMainFrame()->editor().command("Copy").execute();
     return S_OK;
 }
 
 HRESULT STDMETHODCALLTYPE WebView::cut( 
         /* [in] */ IUnknown* /*sender*/)
 {
-    m_page->focusController()->focusedOrMainFrame()->editor().command("Cut").execute();
+    m_page->focusController().focusedOrMainFrame()->editor().command("Cut").execute();
     return S_OK;
 }
 
 HRESULT STDMETHODCALLTYPE WebView::paste( 
         /* [in] */ IUnknown* /*sender*/)
 {
-    m_page->focusController()->focusedOrMainFrame()->editor().command("Paste").execute();
+    m_page->focusController().focusedOrMainFrame()->editor().command("Paste").execute();
     return S_OK;
 }
 
 HRESULT STDMETHODCALLTYPE WebView::copyURL( 
         /* [in] */ BSTR url)
 {
-    m_page->focusController()->focusedOrMainFrame()->editor().copyURL(MarshallingHelpers::BSTRToKURL(url), "");
+    m_page->focusController().focusedOrMainFrame()->editor().copyURL(MarshallingHelpers::BSTRToKURL(url), "");
     return S_OK;
 }
 
@@ -4476,7 +4476,7 @@ HRESULT STDMETHODCALLTYPE WebView::pasteFont(
 HRESULT STDMETHODCALLTYPE WebView::delete_( 
         /* [in] */ IUnknown* /*sender*/)
 {
-    m_page->focusController()->focusedOrMainFrame()->editor().command("Delete").execute();
+    m_page->focusController().focusedOrMainFrame()->editor().command("Delete").execute();
     return S_OK;
 }
     
@@ -5303,18 +5303,18 @@ HRESULT STDMETHODCALLTYPE WebView::standardUserAgentWithApplicationName(
 
 HRESULT STDMETHODCALLTYPE WebView::clearFocusNode()
 {
-    if (m_page && m_page->focusController())
-        m_page->focusController()->setFocusedElement(0, 0);
+    if (m_page)
+        m_page->focusController().setFocusedElement(0, 0);
     return S_OK;
 }
 
 HRESULT STDMETHODCALLTYPE WebView::setInitialFocus(
     /* [in] */ BOOL forward)
 {
-    if (m_page && m_page->focusController()) {
-        Frame* frame = m_page->focusController()->focusedOrMainFrame();
+    if (m_page) {
+        Frame* frame = m_page->focusController().focusedOrMainFrame();
         frame->document()->setFocusedElement(0);
-        m_page->focusController()->setInitialFocus(forward ? FocusDirectionForward : FocusDirectionBackward, 0);
+        m_page->focusController().setInitialFocus(forward ? FocusDirectionForward : FocusDirectionBackward, 0);
     }
     return S_OK;
 }
@@ -5398,7 +5398,7 @@ HRESULT STDMETHODCALLTYPE WebView::loadBackForwardListFromOtherView(
 
 HRESULT STDMETHODCALLTYPE WebView::clearUndoRedoOperations()
 {
-    if (Frame* frame = m_page->focusController()->focusedOrMainFrame())
+    if (Frame* frame = m_page->focusController().focusedOrMainFrame())
         frame->editor().clearUndoRedoOperations();
     return S_OK;
 }
@@ -5542,7 +5542,7 @@ void WebView::resetIME(Frame* targetFrame)
 
 void WebView::updateSelectionForIME()
 {
-    Frame* targetFrame = m_page->focusController()->focusedOrMainFrame();
+    Frame* targetFrame = m_page->focusController().focusedOrMainFrame();
     
     if (!targetFrame)
         return;
@@ -5565,7 +5565,7 @@ bool WebView::onIMEStartComposition()
 {
     LOG(TextInput, "onIMEStartComposition");
     m_inIMEComposition++;
-    Frame* targetFrame = m_page->focusController()->focusedOrMainFrame();
+    Frame* targetFrame = m_page->focusController().focusedOrMainFrame();
     if (!targetFrame)
         return true;
 
@@ -5702,7 +5702,7 @@ bool WebView::onIMEComposition(LPARAM lparam)
     if (!hInputContext)
         return true;
 
-    Frame* targetFrame = m_page->focusController()->focusedOrMainFrame();
+    Frame* targetFrame = m_page->focusController().focusedOrMainFrame();
     if (!targetFrame || !targetFrame->editor().canEdit())
         return true;
 
@@ -5745,7 +5745,7 @@ bool WebView::onIMEEndComposition()
     LOG(TextInput, "onIMEEndComposition");
     // If the composition hasn't been confirmed yet, it needs to be cancelled.
     // This happens after deleting the last character from inline input hole.
-    Frame* targetFrame = m_page->focusController()->focusedOrMainFrame();
+    Frame* targetFrame = m_page->focusController().focusedOrMainFrame();
     if (targetFrame && targetFrame->editor().hasComposition())
         targetFrame->editor().confirmComposition(String());
 
@@ -5811,7 +5811,7 @@ LRESULT WebView::onIMERequestReconvertString(Frame* targetFrame, RECONVERTSTRING
 LRESULT WebView::onIMERequest(WPARAM request, LPARAM data)
 {
     LOG(TextInput, "onIMERequest %s", imeRequestName(request).latin1().data());
-    Frame* targetFrame = m_page->focusController()->focusedOrMainFrame();
+    Frame* targetFrame = m_page->focusController().focusedOrMainFrame();
     if (!targetFrame || !targetFrame->editor().canEdit())
         return 0;
 
@@ -6958,7 +6958,7 @@ HRESULT STDMETHODCALLTYPE WebView::setCompositionForTesting(
     if (!m_page)
         return E_FAIL;
 
-    Frame* frame = m_page->focusController()->focusedOrMainFrame();
+    Frame* frame = m_page->focusController().focusedOrMainFrame();
     if (!frame || !frame->editor().canEdit())
         return E_FAIL;
 
@@ -6976,7 +6976,7 @@ HRESULT STDMETHODCALLTYPE WebView::hasCompositionForTesting(/* [out, retval] */
     if (!m_page)
         return E_FAIL;
 
-    Frame* frame = m_page->focusController()->focusedOrMainFrame();
+    Frame* frame = m_page->focusController().focusedOrMainFrame();
      if (!frame)
         return E_FAIL;
 
@@ -6990,7 +6990,7 @@ HRESULT STDMETHODCALLTYPE WebView::confirmCompositionForTesting(/* [in] */ BSTR
     if (!m_page)
         return E_FAIL;
 
-    Frame* frame = m_page->focusController()->focusedOrMainFrame();
+    Frame* frame = m_page->focusController().focusedOrMainFrame();
     if (!frame || !frame->editor().canEdit())
         return E_FAIL;
 
@@ -7009,7 +7009,7 @@ HRESULT STDMETHODCALLTYPE WebView::compositionRangeForTesting(/* [out] */ UINT*
     if (!m_page)
         return E_FAIL;
 
-    Frame* frame = m_page->focusController()->focusedOrMainFrame();
+    Frame* frame = m_page->focusController().focusedOrMainFrame();
     if (!frame || !frame->editor().canEdit())
         return E_FAIL;
 
@@ -7033,7 +7033,7 @@ HRESULT STDMETHODCALLTYPE WebView::firstRectForCharacterRangeForTesting(
     if (!m_page)
         return E_FAIL;
 
-    Frame* frame = m_page->focusController()->focusedOrMainFrame();
+    Frame* frame = m_page->focusController().focusedOrMainFrame();
     if (!frame)
         return E_FAIL;
 
@@ -7070,7 +7070,7 @@ HRESULT STDMETHODCALLTYPE WebView::selectedRangeForTesting(/* [out] */ UINT* loc
     if (!m_page)
         return E_FAIL;
 
-    Frame* frame = m_page->focusController()->focusedOrMainFrame();
+    Frame* frame = m_page->focusController().focusedOrMainFrame();
     if (!frame)
         return E_FAIL;
 
index 198eea1..0d804bf 100644 (file)
@@ -349,7 +349,7 @@ bool WebView::handleMouseWheel(HWND hWnd, WPARAM wParam, LPARAM lParam, bool isH
 
 bool WebView::handleKeyDown(WPARAM virtualKeyCode, LPARAM keyData, bool systemKeyDown)
 {
-    Frame* frame = m_page->focusController()->focusedOrMainFrame();
+    Frame* frame = m_page->focusController().focusedOrMainFrame();
 
     PlatformKeyboardEvent keyEvent(m_windowHandle, virtualKeyCode, keyData, PlatformEvent::RawKeyDown, systemKeyDown);
     bool handled = frame->eventHandler()->keyEvent(keyEvent);
@@ -371,7 +371,7 @@ bool WebView::handleKeyDown(WPARAM virtualKeyCode, LPARAM keyData, bool systemKe
 
 bool WebView::handleKeyPress(WPARAM charCode, LPARAM keyData, bool systemKeyDown)
 {
-    Frame* frame = m_page->focusController()->focusedOrMainFrame();
+    Frame* frame = m_page->focusController().focusedOrMainFrame();
 
     PlatformKeyboardEvent keyEvent(m_windowHandle, charCode, keyData, PlatformEvent::Char, systemKeyDown);
     // IE does not dispatch keypress event for WM_SYSCHAR.
@@ -387,7 +387,7 @@ bool WebView::handleKeyUp(WPARAM virtualKeyCode, LPARAM keyData, bool systemKeyD
 {
     PlatformKeyboardEvent keyEvent(m_windowHandle, virtualKeyCode, keyData, PlatformEvent::KeyUp, systemKeyDown);
 
-    Frame* frame = m_page->focusController()->focusedOrMainFrame();
+    Frame* frame = m_page->focusController().focusedOrMainFrame();
     return frame->eventHandler()->keyEvent(keyEvent);
 }
 
index e96ed30..b4c6468 100644 (file)
@@ -740,7 +740,7 @@ bool PDFPlugin::isActive() const
 {
     if (Frame* coreFrame = m_frame->coreFrame()) {
         if (Page* page = coreFrame->page())
-            return page->focusController()->isActive();
+            return page->focusController().isActive();
     }
 
     return false;
index 27491f3..d794f02 100644 (file)
@@ -863,7 +863,7 @@ bool SimplePDFPlugin::isActive() const
 {
     if (Frame* coreFrame = m_frame->coreFrame()) {
         if (Page* page = coreFrame->page())
-            return page->focusController()->isActive();
+            return page->focusController().isActive();
     }
 
     return false;
index 2a82baa..3af67ec 100644 (file)
@@ -1066,7 +1066,7 @@ void PluginView::focusPluginElement()
     ASSERT(frame());
     
     if (Page* page = frame()->page())
-        page->focusController()->setFocusedElement(m_pluginElement.get(), frame());
+        page->focusController().setFocusedElement(m_pluginElement.get(), frame());
     else
         frame()->document()->setFocusedElement(m_pluginElement);
 }
index 5a778d7..c0b4e66 100644 (file)
@@ -49,7 +49,7 @@ void WebEditorClient::handleKeyboardEvent(KeyboardEvent* event)
 
 void WebEditorClient::handleInputMethodKeydown(KeyboardEvent* event)
 {
-    Frame* frame = m_page->corePage()->focusController()->focusedOrMainFrame();
+    Frame* frame = m_page->corePage()->focusController().focusedOrMainFrame();
     if (!frame || !frame->editor().canEdit())
         return;
 
index b63e410..f0b62bd 100644 (file)
@@ -133,7 +133,7 @@ void WebEditorClient::setInsertionPasteboard(const String&)
 
 static void changeWordCase(WebPage* page, SEL selector)
 {
-    Frame* frame = page->corePage()->focusController()->focusedOrMainFrame();
+    Frame* frame = page->corePage()->focusController().focusedOrMainFrame();
     if (!frame->editor().canEdit())
         return;
 
index e8c6fc4..7dbfc97 100644 (file)
@@ -328,7 +328,7 @@ void FindController::hideFindIndicator()
 
 void FindController::showFindIndicatorInSelection()
 {
-    Frame* selectedFrame = m_webPage->corePage()->focusController()->focusedOrMainFrame();
+    Frame* selectedFrame = m_webPage->corePage()->focusController().focusedOrMainFrame();
     if (!selectedFrame)
         return;
     
index 9a1d26e..949505c 100644 (file)
@@ -584,7 +584,7 @@ PassRefPtr<Plugin> WebPage::createPlugin(WebFrame* frame, HTMLPlugInElement* plu
 
 EditorState WebPage::editorState() const
 {
-    Frame* frame = m_page->focusController()->focusedOrMainFrame();
+    Frame* frame = m_page->focusController().focusedOrMainFrame();
     ASSERT(frame);
 
     EditorState result;
@@ -761,7 +761,7 @@ PluginView* WebPage::pluginViewForFrame(Frame* frame)
 
 void WebPage::executeEditingCommand(const String& commandName, const String& argument)
 {
-    Frame* frame = m_page->focusController()->focusedOrMainFrame();
+    Frame* frame = m_page->focusController().focusedOrMainFrame();
     if (!frame)
         return;
 
@@ -775,7 +775,7 @@ void WebPage::executeEditingCommand(const String& commandName, const String& arg
 
 bool WebPage::isEditingCommandEnabled(const String& commandName)
 {
-    Frame* frame = m_page->focusController()->focusedOrMainFrame();
+    Frame* frame = m_page->focusController().focusedOrMainFrame();
     if (!frame)
         return false;
 
@@ -1698,7 +1698,7 @@ void WebPage::mouseEvent(const WebMouseEvent& mouseEvent)
         // Lion when legacy scrollbars are enabled, WebKit receives mouse events all the time. If it is one
         // of those cases where the page is not active and the mouse is not pressed, then we can fire a more
         // efficient scrollbars-only version of the event.
-        bool onlyUpdateScrollbars = !(m_page->focusController()->isActive() || (mouseEvent.button() != WebMouseEvent::NoButton));
+        bool onlyUpdateScrollbars = !(m_page->focusController().isActive() || (mouseEvent.button() != WebMouseEvent::NoButton));
         handled = handleMouseEvent(mouseEvent, this, onlyUpdateScrollbars);
     }
 
@@ -1728,7 +1728,7 @@ void WebPage::mouseEventSyncForTesting(const WebMouseEvent& mouseEvent, bool& ha
         // Lion when legacy scrollbars are enabled, WebKit receives mouse events all the time. If it is one 
         // of those cases where the page is not active and the mouse is not pressed, then we can fire a more
         // efficient scrollbars-only version of the event.
-        bool onlyUpdateScrollbars = !(m_page->focusController()->isActive() || (mouseEvent.button() != WebMouseEvent::NoButton));
+        bool onlyUpdateScrollbars = !(m_page->focusController().isActive() || (mouseEvent.button() != WebMouseEvent::NoButton));
         handled = handleMouseEvent(mouseEvent, this, onlyUpdateScrollbars);
     }
 }
@@ -1768,8 +1768,8 @@ static bool handleKeyEvent(const WebKeyboardEvent& keyboardEvent, Page* page)
         return false;
 
     if (keyboardEvent.type() == WebEvent::Char && keyboardEvent.isSystemKey())
-        return page->focusController()->focusedOrMainFrame()->eventHandler()->handleAccessKey(platform(keyboardEvent));
-    return page->focusController()->focusedOrMainFrame()->eventHandler()->keyEvent(platform(keyboardEvent));
+        return page->focusController().focusedOrMainFrame()->eventHandler()->handleAccessKey(platform(keyboardEvent));
+    return page->focusController().focusedOrMainFrame()->eventHandler()->keyEvent(platform(keyboardEvent));
 }
 
 void WebPage::keyEvent(const WebKeyboardEvent& keyboardEvent)
@@ -1850,7 +1850,7 @@ void WebPage::validateCommand(const String& commandName, uint64_t callbackID)
 {
     bool isEnabled = false;
     int32_t state = 0;
-    Frame* frame = m_page->focusController()->focusedOrMainFrame();
+    Frame* frame = m_page->focusController().focusedOrMainFrame();
     if (frame) {
         if (PluginView* pluginView = focusedPluginViewForFrame(frame))
             isEnabled = pluginView->isEditingCommandEnabled(commandName);
@@ -1976,12 +1976,12 @@ void WebPage::touchEventSyncForTesting(const WebTouchEvent& touchEvent, bool& ha
 
 bool WebPage::scroll(Page* page, ScrollDirection direction, ScrollGranularity granularity)
 {
-    return page->focusController()->focusedOrMainFrame()->eventHandler()->scrollRecursively(direction, granularity);
+    return page->focusController().focusedOrMainFrame()->eventHandler()->scrollRecursively(direction, granularity);
 }
 
 bool WebPage::logicalScroll(Page* page, ScrollLogicalDirection direction, ScrollGranularity granularity)
 {
-    return page->focusController()->focusedOrMainFrame()->eventHandler()->logicalScrollRecursively(direction, granularity);
+    return page->focusController().focusedOrMainFrame()->eventHandler()->logicalScrollRecursively(direction, granularity);
 }
 
 bool WebPage::scrollBy(uint32_t scrollDirection, uint32_t scrollGranularity)
@@ -1991,7 +1991,7 @@ bool WebPage::scrollBy(uint32_t scrollDirection, uint32_t scrollGranularity)
 
 void WebPage::centerSelectionInVisibleArea()
 {
-    Frame* frame = m_page->focusController()->focusedOrMainFrame();
+    Frame* frame = m_page->focusController().focusedOrMainFrame();
     if (!frame)
         return;
     
@@ -2001,7 +2001,7 @@ void WebPage::centerSelectionInVisibleArea()
 
 void WebPage::setActive(bool isActive)
 {
-    m_page->focusController()->setActive(isActive);
+    m_page->focusController().setActive(isActive);
 
 #if PLATFORM(MAC)    
     // Tell all our plug-in views that the window focus changed.
@@ -2049,7 +2049,7 @@ void WebPage::viewWillStartLiveResize()
         return;
 
     // FIXME: This should propagate to all ScrollableAreas.
-    if (Frame* frame = m_page->focusController()->focusedOrMainFrame()) {
+    if (Frame* frame = m_page->focusController().focusedOrMainFrame()) {
         if (FrameView* view = frame->view())
             view->willStartLiveResize();
     }
@@ -2061,7 +2061,7 @@ void WebPage::viewWillEndLiveResize()
         return;
 
     // FIXME: This should propagate to all ScrollableAreas.
-    if (Frame* frame = m_page->focusController()->focusedOrMainFrame()) {
+    if (Frame* frame = m_page->focusController().focusedOrMainFrame()) {
         if (FrameView* view = frame->view())
             view->willEndLiveResize();
     }
@@ -2069,25 +2069,25 @@ void WebPage::viewWillEndLiveResize()
 
 void WebPage::setFocused(bool isFocused)
 {
-    m_page->focusController()->setFocused(isFocused);
+    m_page->focusController().setFocused(isFocused);
 }
 
 void WebPage::setInitialFocus(bool forward, bool isKeyboardEventValid, const WebKeyboardEvent& event)
 {
-    if (!m_page || !m_page->focusController())
+    if (!m_page)
         return;
 
-    Frame* frame = m_page->focusController()->focusedOrMainFrame();
+    Frame* frame = m_page->focusController().focusedOrMainFrame();
     frame->document()->setFocusedElement(0);
 
     if (isKeyboardEventValid && event.type() == WebEvent::KeyDown) {
         PlatformKeyboardEvent platformEvent(platform(event));
         platformEvent.disambiguateKeyDownEvent(PlatformEvent::RawKeyDown);
-        m_page->focusController()->setInitialFocus(forward ? FocusDirectionForward : FocusDirectionBackward, KeyboardEvent::create(platformEvent, frame->document()->defaultView()).get());
+        m_page->focusController().setInitialFocus(forward ? FocusDirectionForward : FocusDirectionBackward, KeyboardEvent::create(platformEvent, frame->document()->defaultView()).get());
         return;
     }
 
-    m_page->focusController()->setInitialFocus(forward ? FocusDirectionForward : FocusDirectionBackward, 0);
+    m_page->focusController().setInitialFocus(forward ? FocusDirectionForward : FocusDirectionBackward, 0);
 }
 
 void WebPage::setWindowResizerSize(const IntSize& windowResizerSize)
@@ -2937,13 +2937,13 @@ void WebPage::didReceiveNotificationPermissionDecision(uint64_t notificationID,
 
 void WebPage::advanceToNextMisspelling(bool startBeforeSelection)
 {
-    Frame* frame = m_page->focusController()->focusedOrMainFrame();
+    Frame* frame = m_page->focusController().focusedOrMainFrame();
     frame->editor().advanceToNextMisspelling(startBeforeSelection);
 }
 
 void WebPage::changeSpellingToWord(const String& word)
 {
-    replaceSelectionWithText(m_page->focusController()->focusedOrMainFrame(), word);
+    replaceSelectionWithText(m_page->focusController().focusedOrMainFrame(), word);
 }
 
 void WebPage::unmarkAllMisspellings()
@@ -2965,17 +2965,17 @@ void WebPage::unmarkAllBadGrammar()
 #if USE(APPKIT)
 void WebPage::uppercaseWord()
 {
-    m_page->focusController()->focusedOrMainFrame()->editor().uppercaseWord();
+    m_page->focusController().focusedOrMainFrame()->editor().uppercaseWord();
 }
 
 void WebPage::lowercaseWord()
 {
-    m_page->focusController()->focusedOrMainFrame()->editor().lowercaseWord();
+    m_page->focusController().focusedOrMainFrame()->editor().lowercaseWord();
 }
 
 void WebPage::capitalizeWord()
 {
-    m_page->focusController()->focusedOrMainFrame()->editor().capitalizeWord();
+    m_page->focusController().focusedOrMainFrame()->editor().capitalizeWord();
 }
 #endif
     
@@ -3017,7 +3017,7 @@ void WebPage::replaceSelectionWithText(Frame* frame, const String& text)
 
 void WebPage::clearSelection()
 {
-    m_page->focusController()->focusedOrMainFrame()->selection()->clear();
+    m_page->focusController().focusedOrMainFrame()->selection()->clear();
 }
 
 void WebPage::didChangeScrollOffsetForMainFrame()
@@ -3098,7 +3098,7 @@ void WebPage::setWindowIsVisible(bool windowIsVisible)
 {
     m_windowIsVisible = windowIsVisible;
 
-    corePage()->focusController()->setContainingWindowIsVisible(windowIsVisible);
+    corePage()->focusController().setContainingWindowIsVisible(windowIsVisible);
 
     // Tell all our plug-in views that the window visibility changed.
     for (HashSet<PluginView*>::const_iterator it = m_pluginViews.begin(), end = m_pluginViews.end(); it != end; ++it)
@@ -3139,7 +3139,7 @@ void WebPage::setMainFrameIsScrollable(bool isScrollable)
 
 bool WebPage::windowIsFocused() const
 {
-    return m_page->focusController()->isActive();
+    return m_page->focusController().isActive();
 }
 
 bool WebPage::windowAndWebPageAreFocused() const
@@ -3148,7 +3148,7 @@ bool WebPage::windowAndWebPageAreFocused() const
     if (!m_windowIsVisible)
         return false;
 #endif
-    return m_page->focusController()->isFocused() && m_page->focusController()->isActive();
+    return m_page->focusController().isFocused() && m_page->focusController().isActive();
 }
 
 void WebPage::didReceiveMessage(CoreIPC::Connection* connection, CoreIPC::MessageDecoder& decoder)
@@ -3610,7 +3610,7 @@ void WebPage::commitPageTransitionViewport()
 #if PLATFORM(MAC)
 void WebPage::handleAlternativeTextUIResult(const String& result)
 {
-    Frame* frame = m_page->focusController()->focusedOrMainFrame();
+    Frame* frame = m_page->focusController().focusedOrMainFrame();
     if (!frame)
         return;
     frame->editor().handleAlternativeTextUIResult(result);
@@ -3634,7 +3634,7 @@ void WebPage::simulateMouseMotion(WebCore::IntPoint position, double time)
 
 void WebPage::setCompositionForTesting(const String& compositionString, uint64_t from, uint64_t length)
 {
-    Frame* frame = m_page->focusController()->focusedOrMainFrame();
+    Frame* frame = m_page->focusController().focusedOrMainFrame();
     if (!frame || !frame->editor().canEdit())
         return;
 
@@ -3645,13 +3645,13 @@ void WebPage::setCompositionForTesting(const String& compositionString, uint64_t
 
 bool WebPage::hasCompositionForTesting()
 {
-    Frame* frame = m_page->focusController()->focusedOrMainFrame();
+    Frame* frame = m_page->focusController().focusedOrMainFrame();
     return frame && frame->editor().hasComposition();
 }
 
 void WebPage::confirmCompositionForTesting(const String& compositionString)
 {
-    Frame* frame = m_page->focusController()->focusedOrMainFrame();
+    Frame* frame = m_page->focusController().focusedOrMainFrame();
     if (!frame || !frame->editor().canEdit())
         return;
 
@@ -3810,7 +3810,7 @@ bool WebPage::canPluginHandleResponse(const ResourceResponse& response)
 #if PLATFORM(QT) || PLATFORM(GTK)
 static Frame* targetFrameForEditing(WebPage* page)
 {
-    Frame* targetFrame = page->corePage()->focusController()->focusedOrMainFrame();
+    Frame* targetFrame = page->corePage()->focusController().focusedOrMainFrame();
 
     if (!targetFrame)
         return 0;
index c6c41f1..fd67754 100644 (file)
@@ -77,7 +77,7 @@ void WebPage::platformPreferencesDidChange(const WebPreferencesStore&)
 
 static inline void scroll(Page* page, ScrollDirection direction, ScrollGranularity granularity)
 {
-    page->focusController()->focusedOrMainFrame()->eventHandler()->scrollRecursively(direction, granularity);
+    page->focusController().focusedOrMainFrame()->eventHandler()->scrollRecursively(direction, granularity);
 }
 
 bool WebPage::performDefaultBehaviorForKeyEvent(const WebKeyboardEvent& keyboardEvent)
@@ -174,7 +174,7 @@ void WebPage::setThemePath(const String& themePath)
 
 static Frame* targetFrameForEditing(WebPage* page)
 {
-    Frame* frame = page->corePage()->focusController()->focusedOrMainFrame();
+    Frame* frame = page->corePage()->focusController().focusedOrMainFrame();
     if (!frame)
         return 0;
 
@@ -217,7 +217,7 @@ void WebPage::setComposition(const String& compositionString, const Vector<WebCo
 
 void WebPage::cancelComposition()
 {
-    Frame* frame = m_page->focusController()->focusedOrMainFrame();
+    Frame* frame = m_page->focusController().focusedOrMainFrame();
     if (!frame)
         return;
 
index a84654a..1a7cb20 100644 (file)
@@ -77,7 +77,7 @@ void WebPage::platformPreferencesDidChange(const WebPreferencesStore&)
 
 static inline void scroll(Page* page, ScrollDirection direction, ScrollGranularity granularity)
 {
-    page->focusController()->focusedOrMainFrame()->eventHandler()->scrollRecursively(direction, granularity);
+    page->focusController().focusedOrMainFrame()->eventHandler()->scrollRecursively(direction, granularity);
 }
 
 bool WebPage::performDefaultBehaviorForKeyEvent(const WebKeyboardEvent& keyboardEvent)
index 2be2a53..0a4314a 100644 (file)
@@ -260,7 +260,7 @@ void WebPage::sendComplexTextInputToPlugin(uint64_t pluginComplexTextInputIdenti
 
 void WebPage::setComposition(const String& text, Vector<CompositionUnderline> underlines, uint64_t selectionStart, uint64_t selectionEnd, uint64_t replacementRangeStart, uint64_t replacementRangeEnd, EditorState& newState)
 {
-    Frame* frame = m_page->focusController()->focusedOrMainFrame();
+    Frame* frame = m_page->focusController().focusedOrMainFrame();
 
     if (frame->selection()->isContentEditable()) {
         RefPtr<Range> replacementRange;
@@ -277,25 +277,21 @@ void WebPage::setComposition(const String& text, Vector<CompositionUnderline> un
 
 void WebPage::confirmComposition(EditorState& newState)
 {
-    Frame* frame = m_page->focusController()->focusedOrMainFrame();
-
+    Frame* frame = m_page->focusController().focusedOrMainFrame();
     frame->editor().confirmComposition();
-
     newState = editorState();
 }
 
 void WebPage::cancelComposition(EditorState& newState)
 {
-    Frame* frame = m_page->focusController()->focusedOrMainFrame();
-
+    Frame* frame = m_page->focusController().focusedOrMainFrame();
     frame->editor().cancelComposition();
-
     newState = editorState();
 }
 
 void WebPage::insertText(const String& text, uint64_t replacementRangeStart, uint64_t replacementRangeEnd, bool& handled, EditorState& newState)
 {
-    Frame* frame = m_page->focusController()->focusedOrMainFrame();
+    Frame* frame = m_page->focusController().focusedOrMainFrame();
 
     if (replacementRangeStart != NSNotFound) {
         RefPtr<Range> replacementRange = convertToRange(frame, NSMakeRange(replacementRangeStart, replacementRangeEnd - replacementRangeStart));
@@ -317,7 +313,7 @@ void WebPage::insertText(const String& text, uint64_t replacementRangeStart, uin
 
 void WebPage::insertDictatedText(const String& text, uint64_t replacementRangeStart, uint64_t replacementRangeEnd, const Vector<WebCore::DictationAlternative>& dictationAlternativeLocations, bool& handled, EditorState& newState)
 {
-    Frame* frame = m_page->focusController()->focusedOrMainFrame();
+    Frame* frame = m_page->focusController().focusedOrMainFrame();
 
     if (replacementRangeStart != NSNotFound) {
         RefPtr<Range> replacementRange = convertToRange(frame, NSMakeRange(replacementRangeStart, replacementRangeEnd - replacementRangeStart));
@@ -334,7 +330,7 @@ void WebPage::getMarkedRange(uint64_t& location, uint64_t& length)
 {
     location = NSNotFound;
     length = 0;
-    Frame* frame = m_page->focusController()->focusedOrMainFrame();
+    Frame* frame = m_page->focusController().focusedOrMainFrame();
     if (!frame)
         return;
 
@@ -351,7 +347,7 @@ void WebPage::getSelectedRange(uint64_t& location, uint64_t& length)
 {
     location = NSNotFound;
     length = 0;
-    Frame* frame = m_page->focusController()->focusedOrMainFrame();
+    Frame* frame = m_page->focusController().focusedOrMainFrame();
     if (!frame)
         return;
 
@@ -368,7 +364,7 @@ void WebPage::getAttributedSubstringFromRange(uint64_t location, uint64_t length
 {
     NSRange nsRange = NSMakeRange(location, length - location);
 
-    Frame* frame = m_page->focusController()->focusedOrMainFrame();
+    Frame* frame = m_page->focusController().focusedOrMainFrame();
     if (!frame)
         return;
 
@@ -400,7 +396,7 @@ void WebPage::characterIndexForPoint(IntPoint point, uint64_t& index)
         return;
 
     HitTestResult result = frame->eventHandler()->hitTestResultAtPoint(point);
-    frame = result.innerNonSharedNode() ? result.innerNodeFrame() : m_page->focusController()->focusedOrMainFrame();
+    frame = result.innerNonSharedNode() ? result.innerNodeFrame() : m_page->focusController().focusedOrMainFrame();
     
     RefPtr<Range> range = frame->rangeForPoint(result.roundedPointInInnerNodeFrame());
     if (!range)
@@ -430,7 +426,7 @@ PassRefPtr<Range> convertToRange(Frame* frame, NSRange nsrange)
     
 void WebPage::firstRectForCharacterRange(uint64_t location, uint64_t length, WebCore::IntRect& resultRect)
 {
-    Frame* frame = m_page->focusController()->focusedOrMainFrame();
+    Frame* frame = m_page->focusController().focusedOrMainFrame();
     resultRect.setLocation(IntPoint(0, 0));
     resultRect.setSize(IntSize(0, 0));
     
@@ -494,7 +490,7 @@ void WebPage::performDictionaryLookupAtLocation(const FloatPoint& floatPoint)
     // Find the frame the point is over.
     IntPoint point = roundedIntPoint(floatPoint);
     HitTestResult result = frame->eventHandler()->hitTestResultAtPoint(frame->view()->windowToContents(point));
-    frame = result.innerNonSharedNode() ? result.innerNonSharedNode()->document()->frame() : m_page->focusController()->focusedOrMainFrame();
+    frame = result.innerNonSharedNode() ? result.innerNonSharedNode()->document()->frame() : m_page->focusController().focusedOrMainFrame();
 
     IntPoint translatedPoint = frame->view()->windowToContents(point);
 
@@ -503,7 +499,7 @@ void WebPage::performDictionaryLookupAtLocation(const FloatPoint& floatPoint)
         return;
 
     VisiblePosition position = frame->visiblePositionForPoint(translatedPoint);
-    VisibleSelection selection = m_page->focusController()->focusedOrMainFrame()->selection()->selection();
+    VisibleSelection selection = m_page->focusController().focusedOrMainFrame()->selection()->selection();
     if (shouldUseSelection(position, selection)) {
         performDictionaryLookupForSelection(frame, selection);
         return;
@@ -685,7 +681,7 @@ void WebPage::registerUIProcessAccessibilityTokens(const CoreIPC::DataReference&
 
 void WebPage::readSelectionFromPasteboard(const String& pasteboardName, bool& result)
 {
-    Frame* frame = m_page->focusController()->focusedOrMainFrame();
+    Frame* frame = m_page->focusController().focusedOrMainFrame();
     if (!frame || frame->selection()->isNone()) {
         result = false;
         return;
@@ -696,7 +692,7 @@ void WebPage::readSelectionFromPasteboard(const String& pasteboardName, bool& re
 
 void WebPage::getStringSelectionForPasteboard(String& stringValue)
 {
-    Frame* frame = m_page->focusController()->focusedOrMainFrame();
+    Frame* frame = m_page->focusController().focusedOrMainFrame();
 
     if (!frame)
         return;
@@ -717,7 +713,7 @@ void WebPage::getStringSelectionForPasteboard(String& stringValue)
 
 void WebPage::getDataSelectionForPasteboard(const String pasteboardType, SharedMemory::Handle& handle, uint64_t& size)
 {
-    Frame* frame = m_page->focusController()->focusedOrMainFrame();
+    Frame* frame = m_page->focusController().focusedOrMainFrame();
     if (!frame || frame->selection()->isNone())
         return;
 
@@ -789,7 +785,7 @@ bool WebPage::platformCanHandleRequest(const WebCore::ResourceRequest& request)
 void WebPage::shouldDelayWindowOrderingEvent(const WebKit::WebMouseEvent& event, bool& result)
 {
     result = false;
-    Frame* frame = m_page->focusController()->focusedOrMainFrame();
+    Frame* frame = m_page->focusController().focusedOrMainFrame();
     if (!frame)
         return;
 
@@ -803,7 +799,7 @@ void WebPage::shouldDelayWindowOrderingEvent(const WebKit::WebMouseEvent& event,
 void WebPage::acceptsFirstMouse(int eventNumber, const WebKit::WebMouseEvent& event, bool& result)
 {
     result = false;
-    Frame* frame = m_page->focusController()->focusedOrMainFrame();
+    Frame* frame = m_page->focusController().focusedOrMainFrame();
     if (!frame)
         return;
     
index 096ca62..7010667 100644 (file)
@@ -223,12 +223,12 @@ const char* WebPage::interpretKeyEvent(const KeyboardEvent* evt)
 
 static inline void scroll(Page* page, ScrollDirection direction, ScrollGranularity granularity)
 {
-    page->focusController()->focusedOrMainFrame()->eventHandler()->scrollRecursively(direction, granularity);
+    page->focusController().focusedOrMainFrame()->eventHandler()->scrollRecursively(direction, granularity);
 }
 
 static inline void logicalScroll(Page* page, ScrollLogicalDirection direction, ScrollGranularity granularity)
 {
-    page->focusController()->focusedOrMainFrame()->eventHandler()->logicalScrollRecursively(direction, granularity);
+    page->focusController().focusedOrMainFrame()->eventHandler()->logicalScrollRecursively(direction, granularity);
 }
 
 bool WebPage::performDefaultBehaviorForKeyEvent(const WebKeyboardEvent& keyboardEvent)