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

Side by Side Diff: Source/core/page/EventHandler.cpp

Issue 1111273008: Removing unnecessary creation of local variable (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 7 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 | « no previous file | no next file » | 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, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserv ed. 2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserv ed.
3 * Copyright (C) 2006 Alexey Proskuryakov (ap@webkit.org) 3 * Copyright (C) 2006 Alexey Proskuryakov (ap@webkit.org)
4 * Copyright (C) 2012 Digia Plc. and/or its subsidiary(-ies) 4 * Copyright (C) 2012 Digia Plc. and/or its subsidiary(-ies)
5 * 5 *
6 * Redistribution and use in source and binary forms, with or without 6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions 7 * modification, are permitted provided that the following conditions
8 * are met: 8 * are met:
9 * 1. Redistributions of source code must retain the above copyright 9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 2986 matching lines...) Expand 10 before | Expand all | Expand 10 after
2997 // Update the hit-test result to be a point-based result instead of a rect-b ased result. 2997 // Update the hit-test result to be a point-based result instead of a rect-b ased result.
2998 // FIXME: We should do this even when no candidate matches the node filter. crbug.com/398914 2998 // FIXME: We should do this even when no candidate matches the node filter. crbug.com/398914
2999 if (adjusted) { 2999 if (adjusted) {
3000 hitTestResult->resolveRectBasedTest(adjustedNode, m_frame->view()->rootF rameToContents(adjustedPoint)); 3000 hitTestResult->resolveRectBasedTest(adjustedNode, m_frame->view()->rootF rameToContents(adjustedPoint));
3001 gestureEvent->applyTouchAdjustment(adjustedPoint); 3001 gestureEvent->applyTouchAdjustment(adjustedPoint);
3002 } 3002 }
3003 } 3003 }
3004 3004
3005 bool EventHandler::sendContextMenuEvent(const PlatformMouseEvent& event) 3005 bool EventHandler::sendContextMenuEvent(const PlatformMouseEvent& event)
3006 { 3006 {
3007 Document* doc = m_frame->document();
3008 FrameView* v = m_frame->view(); 3007 FrameView* v = m_frame->view();
3009 if (!v) 3008 if (!v)
3010 return false; 3009 return false;
3011 3010
3012 // Clear mouse press state to avoid initiating a drag while context menu is up. 3011 // Clear mouse press state to avoid initiating a drag while context menu is up.
3013 m_mousePressed = false; 3012 m_mousePressed = false;
3014 LayoutPoint positionInContents = v->rootFrameToContents(event.position()); 3013 LayoutPoint positionInContents = v->rootFrameToContents(event.position());
3015 HitTestRequest request(HitTestRequest::Active); 3014 HitTestRequest request(HitTestRequest::Active);
3016 MouseEventWithHitTestResults mev = doc->prepareMouseEvent(request, positionI nContents, event); 3015 MouseEventWithHitTestResults mev = m_frame->document()->prepareMouseEvent(re quest, positionInContents, event);
3017 3016
3018 if (!m_frame->selection().contains(positionInContents) 3017 if (!m_frame->selection().contains(positionInContents)
3019 && !mev.scrollbar() 3018 && !mev.scrollbar()
3020 // FIXME: In the editable case, word selection sometimes selects content that isn't underneath the mouse. 3019 // FIXME: In the editable case, word selection sometimes selects content that isn't underneath the mouse.
3021 // If the selection is non-editable, we do word selection to make it eas ier to use the contextual menu items 3020 // If the selection is non-editable, we do word selection to make it eas ier to use the contextual menu items
3022 // available for text selections. But only if we're above text. 3021 // available for text selections. But only if we're above text.
3023 && (m_frame->selection().isContentEditable() || (mev.innerNode() && mev. innerNode()->isTextNode()))) { 3022 && (m_frame->selection().isContentEditable() || (mev.innerNode() && mev. innerNode()->isTextNode()))) {
3024 m_mouseDownMayStartSelect = true; // context menu events are always allo wed to perform a selection 3023 m_mouseDownMayStartSelect = true; // context menu events are always allo wed to perform a selection
3025 3024
3026 if (mev.hitTestResult().isMisspelled()) 3025 if (mev.hitTestResult().isMisspelled())
(...skipping 1109 matching lines...) Expand 10 before | Expand all | Expand 10 after
4136 unsigned EventHandler::accessKeyModifiers() 4135 unsigned EventHandler::accessKeyModifiers()
4137 { 4136 {
4138 #if OS(MACOSX) 4137 #if OS(MACOSX)
4139 return PlatformEvent::CtrlKey | PlatformEvent::AltKey; 4138 return PlatformEvent::CtrlKey | PlatformEvent::AltKey;
4140 #else 4139 #else
4141 return PlatformEvent::AltKey; 4140 return PlatformEvent::AltKey;
4142 #endif 4141 #endif
4143 } 4142 }
4144 4143
4145 } // namespace blink 4144 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698