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

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

Issue 1878493002: ASSERT_NOT_REACHED() -> NOTREACHED() in web. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2011, 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2011, 2012 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 887 matching lines...) Expand 10 before | Expand all | Expand 10 after
898 } 898 }
899 case WebInputEvent::GestureShowPress: 899 case WebInputEvent::GestureShowPress:
900 m_client->cancelScheduledContentIntents(); 900 m_client->cancelScheduledContentIntents();
901 case WebInputEvent::GestureTapDown: 901 case WebInputEvent::GestureTapDown:
902 case WebInputEvent::GestureTapCancel: 902 case WebInputEvent::GestureTapCancel:
903 case WebInputEvent::GestureTapUnconfirmed: { 903 case WebInputEvent::GestureTapUnconfirmed: {
904 eventResult = mainFrameImpl()->frame()->eventHandler().handleGestureEven t(targetedEvent); 904 eventResult = mainFrameImpl()->frame()->eventHandler().handleGestureEven t(targetedEvent);
905 break; 905 break;
906 } 906 }
907 default: 907 default:
908 ASSERT_NOT_REACHED(); 908 NOTREACHED();
909 } 909 }
910 m_client->didHandleGestureEvent(event, eventCancelled); 910 m_client->didHandleGestureEvent(event, eventCancelled);
911 return eventResult; 911 return eventResult;
912 } 912 }
913 913
914 WebInputEventResult WebViewImpl::handleSyntheticWheelFromTouchpadPinchEvent(cons t WebGestureEvent& pinchEvent) 914 WebInputEventResult WebViewImpl::handleSyntheticWheelFromTouchpadPinchEvent(cons t WebGestureEvent& pinchEvent)
915 { 915 {
916 DCHECK_EQ(pinchEvent.type, WebInputEvent::GesturePinchUpdate); 916 DCHECK_EQ(pinchEvent.type, WebInputEvent::GesturePinchUpdate);
917 917
918 // Touchscreen pinch events should not reach Blink. 918 // Touchscreen pinch events should not reach Blink.
(...skipping 1274 matching lines...) Expand 10 before | Expand all | Expand 10 after
2193 case WebInputEvent::MouseDown: 2193 case WebInputEvent::MouseDown:
2194 eventType = EventTypeNames::mousedown; 2194 eventType = EventTypeNames::mousedown;
2195 gestureIndicator = adoptPtr(new UserGestureIndicator(DefinitelyProce ssingNewUserGesture)); 2195 gestureIndicator = adoptPtr(new UserGestureIndicator(DefinitelyProce ssingNewUserGesture));
2196 m_mouseCaptureGestureToken = gestureIndicator->currentToken(); 2196 m_mouseCaptureGestureToken = gestureIndicator->currentToken();
2197 break; 2197 break;
2198 case WebInputEvent::MouseUp: 2198 case WebInputEvent::MouseUp:
2199 eventType = EventTypeNames::mouseup; 2199 eventType = EventTypeNames::mouseup;
2200 gestureIndicator = adoptPtr(new UserGestureIndicator(m_mouseCaptureG estureToken.release())); 2200 gestureIndicator = adoptPtr(new UserGestureIndicator(m_mouseCaptureG estureToken.release()));
2201 break; 2201 break;
2202 default: 2202 default:
2203 ASSERT_NOT_REACHED(); 2203 NOTREACHED();
2204 } 2204 }
2205 2205
2206 node->dispatchMouseEvent( 2206 node->dispatchMouseEvent(
2207 PlatformMouseEventBuilder(mainFrameImpl()->frameView(), static_cast< const WebMouseEvent&>(inputEvent)), 2207 PlatformMouseEventBuilder(mainFrameImpl()->frameView(), static_cast< const WebMouseEvent&>(inputEvent)),
2208 eventType, static_cast<const WebMouseEvent&>(inputEvent).clickCount) ; 2208 eventType, static_cast<const WebMouseEvent&>(inputEvent).clickCount) ;
2209 return WebInputEventResult::HandledSystem; 2209 return WebInputEventResult::HandledSystem;
2210 } 2210 }
2211 2211
2212 // FIXME: This should take in the intended frame, not the local frame root. 2212 // FIXME: This should take in the intended frame, not the local frame root.
2213 WebInputEventResult result = PageWidgetDelegate::handleInputEvent(*this, inp utEvent, mainFrameImpl()->frame()); 2213 WebInputEventResult result = PageWidgetDelegate::handleInputEvent(*this, inp utEvent, mainFrameImpl()->frame());
(...skipping 360 matching lines...) Expand 10 before | Expand all | Expand 10 after
2574 const AtomicString& autocapitalize = formElement->autocapitalize(); 2574 const AtomicString& autocapitalize = formElement->autocapitalize();
2575 if (autocapitalize == none) 2575 if (autocapitalize == none)
2576 flags |= WebTextInputFlagAutocapitalizeNone; 2576 flags |= WebTextInputFlagAutocapitalizeNone;
2577 else if (autocapitalize == characters) 2577 else if (autocapitalize == characters)
2578 flags |= WebTextInputFlagAutocapitalizeCharacters; 2578 flags |= WebTextInputFlagAutocapitalizeCharacters;
2579 else if (autocapitalize == words) 2579 else if (autocapitalize == words)
2580 flags |= WebTextInputFlagAutocapitalizeWords; 2580 flags |= WebTextInputFlagAutocapitalizeWords;
2581 else if (autocapitalize == sentences) 2581 else if (autocapitalize == sentences)
2582 flags |= WebTextInputFlagAutocapitalizeSentences; 2582 flags |= WebTextInputFlagAutocapitalizeSentences;
2583 else 2583 else
2584 ASSERT_NOT_REACHED(); 2584 NOTREACHED();
2585 } 2585 }
2586 } 2586 }
2587 2587
2588 return flags; 2588 return flags;
2589 } 2589 }
2590 2590
2591 WebString WebViewImpl::inputModeOfFocusedElement() 2591 WebString WebViewImpl::inputModeOfFocusedElement()
2592 { 2592 {
2593 if (!RuntimeEnabledFeatures::inputModeAttributeEnabled()) 2593 if (!RuntimeEnabledFeatures::inputModeAttributeEnabled())
2594 return WebString(); 2594 return WebString();
(...skipping 913 matching lines...) Expand 10 before | Expand all | Expand 10 after
3508 case WebMediaPlayerAction::Mute: 3508 case WebMediaPlayerAction::Mute:
3509 mediaElement->setMuted(action.enable); 3509 mediaElement->setMuted(action.enable);
3510 break; 3510 break;
3511 case WebMediaPlayerAction::Loop: 3511 case WebMediaPlayerAction::Loop:
3512 mediaElement->setLoop(action.enable); 3512 mediaElement->setLoop(action.enable);
3513 break; 3513 break;
3514 case WebMediaPlayerAction::Controls: 3514 case WebMediaPlayerAction::Controls:
3515 mediaElement->setBooleanAttribute(HTMLNames::controlsAttr, action.enable ); 3515 mediaElement->setBooleanAttribute(HTMLNames::controlsAttr, action.enable );
3516 break; 3516 break;
3517 default: 3517 default:
3518 ASSERT_NOT_REACHED(); 3518 NOTREACHED();
3519 } 3519 }
3520 } 3520 }
3521 3521
3522 void WebViewImpl::performPluginAction(const WebPluginAction& action, 3522 void WebViewImpl::performPluginAction(const WebPluginAction& action,
3523 const WebPoint& location) 3523 const WebPoint& location)
3524 { 3524 {
3525 // FIXME: Location is probably in viewport coordinates 3525 // FIXME: Location is probably in viewport coordinates
3526 HitTestResult result = hitTestResultForRootFramePos(location); 3526 HitTestResult result = hitTestResultForRootFramePos(location);
3527 Node* node = result.innerNode(); 3527 Node* node = result.innerNode();
3528 if (!isHTMLObjectElement(*node) && !isHTMLEmbedElement(*node)) 3528 if (!isHTMLObjectElement(*node) && !isHTMLEmbedElement(*node))
3529 return; 3529 return;
3530 3530
3531 LayoutObject* object = node->layoutObject(); 3531 LayoutObject* object = node->layoutObject();
3532 if (object && object->isLayoutPart()) { 3532 if (object && object->isLayoutPart()) {
3533 Widget* widget = toLayoutPart(object)->widget(); 3533 Widget* widget = toLayoutPart(object)->widget();
3534 if (widget && widget->isPluginContainer()) { 3534 if (widget && widget->isPluginContainer()) {
3535 WebPluginContainerImpl* plugin = toWebPluginContainerImpl(widget); 3535 WebPluginContainerImpl* plugin = toWebPluginContainerImpl(widget);
3536 switch (action.type) { 3536 switch (action.type) {
3537 case WebPluginAction::Rotate90Clockwise: 3537 case WebPluginAction::Rotate90Clockwise:
3538 plugin->plugin()->rotateView(WebPlugin::RotationType90Clockwise) ; 3538 plugin->plugin()->rotateView(WebPlugin::RotationType90Clockwise) ;
3539 break; 3539 break;
3540 case WebPluginAction::Rotate90Counterclockwise: 3540 case WebPluginAction::Rotate90Counterclockwise:
3541 plugin->plugin()->rotateView(WebPlugin::RotationType90Counterclo ckwise); 3541 plugin->plugin()->rotateView(WebPlugin::RotationType90Counterclo ckwise);
3542 break; 3542 break;
3543 default: 3543 default:
3544 ASSERT_NOT_REACHED(); 3544 NOTREACHED();
3545 } 3545 }
3546 } 3546 }
3547 } 3547 }
3548 } 3548 }
3549 3549
3550 WebHitTestResult WebViewImpl::hitTestResultAt(const WebPoint& point) 3550 WebHitTestResult WebViewImpl::hitTestResultAt(const WebPoint& point)
3551 { 3551 {
3552 return coreHitTestResultAt(point); 3552 return coreHitTestResultAt(point);
3553 } 3553 }
3554 3554
(...skipping 967 matching lines...) Expand 10 before | Expand all | Expand 10 after
4522 m_pointerLockGestureToken = gestureIndicator->currentToken(); 4522 m_pointerLockGestureToken = gestureIndicator->currentToken();
4523 break; 4523 break;
4524 case WebInputEvent::MouseUp: 4524 case WebInputEvent::MouseUp:
4525 eventType = EventTypeNames::mouseup; 4525 eventType = EventTypeNames::mouseup;
4526 gestureIndicator = adoptPtr(new UserGestureIndicator(m_pointerLockGestur eToken.release())); 4526 gestureIndicator = adoptPtr(new UserGestureIndicator(m_pointerLockGestur eToken.release()));
4527 break; 4527 break;
4528 case WebInputEvent::MouseMove: 4528 case WebInputEvent::MouseMove:
4529 eventType = EventTypeNames::mousemove; 4529 eventType = EventTypeNames::mousemove;
4530 break; 4530 break;
4531 default: 4531 default:
4532 ASSERT_NOT_REACHED(); 4532 NOTREACHED();
4533 } 4533 }
4534 4534
4535 const WebMouseEvent& mouseEvent = static_cast<const WebMouseEvent&>(event); 4535 const WebMouseEvent& mouseEvent = static_cast<const WebMouseEvent&>(event);
4536 4536
4537 if (page()) 4537 if (page())
4538 page()->pointerLockController().dispatchLockedMouseEvent( 4538 page()->pointerLockController().dispatchLockedMouseEvent(
4539 PlatformMouseEventBuilder(mainFrameImpl()->frameView(), mouseEvent), 4539 PlatformMouseEventBuilder(mainFrameImpl()->frameView(), mouseEvent),
4540 eventType); 4540 eventType);
4541 } 4541 }
4542 4542
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
4595 { 4595 {
4596 // TODO(oshima): Investigate if this should return the ScreenInfo's scale fa ctor rather than 4596 // TODO(oshima): Investigate if this should return the ScreenInfo's scale fa ctor rather than
4597 // page's scale factor, which can be 1 in use-zoom-for-dsf mode. 4597 // page's scale factor, which can be 1 in use-zoom-for-dsf mode.
4598 if (!page()) 4598 if (!page())
4599 return 1; 4599 return 1;
4600 4600
4601 return page()->deviceScaleFactor(); 4601 return page()->deviceScaleFactor();
4602 } 4602 }
4603 4603
4604 } // namespace blink 4604 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698