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