Revert "Enable by default drive search on all channels and LSP API on dev."
[chromium-blink-merge.git] / components / guest_view / renderer / guest_view_container_dispatcher.cc
blob23a5b51958a74f90c5591946400d157fbff25809
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.
5 #include "components/guest_view/renderer/guest_view_container_dispatcher.h"
7 #include "components/guest_view/common/guest_view_constants.h"
8 #include "components/guest_view/renderer/guest_view_container.h"
9 #include "ipc/ipc_message_macros.h"
11 namespace guest_view {
13 GuestViewContainerDispatcher::GuestViewContainerDispatcher() {
16 GuestViewContainerDispatcher::~GuestViewContainerDispatcher() {
19 bool GuestViewContainerDispatcher::HandlesMessage(const IPC::Message& message) {
20 return IPC_MESSAGE_CLASS(message) == GuestViewMsgStart;
23 bool GuestViewContainerDispatcher::OnControlMessageReceived(
24 const IPC::Message& message) {
25 if (!HandlesMessage(message))
26 return false;
28 int element_instance_id = kInstanceIDNone;
29 base::PickleIterator iter(message);
30 bool success = iter.ReadInt(&element_instance_id);
31 DCHECK(success);
33 auto* container = GuestViewContainer::FromID(element_instance_id);
34 if (!container)
35 return false;
37 return container->OnMessageReceived(message);
40 } // namespace guest_view