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

Side by Side Diff: chrome/browser/guest_view/guest_view.h

Issue 257823005: [Sheriff] Revert "Revert "Revert 266297 "1. Handle the case of empty embedder_extension_id...""" (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 7 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
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.
4
5 #ifndef CHROME_BROWSER_GUEST_VIEW_GUEST_VIEW_H_
6 #define CHROME_BROWSER_GUEST_VIEW_GUEST_VIEW_H_
7
8 #include "chrome/browser/guest_view/guest_view_base.h"
9
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>();
19 }
20
21 static T* FromWebContents(content::WebContents* contents) {
22 GuestViewBase* guest = GuestViewBase::FromWebContents(contents);
23 return guest ? guest->As<T>() : NULL;
24 }
25
26 // GuestViewBase implementation.
27 virtual const std::string& GetViewType() const OVERRIDE { return type_; }
28
29 protected:
30 GuestView(content::WebContents* guest_web_contents,
31 const std::string& embedder_extension_id)
32 : GuestViewBase(guest_web_contents, embedder_extension_id),
33 type_(T::Type) {}
34
35 private:
36 std::string type_;
37
38 DISALLOW_COPY_AND_ASSIGN(GuestView);
39 };
40
41 #endif // CHROME_BROWSER_GUEST_VIEW_GUEST_VIEW_H_
OLDNEW
« no previous file with comments | « chrome/browser/guest_view/ad_view/ad_view_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