Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(55)

Unified Diff: extensions/browser/guest_view/extension_view/extension_view_guest.h

Issue 873933002: Add <extensionview> (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Move test files out of shim/ directory Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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..bbf3f89471561077933a49592b064303f4b2ff93
--- /dev/null
+++ b/extensions/browser/guest_view/extension_view/extension_view_guest.h
@@ -0,0 +1,57 @@
+// 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);
+
+ // 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);
+ ~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_

Powered by Google App Engine
This is Rietveld 408576698