Allow only one bookmark to be added for multiple fast starring
[chromium-blink-merge.git] / extensions / browser / guest_view / surface_worker / surface_worker_guest.h
blobe1db441ccc8583a7e1e14513a6cfcf705fcf5c6e
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.
5 #ifndef EXTENSIONS_BROWSER_GUEST_VIEW_SURFACE_WORKER_SURFACE_WORKER_GUEST_H_
6 #define EXTENSIONS_BROWSER_GUEST_VIEW_SURFACE_WORKER_SURFACE_WORKER_GUEST_H_
8 #include "components/guest_view/browser/guest_view.h"
10 namespace extensions {
11 class Extension;
12 class ExtensionHost;
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[];
20 static guest_view::GuestViewBase* Create(
21 content::WebContents* owner_web_contents);
23 // content::WebContentsDelegate implementation.
24 bool HandleContextMenu(const content::ContextMenuParams& params) override;
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;
33 private:
34 explicit SurfaceWorkerGuest(content::WebContents* owner_web_contents);
36 ~SurfaceWorkerGuest() override;
38 GURL url_;
40 // This is used to ensure pending tasks will not fire after this object is
41 // destroyed.
42 base::WeakPtrFactory<SurfaceWorkerGuest> weak_ptr_factory_;
44 DISALLOW_COPY_AND_ASSIGN(SurfaceWorkerGuest);
47 } // namespace extensions
49 #endif // EXTENSIONS_BROWSER_GUEST_VIEW_SURFACE_WORKER_SURFACE_WORKER_GUEST_H_