Cast: Stop logging kVideoFrameSentToEncoder and rename a couple events.
[chromium-blink-merge.git] / chrome / browser / guest_view / guest_view.h
blob3633b0358ecc8328d55ba9ace73d9429c18a570f
1 // Copyright 2014 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.
5 #ifndef CHROME_BROWSER_GUEST_VIEW_GUEST_VIEW_H_
6 #define CHROME_BROWSER_GUEST_VIEW_GUEST_VIEW_H_
8 #include "chrome/browser/guest_view/guest_view_base.h"
10 template <typename T>
11 class GuestView : public GuestViewBase {
12 public:
13 static T* From(int embedder_process_id, int guest_instance_id) {
14 GuestViewBase* guest =
15 GuestViewBase::From(embedder_process_id, guest_instance_id);
16 if (!guest)
17 return NULL;
18 return guest->As<T>();
21 static T* FromWebContents(content::WebContents* contents) {
22 GuestViewBase* guest = GuestViewBase::FromWebContents(contents);
23 return guest ? guest->As<T>() : NULL;
26 // GuestViewBase implementation.
27 virtual const char* GetViewType() const OVERRIDE {
28 return T::Type;
31 protected:
32 GuestView(content::WebContents* guest_web_contents,
33 const std::string& embedder_extension_id,
34 const base::WeakPtr<GuestViewBase>& opener)
35 : GuestViewBase(guest_web_contents, embedder_extension_id, opener) {}
37 private:
38 DISALLOW_COPY_AND_ASSIGN(GuestView);
41 #endif // CHROME_BROWSER_GUEST_VIEW_GUEST_VIEW_H_