OLD | NEW |
(Empty) | |
| 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. |
| 4 |
| 5 #ifndef EXTENSIONS_BROWSER_GUEST_VIEW_GUEST_VIEW_MANAGER_DELEGATE_H_ |
| 6 #define EXTENSIONS_BROWSER_GUEST_VIEW_GUEST_VIEW_MANAGER_DELEGATE_H_ |
| 7 |
| 8 #include <string> |
| 9 |
| 10 #include "base/memory/scoped_ptr.h" |
| 11 |
| 12 namespace base { |
| 13 class DictionaryValue; |
| 14 } // namespace base |
| 15 |
| 16 namespace extensions { |
| 17 class GuestViewBase; |
| 18 } // namespace extensions |
| 19 |
| 20 namespace guestview { |
| 21 |
| 22 // A GuestViewManagerDelegate interface allows GuestViewManager to delegate |
| 23 // responsibilities to other modules in Chromium. Different builds of Chromium |
| 24 // may use different GuestViewManagerDelegate implementations. For example, |
| 25 // mobile builds of Chromium do not include an extensions module and so |
| 26 // permission checks would be different, and IsOwnedByExtension would always |
| 27 // return false. |
| 28 class GuestViewManagerDelegate { |
| 29 public: |
| 30 virtual ~GuestViewManagerDelegate() {} |
| 31 |
| 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 extensions::GuestViewBase* guest, |
| 37 int instance_id) = 0; |
| 38 |
| 39 // Indicates whether the |guest| can be used within the context of where it |
| 40 // was created. |
| 41 virtual bool IsGuestAvailableToContext(extensions::GuestViewBase* guest) = 0; |
| 42 |
| 43 // Indicates whether the |guest| is owned by an extension or Chrome App. |
| 44 virtual bool IsOwnedByExtension(extensions::GuestViewBase* guest) = 0; |
| 45 |
| 46 // Registers additional GuestView types the delegator (GuestViewManger) can |
| 47 // create. |
| 48 virtual void RegisterAdditionalGuestViewTypes() = 0; |
| 49 }; |
| 50 |
| 51 } // namespace guestview |
| 52 |
| 53 #endif // EXTENSIONS_BROWSER_GUEST_VIEW_GUEST_VIEW_MANAGER_DELEGATE_H_ |
OLD | NEW |