Stack sampling profiler: add fire-and-forget interface
[chromium-blink-merge.git] / components / guest_view / browser / guest_view_manager_delegate.h
bloba46c278df09d29ac406b2b338bbfa862dc8df220
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 #ifndef COMPONENTS_GUEST_VIEW_BROWSER_GUEST_VIEW_MANAGER_DELEGATE_H_
6 #define COMPONENTS_GUEST_VIEW_BROWSER_GUEST_VIEW_MANAGER_DELEGATE_H_
8 #include <string>
10 #include "base/memory/scoped_ptr.h"
11 #include "base/values.h"
13 namespace base {
14 class DictionaryValue;
15 } // namespace base
17 namespace guest_view {
19 class GuestViewBase;
21 // A GuestViewManagerDelegate interface allows GuestViewManager to delegate
22 // responsibilities to other modules in Chromium. Different builds of Chromium
23 // may use different GuestViewManagerDelegate implementations. For example,
24 // mobile builds of Chromium do not include an extensions module and so
25 // permission checks would be different, and IsOwnedByExtension would always
26 // return false.
27 class GuestViewManagerDelegate {
28 public:
29 GuestViewManagerDelegate();
30 virtual ~GuestViewManagerDelegate();
32 // Dispatches the event with |name| with the provided |args| to the embedder
33 // of the given |guest| with |instance_id| for routing.
34 virtual void DispatchEvent(const std::string& event_name,
35 scoped_ptr<base::DictionaryValue> args,
36 GuestViewBase* guest,
37 int instance_id) {}
39 // Indicates whether the |guest| can be used within the context of where it
40 // was created.
41 virtual bool IsGuestAvailableToContext(GuestViewBase* guest);
43 // Indicates whether the |guest| is owned by an extension or Chrome App.
44 virtual bool IsOwnedByExtension(GuestViewBase* guest);
46 // Registers additional GuestView types the delegator (GuestViewManger) can
47 // create.
48 virtual void RegisterAdditionalGuestViewTypes() {}
51 } // namespace guest_view
53 #endif // COMPONENTS_GUEST_VIEW_BROWSER_GUEST_VIEW_MANAGER_DELEGATE_H_