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

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

Issue 142923005: Allow MessageFilters to restrict listening to specific message classes (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase 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
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "base/auto_reset.h" 5 #include "base/auto_reset.h"
6 #include "base/command_line.h" 6 #include "base/command_line.h"
7 #include "base/run_loop.h" 7 #include "base/run_loop.h"
8 #include "content/browser/renderer_host/render_widget_host_impl.h" 8 #include "content/browser/renderer_host/render_widget_host_impl.h"
9 #include "content/browser/web_contents/web_contents_impl.h" 9 #include "content/browser/web_contents/web_contents_impl.h"
10 #include "content/common/input/synthetic_web_input_event_builders.h" 10 #include "content/common/input/synthetic_web_input_event_builders.h"
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
75 " }" 75 " }"
76 "</script>"; 76 "</script>";
77 77
78 } // namespace 78 } // namespace
79 79
80 namespace content { 80 namespace content {
81 81
82 class InputEventMessageFilter : public BrowserMessageFilter { 82 class InputEventMessageFilter : public BrowserMessageFilter {
83 public: 83 public:
84 InputEventMessageFilter() 84 InputEventMessageFilter()
85 : type_(WebInputEvent::Undefined), 85 : BrowserMessageFilter(InputMsgStart),
86 type_(WebInputEvent::Undefined),
86 state_(INPUT_EVENT_ACK_STATE_UNKNOWN) {} 87 state_(INPUT_EVENT_ACK_STATE_UNKNOWN) {}
87 88
88 void WaitForAck(WebInputEvent::Type type) { 89 void WaitForAck(WebInputEvent::Type type) {
89 base::RunLoop run_loop; 90 base::RunLoop run_loop;
90 base::AutoReset<base::Closure> reset_quit(&quit_, run_loop.QuitClosure()); 91 base::AutoReset<base::Closure> reset_quit(&quit_, run_loop.QuitClosure());
91 base::AutoReset<WebInputEvent::Type> reset_type(&type_, type); 92 base::AutoReset<WebInputEvent::Type> reset_type(&type_, type);
92 run_loop.Run(); 93 run_loop.Run();
93 } 94 }
94 95
95 InputEventAckState last_ack_state() const { return state_; } 96 InputEventAckState last_ack_state() const { return state_; }
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after
268 INSTANTIATE_TEST_CASE_P(WithoutInputHandlerProxy, TouchInputBrowserTest, 269 INSTANTIATE_TEST_CASE_P(WithoutInputHandlerProxy, TouchInputBrowserTest,
269 ::testing::Values(std::string(switches::kDisableThreadedCompositing))); 270 ::testing::Values(std::string(switches::kDisableThreadedCompositing)));
270 #endif 271 #endif
271 272
272 #if defined(USE_AURA) || defined(OS_MACOSX) 273 #if defined(USE_AURA) || defined(OS_MACOSX)
273 INSTANTIATE_TEST_CASE_P(WithInputHandlerProxy, TouchInputBrowserTest, 274 INSTANTIATE_TEST_CASE_P(WithInputHandlerProxy, TouchInputBrowserTest,
274 ::testing::Values(std::string(switches::kEnableThreadedCompositing))); 275 ::testing::Values(std::string(switches::kEnableThreadedCompositing)));
275 #endif 276 #endif
276 277
277 } // namespace content 278 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/renderer_host/gpu_message_filter.cc ('k') | content/browser/renderer_host/media/audio_input_renderer_host.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698