OLD | NEW |
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_WORKER_FRAME_WORKER_FRAME_GUEST_H_ | 5 #ifndef EXTENSIONS_BROWSER_GUEST_VIEW_SURFACE_WORKER_SURFACE_WORKER_GUEST_H_ |
6 #define EXTENSIONS_BROWSER_GUEST_VIEW_WORKER_FRAME_WORKER_FRAME_GUEST_H_ | 6 #define EXTENSIONS_BROWSER_GUEST_VIEW_SURFACE_WORKER_SURFACE_WORKER_GUEST_H_ |
7 | 7 |
8 #include "extensions/browser/guest_view/guest_view.h" | 8 #include "extensions/browser/guest_view/guest_view.h" |
9 | 9 |
10 namespace extensions { | 10 namespace extensions { |
11 class Extension; | 11 class Extension; |
12 class ExtensionHost; | 12 class ExtensionHost; |
13 | 13 |
14 // An WorkerFrameGuest provides the browser-side implementation of the | 14 // An SurfaceWorkerGuest provides the browser-side implementation of the |
15 // prototype <wtframe> API. | 15 // prototype <wtframe> API. |
16 class WorkerFrameGuest : public GuestView<WorkerFrameGuest> { | 16 class SurfaceWorkerGuest : public GuestView<SurfaceWorkerGuest> { |
17 public: | 17 public: |
18 static const char Type[]; | 18 static const char Type[]; |
19 | 19 |
20 static GuestViewBase* Create(content::BrowserContext* browser_context, | 20 static GuestViewBase* Create(content::BrowserContext* browser_context, |
21 content::WebContents* owner_web_contents, | 21 content::WebContents* owner_web_contents, |
22 int guest_instance_id); | 22 int guest_instance_id); |
23 | 23 |
24 // content::WebContentsDelegate implementation. | 24 // content::WebContentsDelegate implementation. |
25 bool HandleContextMenu(const content::ContextMenuParams& params) override; | 25 bool HandleContextMenu(const content::ContextMenuParams& params) override; |
26 | 26 |
27 // GuestViewBase implementation. | 27 // GuestViewBase implementation. |
28 const char* GetAPINamespace() const override; | 28 const char* GetAPINamespace() const override; |
29 int GetTaskPrefix() const override; | 29 int GetTaskPrefix() const override; |
30 void CreateWebContents(const base::DictionaryValue& create_params, | 30 void CreateWebContents(const base::DictionaryValue& create_params, |
31 const WebContentsCreatedCallback& callback) override; | 31 const WebContentsCreatedCallback& callback) override; |
32 void DidAttachToEmbedder() override; | 32 void DidAttachToEmbedder() override; |
33 | 33 |
34 private: | 34 private: |
35 WorkerFrameGuest(content::BrowserContext* browser_context, | 35 SurfaceWorkerGuest(content::BrowserContext* browser_context, |
36 content::WebContents* owner_web_contents, | 36 content::WebContents* owner_web_contents, |
37 int guest_instance_id); | 37 int guest_instance_id); |
38 | 38 |
39 ~WorkerFrameGuest() override; | 39 ~SurfaceWorkerGuest() override; |
40 | 40 |
41 GURL url_; | 41 GURL url_; |
42 | 42 |
43 // This is used to ensure pending tasks will not fire after this object is | 43 // This is used to ensure pending tasks will not fire after this object is |
44 // destroyed. | 44 // destroyed. |
45 base::WeakPtrFactory<WorkerFrameGuest> weak_ptr_factory_; | 45 base::WeakPtrFactory<SurfaceWorkerGuest> weak_ptr_factory_; |
46 | 46 |
47 DISALLOW_COPY_AND_ASSIGN(WorkerFrameGuest); | 47 DISALLOW_COPY_AND_ASSIGN(SurfaceWorkerGuest); |
48 }; | 48 }; |
49 | 49 |
50 } // namespace extensions | 50 } // namespace extensions |
51 | 51 |
52 #endif // EXTENSIONS_BROWSER_GUEST_VIEW_WORKER_FRAME_WORKER_FRAME_GUEST_H_ | 52 #endif // EXTENSIONS_BROWSER_GUEST_VIEW_SURFACE_WORKER_SURFACE_WORKER_GUEST_H_ |
OLD | NEW |