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

Unified Diff: chrome/browser/guest_view/guest_view.h

Issue 464533002: Move guest_view to extensions. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Small changes are made in guest_view_manager_unittest.cc Created 6 years, 4 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: chrome/browser/guest_view/guest_view.h
diff --git a/chrome/browser/guest_view/guest_view.h b/chrome/browser/guest_view/guest_view.h
deleted file mode 100644
index b4435001f730d327184b70d692789530133e7d1e..0000000000000000000000000000000000000000
--- a/chrome/browser/guest_view/guest_view.h
+++ /dev/null
@@ -1,72 +0,0 @@
-// Copyright 2014 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 CHROME_BROWSER_GUEST_VIEW_GUEST_VIEW_H_
-#define CHROME_BROWSER_GUEST_VIEW_GUEST_VIEW_H_
-
-#include "base/bind.h"
-#include "chrome/browser/guest_view/guest_view_base.h"
-#include "content/public/browser/render_frame_host.h"
-
-// A GuestView is the templated base class for out-of-process frames in the
-// chrome layer. GuestView is templated on its derived type to allow for type-
-// safe access. See GuestViewBase for more information.
-template <typename T>
-class GuestView : public GuestViewBase {
- public:
- static void Register() {
- GuestViewBase::RegisterGuestViewType(T::Type, base::Bind(&T::Create));
- }
-
- static T* From(int embedder_process_id, int guest_instance_id) {
- GuestViewBase* guest =
- GuestViewBase::From(embedder_process_id, guest_instance_id);
- if (!guest)
- return NULL;
- return guest->As<T>();
- }
-
- static T* FromWebContents(content::WebContents* contents) {
- GuestViewBase* guest = GuestViewBase::FromWebContents(contents);
- return guest ? guest->As<T>() : NULL;
- }
-
- static T* FromFrameID(int render_process_id, int render_frame_id) {
- content::RenderFrameHost* render_frame_host =
- content::RenderFrameHost::FromID(render_process_id, render_frame_id);
- if (!render_frame_host) {
- return NULL;
- }
- content::WebContents* web_contents =
- content::WebContents::FromRenderFrameHost(render_frame_host);
- return FromWebContents(web_contents);
- }
-
- T* GetOpener() const {
- GuestViewBase* guest = GuestViewBase::GetOpener();
- if (!guest)
- return NULL;
- return guest->As<T>();
- }
-
- void SetOpener(T* opener) {
- GuestViewBase::SetOpener(opener);
- }
-
- // GuestViewBase implementation.
- virtual const char* GetViewType() const OVERRIDE {
- return T::Type;
- }
-
- protected:
- GuestView(content::BrowserContext* browser_context,
- int guest_instance_id)
- : GuestViewBase(browser_context, guest_instance_id) {}
- virtual ~GuestView() {}
-
- private:
- DISALLOW_COPY_AND_ASSIGN(GuestView);
-};
-
-#endif // CHROME_BROWSER_GUEST_VIEW_GUEST_VIEW_H_
« no previous file with comments | « chrome/browser/guest_view/extension_options/extension_options_guest.cc ('k') | chrome/browser/guest_view/guest_view_base.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698