1 // Copyright 2015 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 #ifndef COMPONENTS_GUEST_VIEW_RENDERER_GUEST_VIEW_CONTAINER_DISPATCHER_H_
6 #define COMPONENTS_GUEST_VIEW_RENDERER_GUEST_VIEW_CONTAINER_DISPATCHER_H_
7 
8 #include "base/macros.h"
9 #include "content/public/renderer/render_thread_observer.h"
10 #include "ipc/ipc_message.h"
11 
12 namespace guest_view {
13 
14 // Dispatcher used to route messages to GuestViewContainer.
15 class GuestViewContainerDispatcher : public content::RenderThreadObserver {
16  public:
17   GuestViewContainerDispatcher();
18   ~GuestViewContainerDispatcher() override;
19 
20  protected:
21   // Returns true if |message| is handled for a GuestViewContainer.
22   virtual bool HandlesMessage(const IPC::Message& message);
23 
24   // content::RenderThreadObserver implementation.
25   bool OnControlMessageReceived(const IPC::Message& message) override;
26 
27  private:
28   DISALLOW_COPY_AND_ASSIGN(GuestViewContainerDispatcher);
29 };
30 
31 }  // namespace guest_view
32 
33 #endif  // COMPONENTS_GUEST_VIEW_RENDERER_GUEST_VIEW_CONTAINER_DISPATCHER_H_
34