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

Side by Side Diff: extensions/browser/guest_view/mime_handler_view/mime_handler_view_guest.h

Issue 2417693002: Allow MimeHandlerViewGuest be embedded inside OOPIFs (Closed)
Patch Set: Rebased Created 4 years, 1 month 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 EXTENSIONS_BROWSER_GUEST_VIEW_MIME_HANDLER_VIEW_MIME_HANDLER_VIEW_GUEST_ H_ 5 #ifndef EXTENSIONS_BROWSER_GUEST_VIEW_MIME_HANDLER_VIEW_MIME_HANDLER_VIEW_GUEST_ H_
6 #define EXTENSIONS_BROWSER_GUEST_VIEW_MIME_HANDLER_VIEW_MIME_HANDLER_VIEW_GUEST_ H_ 6 #define EXTENSIONS_BROWSER_GUEST_VIEW_MIME_HANDLER_VIEW_MIME_HANDLER_VIEW_GUEST_ H_
7 7
8 #include "base/macros.h" 8 #include "base/macros.h"
9 #include "base/memory/weak_ptr.h" 9 #include "base/memory/weak_ptr.h"
10 #include "components/guest_view/browser/guest_view.h" 10 #include "components/guest_view/browser/guest_view.h"
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
51 }; 51 };
52 52
53 class MimeHandlerViewGuest : 53 class MimeHandlerViewGuest :
54 public guest_view::GuestView<MimeHandlerViewGuest> { 54 public guest_view::GuestView<MimeHandlerViewGuest> {
55 public: 55 public:
56 static guest_view::GuestViewBase* Create( 56 static guest_view::GuestViewBase* Create(
57 content::WebContents* owner_web_contents); 57 content::WebContents* owner_web_contents);
58 58
59 static const char Type[]; 59 static const char Type[];
60 60
61 // BrowserPluginGuestDelegate overrides.
61 bool CanUseCrossProcessFrames() override; 62 bool CanUseCrossProcessFrames() override;
63 bool CanBeEmbeddedInsideCrossProcessFrames() override;
64 content::RenderWidgetHost* GetOwnerRenderWidgetHost() override;
65 content::SiteInstance* GetOwnerSiteInstance() override;
66
67 void SetEmbedderFrame(int process_id, int routing_id);
62 68
63 protected: 69 protected:
64 explicit MimeHandlerViewGuest(content::WebContents* owner_web_contents); 70 explicit MimeHandlerViewGuest(content::WebContents* owner_web_contents);
65 ~MimeHandlerViewGuest() override; 71 ~MimeHandlerViewGuest() override;
66 72
67 private: 73 private:
68 friend class TestMimeHandlerViewGuest; 74 friend class TestMimeHandlerViewGuest;
69 75
70 // GuestViewBase implementation. 76 // GuestViewBase implementation.
71 const char* GetAPINamespace() const final; 77 const char* GetAPINamespace() const final;
(...skipping 10 matching lines...) Expand all
82 content::WebContents* source, 88 content::WebContents* source,
83 const content::OpenURLParams& params) final; 89 const content::OpenURLParams& params) final;
84 void NavigationStateChanged(content::WebContents* source, 90 void NavigationStateChanged(content::WebContents* source,
85 content::InvalidateTypes changed_flags) final; 91 content::InvalidateTypes changed_flags) final;
86 bool HandleContextMenu(const content::ContextMenuParams& params) final; 92 bool HandleContextMenu(const content::ContextMenuParams& params) final;
87 bool PreHandleGestureEvent(content::WebContents* source, 93 bool PreHandleGestureEvent(content::WebContents* source,
88 const blink::WebGestureEvent& event) final; 94 const blink::WebGestureEvent& event) final;
89 content::JavaScriptDialogManager* GetJavaScriptDialogManager( 95 content::JavaScriptDialogManager* GetJavaScriptDialogManager(
90 content::WebContents* source) final; 96 content::WebContents* source) final;
91 bool SaveFrame(const GURL& url, const content::Referrer& referrer) final; 97 bool SaveFrame(const GURL& url, const content::Referrer& referrer) final;
98 void OnRenderFrameHostDeleted(int process_id, int routing_id) final;
92 99
93 // content::WebContentsObserver implementation. 100 // content::WebContentsObserver implementation.
94 void DocumentOnLoadCompletedInMainFrame() final; 101 void DocumentOnLoadCompletedInMainFrame() final;
95 102
96 std::string view_id() const { return view_id_; } 103 std::string view_id() const { return view_id_; }
97 base::WeakPtr<StreamContainer> GetStream() const; 104 base::WeakPtr<StreamContainer> GetStream() const;
98 105
99 std::unique_ptr<MimeHandlerViewGuestDelegate> delegate_; 106 std::unique_ptr<MimeHandlerViewGuestDelegate> delegate_;
100 std::unique_ptr<StreamContainer> stream_; 107 std::unique_ptr<StreamContainer> stream_;
101 std::string view_id_; 108 std::string view_id_;
102 109
110 int embedder_frame_process_id_;
111 int embedder_frame_routing_id_;
112 int embedder_widget_routing_id_;
113
103 DISALLOW_COPY_AND_ASSIGN(MimeHandlerViewGuest); 114 DISALLOW_COPY_AND_ASSIGN(MimeHandlerViewGuest);
104 }; 115 };
105 116
106 } // namespace extensions 117 } // namespace extensions
107 118
108 #endif // EXTENSIONS_BROWSER_GUEST_VIEW_MIME_HANDLER_VIEW_MIME_HANDLER_VIEW_GUE ST_H_ 119 #endif // EXTENSIONS_BROWSER_GUEST_VIEW_MIME_HANDLER_VIEW_MIME_HANDLER_VIEW_GUE ST_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698