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

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

Issue 234913005: Refactor wheel event handler registration in ScrollingCoordinator (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: More concise. Created 6 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | Source/core/page/scrolling/ScrollingCoordinator.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) 2013 Google, Inc. All rights reserved. 2 * Copyright (C) 2013 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 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * * Redistributions of source code must retain the above copyright 7 * * Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * * Redistributions in binary form must reproduce the above copyright 9 * * Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
62 static void wheelEventHandlerCountChanged(Document& document) 62 static void wheelEventHandlerCountChanged(Document& document)
63 { 63 {
64 Page* page = document.page(); 64 Page* page = document.page();
65 if (!page) 65 if (!page)
66 return; 66 return;
67 67
68 ScrollingCoordinator* scrollingCoordinator = page->scrollingCoordinator(); 68 ScrollingCoordinator* scrollingCoordinator = page->scrollingCoordinator();
69 if (!scrollingCoordinator) 69 if (!scrollingCoordinator)
70 return; 70 return;
71 71
72 FrameView* frameView = document.view(); 72 scrollingCoordinator->updateHaveWheelEventHandlers();
73 if (!frameView)
74 return;
75
76 scrollingCoordinator->frameViewWheelEventHandlerCountChanged(frameView);
77 } 73 }
78 74
79 void WheelController::didAddWheelEventHandler(Document& document) 75 void WheelController::didAddWheelEventHandler(Document& document)
80 { 76 {
81 ++m_wheelEventHandlerCount; 77 ++m_wheelEventHandlerCount;
82 Page* page = document.page(); 78 Page* page = document.page();
83 LocalFrame* mainFrame = page ? page->mainFrame() : 0; 79 LocalFrame* mainFrame = page ? page->mainFrame() : 0;
84 if (mainFrame) 80 if (mainFrame)
85 mainFrame->notifyChromeClientWheelEventHandlerCountChanged(); 81 mainFrame->notifyChromeClientWheelEventHandlerCountChanged();
86 82
(...skipping 26 matching lines...) Expand all
113 { 109 {
114 if (eventType != EventTypeNames::wheel && eventType != EventTypeNames::mouse wheel) 110 if (eventType != EventTypeNames::wheel && eventType != EventTypeNames::mouse wheel)
115 return; 111 return;
116 112
117 Document* document = window->document(); 113 Document* document = window->document();
118 ASSERT(document); 114 ASSERT(document);
119 didRemoveWheelEventHandler(*document); 115 didRemoveWheelEventHandler(*document);
120 } 116 }
121 117
122 } // namespace WebCore 118 } // namespace WebCore
OLDNEW
« no previous file with comments | « no previous file | Source/core/page/scrolling/ScrollingCoordinator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698