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

Side by Side Diff: content/browser/renderer_host/input/browser_input_event.cc

Issue 19220002: [WIP] BufferedInputRouter (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix client assignment Created 7 years, 3 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
(Empty)
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "content/browser/renderer_host/input/browser_input_event.h"
6
7 #include "content/common/input/web_input_event_payload.h"
8
9 namespace content {
10
11 BrowserInputEvent::BrowserInputEvent(BrowserInputEventClient* client)
12 : client_(client) {}
13
14 BrowserInputEvent::~BrowserInputEvent() {}
15
16 scoped_ptr<BrowserInputEvent> BrowserInputEvent::Create(
17 int64 id,
18 scoped_ptr<InputEvent::Payload> payload,
19 BrowserInputEventClient* client) {
20 DCHECK(client);
21 scoped_ptr<BrowserInputEvent> event(new BrowserInputEvent(client));
22 event->Initialize(id, payload.Pass());
23 return event.Pass();
24 }
25
26 void BrowserInputEvent::OnDispatched(
27 InputEventDisposition disposition,
28 ScopedVector<BrowserInputEvent>* followup_events) {
29 DCHECK(followup_events);
30
31 bool event_consumed =
32 disposition == INPUT_EVENT_MAIN_THREAD_CONSUMED ||
33 disposition == INPUT_EVENT_IMPL_THREAD_CONSUMED ||
34 disposition == INPUT_EVENT_MAIN_THREAD_PREVENT_DEFAULTED;
35
36 if (!event_consumed && CanCreateFollowupEvents())
37 client_->OnDispatched(*this, disposition, followup_events);
38 else
39 client_->OnDispatched(*this, disposition);
40 }
41
42 bool BrowserInputEvent::CanCreateFollowupEvents() const {
43 return payload()->GetType() == InputEvent::Payload::WEB_INPUT_EVENT &&
44 WebInputEventPayload::Cast(payload())->CanCreateFollowupEvents();
45 }
46
47 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/renderer_host/input/browser_input_event.h ('k') | content/browser/renderer_host/input/buffered_input_router.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698