summaryrefslogtreecommitdiffstats
path: root/extensions/renderer/guest_view/guest_view_container.h
blob: 57a30da6bbaa7d51ef20b9b7c0c575978a491130 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef EXTENSIONS_RENDERER_GUEST_VIEW_GUEST_VIEW_CONTAINER_H_
#define EXTENSIONS_RENDERER_GUEST_VIEW_GUEST_VIEW_CONTAINER_H_

#include "content/public/renderer/browser_plugin_delegate.h"
#include "content/public/renderer/render_frame_observer.h"
#include "ipc/ipc_message.h"

namespace extensions {

class GuestViewContainer : public content::BrowserPluginDelegate {
 public:
  explicit GuestViewContainer(content::RenderFrame* render_frame);
  ~GuestViewContainer() override;

  // Queries whether GuestViewContainer is interested in the |message|.
  static bool HandlesMessage(const IPC::Message& message);

  // BrowserPluginDelegate implementation.
  void SetElementInstanceID(int element_instance_id) override;

  int element_instance_id() const { return element_instance_id_; }
  int render_view_routing_id() const { return render_view_routing_id_; }
  content::RenderFrame* render_frame() const { return render_frame_; }

 private:
  int element_instance_id_;
  const int render_view_routing_id_;
  content::RenderFrame* const render_frame_;

  DISALLOW_COPY_AND_ASSIGN(GuestViewContainer);
};

}  // namespace extensions

#endif  // EXTENSIONS_RENDERER_GUEST_VIEW_GUEST_VIEW_CONTAINER_H_