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_
10 #include "base/memory/scoped_ptr.h"
11 #include "base/values.h"
14 class DictionaryValue
;
17 namespace guest_view
{
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
27 class GuestViewManagerDelegate
{
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
,
39 // Indicates whether the |guest| can be used within the context of where it
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
48 virtual void RegisterAdditionalGuestViewTypes() {}
51 } // namespace guest_view
53 #endif // COMPONENTS_GUEST_VIEW_BROWSER_GUEST_VIEW_MANAGER_DELEGATE_H_