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_EXTENSION_VIEW_EXTENSION_VIEW_GUEST_H_ |
| 6 #define EXTENSIONS_BROWSER_GUEST_VIEW_EXTENSION_VIEW_EXTENSION_VIEW_GUEST_H_ |
| 7 |
| 8 #include "base/macros.h" |
| 9 #include "extensions/browser/extension_function_dispatcher.h" |
| 10 #include "extensions/browser/guest_view/guest_view.h" |
| 11 #include "url/gurl.h" |
| 12 |
| 13 namespace content { |
| 14 class BrowserContext; |
| 15 } |
| 16 |
| 17 namespace extensions { |
| 18 |
| 19 class ExtensionViewGuest |
| 20 : public extensions::GuestView<ExtensionViewGuest>, |
| 21 public extensions::ExtensionFunctionDispatcher::Delegate { |
| 22 public: |
| 23 static const char Type[]; |
| 24 static extensions::GuestViewBase* Create( |
| 25 content::WebContents* owner_web_contents); |
| 26 |
| 27 // Request navigating the guest to the provided |src| URL. |
| 28 void NavigateGuest(const std::string& src, bool force_navigation); |
| 29 |
| 30 // GuestViewBase implementation. |
| 31 void CreateWebContents(const base::DictionaryValue& create_params, |
| 32 const WebContentsCreatedCallback& callback) override; |
| 33 void DidAttachToEmbedder() override; |
| 34 const char* GetAPINamespace() const override; |
| 35 int GetTaskPrefix() const override; |
| 36 |
| 37 // content::WebContentsObserver implementation. |
| 38 bool OnMessageReceived(const IPC::Message& message) override; |
| 39 |
| 40 private: |
| 41 ExtensionViewGuest(content::WebContents* owner_web_contents); |
| 42 ~ExtensionViewGuest() override; |
| 43 void OnRequest(const ExtensionHostMsg_Request_Params& params); |
| 44 |
| 45 // Applies attributes to the extensionview. |
| 46 void ApplyAttributes(const base::DictionaryValue& params); |
| 47 |
| 48 scoped_ptr<extensions::ExtensionFunctionDispatcher> |
| 49 extension_function_dispatcher_; |
| 50 GURL view_page_; |
| 51 |
| 52 DISALLOW_COPY_AND_ASSIGN(ExtensionViewGuest); |
| 53 }; |
| 54 |
| 55 } // namespace extensions |
| 56 |
| 57 #endif // EXTENSIONS_BROWSER_GUEST_VIEW_EXTENSION_VIEW_EXTENSION_VIEW_GUEST_H_ |
OLD | NEW |