OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CHROME_BROWSER_GUEST_VIEW_CHROME_GUEST_VIEW_MANAGER_DELEGATE_H_ | 5 #ifndef CHROME_BROWSER_GUEST_VIEW_CHROME_GUEST_VIEW_MANAGER_DELEGATE_H_ |
6 #define CHROME_BROWSER_GUEST_VIEW_CHROME_GUEST_VIEW_MANAGER_DELEGATE_H_ | 6 #define CHROME_BROWSER_GUEST_VIEW_CHROME_GUEST_VIEW_MANAGER_DELEGATE_H_ |
7 | 7 |
8 #include "base/macros.h" | 8 #include "components/guest_view/browser/guest_view_manager_delegate.h" |
9 #include "extensions/browser/guest_view/extensions_guest_view_manager_delegate.h
" | 9 #include "content/public/browser/browser_context.h" |
10 | 10 |
11 namespace extensions { | 11 #if defined(ENABLE_EXTENSIONS) |
| 12 #include "chrome/browser/guest_view/chrome_extensions_guest_view_manager_delegat
e.h" |
| 13 #endif // defined(ENABLE_EXTENSIONS) |
12 | 14 |
13 // Defines a chrome-specific implementation of | 15 namespace chrome { |
14 // ExtensionsGuestViewManagerDelegate that knows about the concept of a task | 16 |
15 // manager and the need for tagging the guest view WebContents by their | 17 #if defined(ENABLE_EXTENSIONS) |
16 // appropriate task manager tag. | 18 using GuestViewManagerDelegateBase = |
17 class ChromeGuestViewManagerDelegate | 19 extensions::ChromeExtensionsGuestViewManagerDelegate; |
18 : public ExtensionsGuestViewManagerDelegate { | 20 #else |
| 21 using GuestViewManagerDelegateBase = guest_view::GuestViewManagerDelegate; |
| 22 #endif // defined(ENABLE_EXTENSIONS) |
| 23 |
| 24 // Defines a chrome-specific implementation of GuestViewManagerDelegate. |
| 25 class ChromeGuestViewManagerDelegate : public GuestViewManagerDelegateBase { |
19 public: | 26 public: |
20 explicit ChromeGuestViewManagerDelegate(content::BrowserContext* context); | 27 static guest_view::GuestViewManagerDelegate* Create( |
| 28 content::BrowserContext* context); |
21 ~ChromeGuestViewManagerDelegate() override; | 29 ~ChromeGuestViewManagerDelegate() override; |
22 | 30 |
23 // GuestViewManagerDelegate: | 31 // GuestViewManagerDelegate implementation. |
24 void OnGuestAdded(content::WebContents* guest_web_contents) const override; | 32 void DispatchEvent(const std::string& event_name, |
| 33 scoped_ptr<base::DictionaryValue> args, |
| 34 guest_view::GuestViewBase* guest, |
| 35 int instance_id) override; |
| 36 bool IsGuestAvailableToContext(guest_view::GuestViewBase* guest) override; |
| 37 void RegisterAdditionalGuestViewTypes() override; |
25 | 38 |
26 private: | 39 private: |
| 40 explicit ChromeGuestViewManagerDelegate(content::BrowserContext* context); |
| 41 |
| 42 #if !defined(ENABLE_EXTENSIONS) |
| 43 content::BrowserContext* const context_; |
| 44 #endif |
| 45 |
27 DISALLOW_COPY_AND_ASSIGN(ChromeGuestViewManagerDelegate); | 46 DISALLOW_COPY_AND_ASSIGN(ChromeGuestViewManagerDelegate); |
28 }; | 47 }; |
29 | 48 |
30 } // namespace extensions | 49 } // namespace chrome |
31 | 50 |
32 #endif // CHROME_BROWSER_GUEST_VIEW_CHROME_GUEST_VIEW_MANAGER_DELEGATE_H_ | 51 #endif // CHROME_BROWSER_GUEST_VIEW_CHROME_GUEST_VIEW_MANAGER_DELEGATE_H_ |
OLD | NEW |