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

Side by Side Diff: Source/core/dom/Node.cpp

Issue 1233233003: Add Event.isTrusted support (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master_event_trusted_main2
Patch Set: Fix nits Created 5 years, 5 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/bindings/scripts/v8_attributes.py ('k') | Source/core/events/Event.h » ('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) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * (C) 2001 Dirk Mueller (mueller@kde.org) 4 * (C) 2001 Dirk Mueller (mueller@kde.org)
5 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All r ights reserved. 5 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All r ights reserved.
6 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) 6 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies)
7 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo bile.com/) 7 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo bile.com/)
8 * 8 *
9 * This library is free software; you can redistribute it and/or 9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Library General Public 10 * modify it under the terms of the GNU Library General Public
(...skipping 1981 matching lines...) Expand 10 before | Expand all | Expand 10 after
1992 return; 1992 return;
1993 1993
1994 if (isDisabledFormControl(this) && event.isMouseEvent()) 1994 if (isDisabledFormControl(this) && event.isMouseEvent())
1995 return; 1995 return;
1996 1996
1997 fireEventListeners(&event); 1997 fireEventListeners(&event);
1998 } 1998 }
1999 1999
2000 void Node::dispatchScopedEvent(PassRefPtrWillBeRawPtr<Event> event) 2000 void Node::dispatchScopedEvent(PassRefPtrWillBeRawPtr<Event> event)
2001 { 2001 {
2002 event->setTrusted(true);
2002 EventDispatcher::dispatchScopedEvent(*this, event->createMediator()); 2003 EventDispatcher::dispatchScopedEvent(*this, event->createMediator());
2003 } 2004 }
2004 2005
2005 bool Node::dispatchEventInternal(PassRefPtrWillBeRawPtr<Event> event) 2006 bool Node::dispatchEventInternal(PassRefPtrWillBeRawPtr<Event> event)
2006 { 2007 {
2007 return EventDispatcher::dispatchEvent(*this, event->createMediator()); 2008 return EventDispatcher::dispatchEvent(*this, event->createMediator());
2008 } 2009 }
2009 2010
2010 void Node::dispatchSubtreeModifiedEvent() 2011 void Node::dispatchSubtreeModifiedEvent()
2011 { 2012 {
(...skipping 19 matching lines...) Expand all
2031 2032
2032 bool Node::dispatchKeyEvent(const PlatformKeyboardEvent& nativeEvent) 2033 bool Node::dispatchKeyEvent(const PlatformKeyboardEvent& nativeEvent)
2033 { 2034 {
2034 return dispatchEvent(KeyboardEvent::create(nativeEvent, document().domWindow ())); 2035 return dispatchEvent(KeyboardEvent::create(nativeEvent, document().domWindow ()));
2035 } 2036 }
2036 2037
2037 bool Node::dispatchMouseEvent(const PlatformMouseEvent& nativeEvent, const Atomi cString& eventType, 2038 bool Node::dispatchMouseEvent(const PlatformMouseEvent& nativeEvent, const Atomi cString& eventType,
2038 int detail, Node* relatedTarget) 2039 int detail, Node* relatedTarget)
2039 { 2040 {
2040 RefPtrWillBeRawPtr<MouseEvent> event = MouseEvent::create(eventType, documen t().domWindow(), nativeEvent, detail, relatedTarget); 2041 RefPtrWillBeRawPtr<MouseEvent> event = MouseEvent::create(eventType, documen t().domWindow(), nativeEvent, detail, relatedTarget);
2041 event->setTrusted(true);
2042 return dispatchEvent(event); 2042 return dispatchEvent(event);
2043 } 2043 }
2044 2044
2045 bool Node::dispatchGestureEvent(const PlatformGestureEvent& event) 2045 bool Node::dispatchGestureEvent(const PlatformGestureEvent& event)
2046 { 2046 {
2047 RefPtrWillBeRawPtr<GestureEvent> gestureEvent = GestureEvent::create(documen t().domWindow(), event); 2047 RefPtrWillBeRawPtr<GestureEvent> gestureEvent = GestureEvent::create(documen t().domWindow(), event);
2048 if (!gestureEvent.get()) 2048 if (!gestureEvent.get())
2049 return false; 2049 return false;
2050 return dispatchEvent(gestureEvent); 2050 return dispatchEvent(gestureEvent);
2051 } 2051 }
(...skipping 339 matching lines...) Expand 10 before | Expand all | Expand 10 after
2391 2391
2392 void showNodePath(const blink::Node* node) 2392 void showNodePath(const blink::Node* node)
2393 { 2393 {
2394 if (node) 2394 if (node)
2395 node->showNodePathForThis(); 2395 node->showNodePathForThis();
2396 else 2396 else
2397 fprintf(stderr, "Cannot showNodePath for (nil)\n"); 2397 fprintf(stderr, "Cannot showNodePath for (nil)\n");
2398 } 2398 }
2399 2399
2400 #endif 2400 #endif
OLDNEW
« no previous file with comments | « Source/bindings/scripts/v8_attributes.py ('k') | Source/core/events/Event.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698