summaryrefslogtreecommitdiffstats
path: root/extensions/browser/guest_view/extensions_guest_view_manager_delegate.h
blob: 8a2d649cf732929d016e27dc41139a34b4c71397 (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 2015 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_BROWSER_GUEST_VIEW_EXTENSIONS_GUEST_VIEW_MANAGER_DELEGATE_H_
#define EXTENSIONS_BROWSER_GUEST_VIEW_EXTENSIONS_GUEST_VIEW_MANAGER_DELEGATE_H_

#include "components/guest_view/browser/guest_view_manager_delegate.h"

namespace content {
class BrowserContext;
}  // namespace content

namespace extensions {

// ExtensionsGuestViewManagerDelegate implements GuestViewManager functionality
// specific to Chromium builds that include the extensions module.
class ExtensionsGuestViewManagerDelegate
    : public guest_view::GuestViewManagerDelegate {
 public:
  explicit ExtensionsGuestViewManagerDelegate(content::BrowserContext* context);
  ~ExtensionsGuestViewManagerDelegate() override;

  // GuestViewManagerDelegate implementation.
  void DispatchEvent(const std::string& event_name,
                     scoped_ptr<base::DictionaryValue> args,
                     guest_view::GuestViewBase* guest,
                     int instance_id) override;
  bool IsGuestAvailableToContext(guest_view::GuestViewBase* guest) override;
  bool IsOwnedByExtension(guest_view::GuestViewBase* guest) override;
  void RegisterAdditionalGuestViewTypes() override;

 private:
  content::BrowserContext* const context_;
};

}  // namespace extensions

#endif  // EXTENSIONS_BROWSER_GUEST_VIEW_EXTENSIONS_GUEST_VIEW_MANAGER_DELEGATE_H_