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

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

Issue 306473012: Plumb file system permission into WebviewGuest. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Small changes are made. Created 6 years, 6 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CHROME_BROWSER_GUEST_VIEW_GUEST_VIEW_H_ 5 #ifndef CHROME_BROWSER_GUEST_VIEW_GUEST_VIEW_H_
6 #define CHROME_BROWSER_GUEST_VIEW_GUEST_VIEW_H_ 6 #define CHROME_BROWSER_GUEST_VIEW_GUEST_VIEW_H_
7 7
8 #include "chrome/browser/guest_view/guest_view_base.h" 8 #include "chrome/browser/guest_view/guest_view_base.h"
9 #include "content/public/browser/render_frame_host.h"
9 10
10 // A GuestView is the templated base class for out-of-process frames in the 11 // A GuestView is the templated base class for out-of-process frames in the
11 // chrome layer. GuestView is templated on its derived type to allow for type- 12 // chrome layer. GuestView is templated on its derived type to allow for type-
12 // safe access. See GuestViewBase for more information. 13 // safe access. See GuestViewBase for more information.
13 template <typename T> 14 template <typename T>
14 class GuestView : public GuestViewBase { 15 class GuestView : public GuestViewBase {
15 public: 16 public:
16 static T* From(int embedder_process_id, int guest_instance_id) { 17 static T* From(int embedder_process_id, int guest_instance_id) {
17 GuestViewBase* guest = 18 GuestViewBase* guest =
18 GuestViewBase::From(embedder_process_id, guest_instance_id); 19 GuestViewBase::From(embedder_process_id, guest_instance_id);
19 if (!guest) 20 if (!guest)
20 return NULL; 21 return NULL;
21 return guest->As<T>(); 22 return guest->As<T>();
22 } 23 }
23 24
24 static T* FromWebContents(content::WebContents* contents) { 25 static T* FromWebContents(content::WebContents* contents) {
25 GuestViewBase* guest = GuestViewBase::FromWebContents(contents); 26 GuestViewBase* guest = GuestViewBase::FromWebContents(contents);
26 return guest ? guest->As<T>() : NULL; 27 return guest ? guest->As<T>() : NULL;
27 } 28 }
28 29
30 static T* FromFrameID(int render_process_id, int render_frame_id) {
31 content::RenderFrameHost* render_frame_host =
32 content::RenderFrameHost::FromID(render_process_id, render_frame_id);
33 if (!render_frame_host) {
34 return NULL;
35 }
36 content::WebContents* web_contents =
37 content::WebContents::FromRenderFrameHost(render_frame_host);
38 return FromWebContents(web_contents);
39 }
40
29 T* GetOpener() const { 41 T* GetOpener() const {
30 GuestViewBase* guest = GuestViewBase::GetOpener(); 42 GuestViewBase* guest = GuestViewBase::GetOpener();
31 if (!guest) 43 if (!guest)
32 return NULL; 44 return NULL;
33 return guest->As<T>(); 45 return guest->As<T>();
34 } 46 }
35 47
36 void SetOpener(T* opener) { 48 void SetOpener(T* opener) {
37 GuestViewBase::SetOpener(opener); 49 GuestViewBase::SetOpener(opener);
38 } 50 }
(...skipping 10 matching lines...) Expand all
49 : GuestViewBase(guest_instance_id, 61 : GuestViewBase(guest_instance_id,
50 guest_web_contents, 62 guest_web_contents,
51 embedder_extension_id) {} 63 embedder_extension_id) {}
52 virtual ~GuestView() {} 64 virtual ~GuestView() {}
53 65
54 private: 66 private:
55 DISALLOW_COPY_AND_ASSIGN(GuestView); 67 DISALLOW_COPY_AND_ASSIGN(GuestView);
56 }; 68 };
57 69
58 #endif // CHROME_BROWSER_GUEST_VIEW_GUEST_VIEW_H_ 70 #endif // CHROME_BROWSER_GUEST_VIEW_GUEST_VIEW_H_
OLDNEW
« no previous file with comments | « chrome/browser/apps/web_view_browsertest.cc ('k') | chrome/browser/guest_view/web_view/web_view_constants.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698