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 "content/public/browser/browser_context.h" |
9 #include "extensions/browser/guest_view/extensions_guest_view_manager_delegate.h
" | |
10 | 9 |
11 namespace extensions { | 10 #if defined(ENABLE_EXTENSIONS) |
| 11 #include "chrome/browser/guest_view/chrome_extensions_guest_view_manager_delegat
e.h" |
| 12 #else |
| 13 #include "components/guest_view/browser/guest_view_manager_delegate.h" |
| 14 #endif // defined(ENABLE_EXTENSIONS) |
12 | 15 |
13 // Defines a chrome-specific implementation of | 16 namespace chrome { |
14 // ExtensionsGuestViewManagerDelegate that knows about the concept of a task | 17 |
15 // manager and the need for tagging the guest view WebContents by their | 18 #if defined(ENABLE_EXTENSIONS) |
16 // appropriate task manager tag. | 19 using GuestViewManagerDelegateBase = |
17 class ChromeGuestViewManagerDelegate | 20 extensions::ChromeExtensionsGuestViewManagerDelegate; |
18 : public ExtensionsGuestViewManagerDelegate { | 21 #else |
| 22 using GuestViewManagerDelegateBase = guest_view::GuestViewManagerDelegate; |
| 23 #endif // defined(ENABLE_EXTENSIONS) |
| 24 |
| 25 // Defines a chrome-specific implementation of GuestViewManagerDelegate. |
| 26 class ChromeGuestViewManagerDelegate : public GuestViewManagerDelegateBase { |
19 public: | 27 public: |
20 explicit ChromeGuestViewManagerDelegate(content::BrowserContext* context); | 28 explicit ChromeGuestViewManagerDelegate(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 #if !defined(ENABLE_EXTENSIONS) |
| 41 content::BrowserContext* const context_; |
| 42 #endif |
| 43 |
27 DISALLOW_COPY_AND_ASSIGN(ChromeGuestViewManagerDelegate); | 44 DISALLOW_COPY_AND_ASSIGN(ChromeGuestViewManagerDelegate); |
28 }; | 45 }; |
29 | 46 |
30 } // namespace extensions | 47 } // namespace chrome |
31 | 48 |
32 #endif // CHROME_BROWSER_GUEST_VIEW_CHROME_GUEST_VIEW_MANAGER_DELEGATE_H_ | 49 #endif // CHROME_BROWSER_GUEST_VIEW_CHROME_GUEST_VIEW_MANAGER_DELEGATE_H_ |
OLD | NEW |