Index: extensions/browser/guest_view/extension_view/extension_view_guest.h |
diff --git a/extensions/browser/guest_view/extension_view/extension_view_guest.h b/extensions/browser/guest_view/extension_view/extension_view_guest.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..5fac99d12d9b23c5d93766480eabde29db767cda |
--- /dev/null |
+++ b/extensions/browser/guest_view/extension_view/extension_view_guest.h |
@@ -0,0 +1,59 @@ |
+// Copyright 2015 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#ifndef EXTENSIONS_BROWSER_GUEST_VIEW_EXTENSION_VIEW_EXTENSION_VIEW_GUEST_H_ |
+#define EXTENSIONS_BROWSER_GUEST_VIEW_EXTENSION_VIEW_EXTENSION_VIEW_GUEST_H_ |
+ |
+#include "base/macros.h" |
+#include "extensions/browser/extension_function_dispatcher.h" |
+#include "extensions/browser/guest_view/guest_view.h" |
+#include "url/gurl.h" |
+ |
+namespace content { |
+class BrowserContext; |
+} |
+ |
+namespace extensions { |
+ |
+class ExtensionViewGuest |
+ : public extensions::GuestView<ExtensionViewGuest>, |
+ public extensions::ExtensionFunctionDispatcher::Delegate { |
+ public: |
+ static const char Type[]; |
+ static extensions::GuestViewBase* Create( |
+ content::WebContents* owner_web_contents, |
+ int guest_instance_id); |
+ |
+ // Request navigating the guest to the provided |src| URL. |
+ void NavigateGuest(const std::string& src, bool force_navigation); |
+ |
+ // GuestViewBase implementation. |
+ void CreateWebContents(const base::DictionaryValue& create_params, |
+ const WebContentsCreatedCallback& callback) override; |
+ void DidAttachToEmbedder() override; |
+ const char* GetAPINamespace() const override; |
+ int GetTaskPrefix() const override; |
+ |
+ // content::WebContentsObserver implementation. |
+ bool OnMessageReceived(const IPC::Message& message) override; |
+ |
+ private: |
+ ExtensionViewGuest(content::WebContents* owner_web_contents, |
+ int guest_instance_id); |
+ ~ExtensionViewGuest() override; |
+ void OnRequest(const ExtensionHostMsg_Request_Params& params); |
+ |
+ // Applies attributes to the extensionview. |
+ void ApplyAttributes(const base::DictionaryValue& params); |
+ |
+ scoped_ptr<extensions::ExtensionFunctionDispatcher> |
+ extension_function_dispatcher_; |
+ GURL view_page_; |
+ |
+ DISALLOW_COPY_AND_ASSIGN(ExtensionViewGuest); |
+}; |
+ |
+} // namespace extensions |
+ |
+#endif // EXTENSIONS_BROWSER_GUEST_VIEW_EXTENSION_VIEW_EXTENSION_VIEW_GUEST_H_ |