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

Side by Side Diff: Source/web/WebPluginContainerImpl.cpp

Issue 24253004: Cleanup: Start using toFoo methods as part of newly adopted coding guideline. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « Source/web/WebAXObject.cpp ('k') | Source/web/tests/ScrollingCoordinatorChromiumTest.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2009 Google Inc. All rights reserved. 2 * Copyright (C) 2009 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after
187 // http://devedge-temp.mozilla.org/library/manuals/2002/plugin/1.0/struct ures5.html#1000000 187 // http://devedge-temp.mozilla.org/library/manuals/2002/plugin/1.0/struct ures5.html#1000000
188 // Don't take the documentation as truth, however. There are many cases 188 // Don't take the documentation as truth, however. There are many cases
189 // where mozilla behaves differently than the spec. 189 // where mozilla behaves differently than the spec.
190 if (event->isMouseEvent()) 190 if (event->isMouseEvent())
191 handleMouseEvent(toMouseEvent(event)); 191 handleMouseEvent(toMouseEvent(event));
192 else if (event->hasInterface(eventNames().interfaceForWheelEvent)) 192 else if (event->hasInterface(eventNames().interfaceForWheelEvent))
193 handleWheelEvent(static_cast<WheelEvent*>(event)); 193 handleWheelEvent(static_cast<WheelEvent*>(event));
194 else if (event->isKeyboardEvent()) 194 else if (event->isKeyboardEvent())
195 handleKeyboardEvent(toKeyboardEvent(event)); 195 handleKeyboardEvent(toKeyboardEvent(event));
196 else if (eventNames().isTouchEventType(event->type())) 196 else if (eventNames().isTouchEventType(event->type()))
197 handleTouchEvent(static_cast<TouchEvent*>(event)); 197 handleTouchEvent(toTouchEvent(event));
198 else if (eventNames().isGestureEventType(event->type())) 198 else if (eventNames().isGestureEventType(event->type()))
199 handleGestureEvent(static_cast<GestureEvent*>(event)); 199 handleGestureEvent(static_cast<GestureEvent*>(event));
200 200
201 // FIXME: it would be cleaner if Widget::handleEvent returned true/false and 201 // FIXME: it would be cleaner if Widget::handleEvent returned true/false and
202 // HTMLPluginElement called setDefaultHandled or defaultEventHandler. 202 // HTMLPluginElement called setDefaultHandled or defaultEventHandler.
203 if (!event->defaultHandled()) 203 if (!event->defaultHandled())
204 m_element->Node::defaultEventHandler(event); 204 m_element->Node::defaultEventHandler(event);
205 } 205 }
206 206
207 void WebPluginContainerImpl::frameRectsChanged() 207 void WebPluginContainerImpl::frameRectsChanged()
(...skipping 641 matching lines...) Expand 10 before | Expand all | Expand 10 after
849 if (webEvent.type == WebInputEvent::Undefined) 849 if (webEvent.type == WebInputEvent::Undefined)
850 return; 850 return;
851 851
852 WebCursorInfo cursorInfo; 852 WebCursorInfo cursorInfo;
853 if (m_webPlugin->handleInputEvent(webEvent, cursorInfo)) 853 if (m_webPlugin->handleInputEvent(webEvent, cursorInfo))
854 event->setDefaultHandled(); 854 event->setDefaultHandled();
855 } 855 }
856 856
857 void WebPluginContainerImpl::focusPlugin() 857 void WebPluginContainerImpl::focusPlugin()
858 { 858 {
859 Frame& containingFrame = static_cast<FrameView*>(parent())->frame(); 859 Frame& containingFrame = toFrameView(parent())->frame();
860 if (Page* currentPage = containingFrame.page()) 860 if (Page* currentPage = containingFrame.page())
861 currentPage->focusController().setFocusedElement(m_element, &containingF rame); 861 currentPage->focusController().setFocusedElement(m_element, &containingF rame);
862 else 862 else
863 containingFrame.document()->setFocusedElement(m_element); 863 containingFrame.document()->setFocusedElement(m_element);
864 } 864 }
865 865
866 void WebPluginContainerImpl::calculateGeometry(const IntRect& frameRect, 866 void WebPluginContainerImpl::calculateGeometry(const IntRect& frameRect,
867 IntRect& windowRect, 867 IntRect& windowRect,
868 IntRect& clipRect, 868 IntRect& clipRect,
869 Vector<IntRect>& cutOutRects) 869 Vector<IntRect>& cutOutRects)
(...skipping 22 matching lines...) Expand all
892 // Take our element and get the clip rect from the enclosing layer and 892 // Take our element and get the clip rect from the enclosing layer and
893 // frame view. 893 // frame view.
894 clipRect.intersect( 894 clipRect.intersect(
895 m_element->document().view()->windowClipRectForFrameOwner(m_element, true)); 895 m_element->document().view()->windowClipRectForFrameOwner(m_element, true));
896 } 896 }
897 897
898 return clipRect; 898 return clipRect;
899 } 899 }
900 900
901 } // namespace WebKit 901 } // namespace WebKit
OLDNEW
« no previous file with comments | « Source/web/WebAXObject.cpp ('k') | Source/web/tests/ScrollingCoordinatorChromiumTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698