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

Side by Side Diff: Source/core/loader/NavigationAction.cpp

Issue 206453010: NavigationAction should not retain Event. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 9 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 | Annotate | Revision Log
« no previous file with comments | « Source/core/loader/NavigationAction.h ('k') | Source/web/WebDataSourceImpl.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) 2006 Apple Computer, Inc. All rights reserved. 2 * Copyright (C) 2006 Apple Computer, 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 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 7 *
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. 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 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 return NavigationTypeBackForward; 48 return NavigationTypeBackForward;
49 return NavigationTypeOther; 49 return NavigationTypeOther;
50 } 50 }
51 51
52 NavigationAction::NavigationAction() 52 NavigationAction::NavigationAction()
53 : m_type(NavigationTypeOther) 53 : m_type(NavigationTypeOther)
54 { 54 {
55 } 55 }
56 56
57 NavigationAction::NavigationAction(const ResourceRequest& resourceRequest, Frame LoadType frameLoadType, 57 NavigationAction::NavigationAction(const ResourceRequest& resourceRequest, Frame LoadType frameLoadType,
58 bool isFormSubmission, PassRefPtr<Event> event) 58 bool isFormSubmission, PassRefPtr<Event> passEvent)
59 : m_resourceRequest(resourceRequest) 59 : m_resourceRequest(resourceRequest)
60 , m_type(navigationType(frameLoadType, isFormSubmission || resourceRequest.h ttpBody(), event))
61 , m_event(event)
62 { 60 {
61 RefPtr<Event> event = passEvent;
62 m_type = navigationType(frameLoadType, isFormSubmission || resourceRequest.h ttpBody(), event);
63 m_eventTimeStamp = event ? event->timeStamp() : 0;
64
63 const MouseEvent* mouseEvent = 0; 65 const MouseEvent* mouseEvent = 0;
64 if (m_type == NavigationTypeLinkClicked && m_event->isMouseEvent()) 66 if (m_type == NavigationTypeLinkClicked) {
65 mouseEvent = toMouseEvent(m_event.get()); 67 ASSERT(event);
66 else if (m_type == NavigationTypeFormSubmitted && m_event && m_event->underl yingEvent() && m_event->underlyingEvent()->isMouseEvent()) 68 if (event->isMouseEvent())
67 mouseEvent = toMouseEvent(m_event->underlyingEvent()); 69 mouseEvent = toMouseEvent(event.get());
70 } else if (m_type == NavigationTypeFormSubmitted && event && event->underlyi ngEvent() && event->underlyingEvent()->isMouseEvent()) {
71 mouseEvent = toMouseEvent(event->underlyingEvent());
72 }
68 73
69 if (!mouseEvent || !navigationPolicyFromMouseEvent(mouseEvent->button(), mou seEvent->ctrlKey(), mouseEvent->shiftKey(), mouseEvent->altKey(), mouseEvent->me taKey(), &m_policy)) 74 if (!mouseEvent || !navigationPolicyFromMouseEvent(mouseEvent->button(), mou seEvent->ctrlKey(), mouseEvent->shiftKey(), mouseEvent->altKey(), mouseEvent->me taKey(), &m_policy))
70 m_policy = NavigationPolicyCurrentTab; 75 m_policy = NavigationPolicyCurrentTab;
71 } 76 }
72 77
73 } 78 }
OLDNEW
« no previous file with comments | « Source/core/loader/NavigationAction.h ('k') | Source/web/WebDataSourceImpl.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698