Move PageZoom::Zoom() call to GuestViewBase from mime handler delegate.
[chromium-blink-merge.git] / extensions / browser / guest_view / mime_handler_view / mime_handler_view_guest.h
blobc5e8d71f007736c3e84a083fe541aa6bda398879
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_MIME_HANDLER_VIEW_MIME_HANDLER_VIEW_GUEST_H_
6 #define EXTENSIONS_BROWSER_GUEST_VIEW_MIME_HANDLER_VIEW_MIME_HANDLER_VIEW_GUEST_H_
8 #include "extensions/browser/extension_function_dispatcher.h"
9 #include "extensions/browser/guest_view/guest_view.h"
11 namespace content {
12 class WebContents;
13 struct ContextMenuParams;
14 } // namespace content
16 namespace extensions {
18 class MimeHandlerViewGuestDelegate;
20 class MimeHandlerViewGuest : public GuestView<MimeHandlerViewGuest>,
21 public ExtensionFunctionDispatcher::Delegate {
22 public:
23 static GuestViewBase* Create(content::BrowserContext* browser_context,
24 content::WebContents* owner_web_contents,
25 int guest_instance_id);
27 static const char Type[];
29 // ExtensionFunctionDispatcher::Delegate implementation.
30 WindowController* GetExtensionWindowController() const override;
31 content::WebContents* GetAssociatedWebContents() const override;
33 // GuestViewBase implementation.
34 const char* GetAPINamespace() const override;
35 int GetTaskPrefix() const override;
36 void CreateWebContents(const base::DictionaryValue& create_params,
37 const WebContentsCreatedCallback& callback) override;
38 void DidAttachToEmbedder() override;
39 void DidInitialize(const base::DictionaryValue& create_params) override;
40 bool ZoomPropagatesFromEmbedderToGuest() const override;
42 // content::BrowserPluginGuestDelegate implementation
43 bool Find(int request_id,
44 const base::string16& search_text,
45 const blink::WebFindOptions& options) override;
47 // WebContentsDelegate implementation.
48 content::WebContents* OpenURLFromTab(
49 content::WebContents* source,
50 const content::OpenURLParams& params) override;
51 bool HandleContextMenu(const content::ContextMenuParams& params) override;
52 void HandleKeyboardEvent(
53 content::WebContents* source,
54 const content::NativeWebKeyboardEvent& event) override;
55 void FindReply(content::WebContents* web_contents,
56 int request_id,
57 int number_of_matches,
58 const gfx::Rect& selection_rect,
59 int active_match_ordinal,
60 bool final_update) override;
61 bool SaveFrame(const GURL& url, const content::Referrer& referrer) override;
63 // content::WebContentsObserver implementation.
64 void DocumentOnLoadCompletedInMainFrame() override;
65 bool OnMessageReceived(const IPC::Message& message) override;
67 private:
68 MimeHandlerViewGuest(content::BrowserContext* browser_context,
69 content::WebContents* owner_web_contents,
70 int guest_instance_id);
71 ~MimeHandlerViewGuest() override;
73 void OnRequest(const ExtensionHostMsg_Request_Params& params);
75 scoped_ptr<MimeHandlerViewGuestDelegate> delegate_;
76 scoped_ptr<ExtensionFunctionDispatcher> extension_function_dispatcher_;
77 GURL content_url_;
79 DISALLOW_COPY_AND_ASSIGN(MimeHandlerViewGuest);
82 } // namespace extensions
84 #endif // EXTENSIONS_BROWSER_GUEST_VIEW_MIME_HANDLER_VIEW_MIME_HANDLER_VIEW_GUEST_H_