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
;
19 } // namespace content
21 namespace guest_view
{
25 // A GuestViewManagerDelegate interface allows GuestViewManager to delegate
26 // responsibilities to other modules in Chromium. Different builds of Chromium
27 // may use different GuestViewManagerDelegate implementations. For example,
28 // mobile builds of Chromium do not include an extensions module and so
29 // permission checks would be different, and IsOwnedByExtension would always
31 class GuestViewManagerDelegate
{
33 GuestViewManagerDelegate();
34 virtual ~GuestViewManagerDelegate();
36 // Attaches the task-manager-specific tag for the GuestViews to its
37 // |guest_web_contents| so that their corresponding tasks show up in the task
39 virtual void AttachTaskManagerGuestTag(
40 content::WebContents
* guest_web_contents
) const {}
42 // Dispatches the event with |name| with the provided |args| to the embedder
43 // of the given |guest| with |instance_id| for routing.
44 virtual void DispatchEvent(const std::string
& event_name
,
45 scoped_ptr
<base::DictionaryValue
> args
,
49 // Indicates whether the |guest| can be used within the context of where it
51 virtual bool IsGuestAvailableToContext(GuestViewBase
* guest
);
53 // Indicates whether the |guest| is owned by an extension or Chrome App.
54 virtual bool IsOwnedByExtension(GuestViewBase
* guest
);
56 // Registers additional GuestView types the delegator (GuestViewManger) can
58 virtual void RegisterAdditionalGuestViewTypes() {}
61 } // namespace guest_view
63 #endif // COMPONENTS_GUEST_VIEW_BROWSER_GUEST_VIEW_MANAGER_DELEGATE_H_