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

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

Issue 1392343002: Reduce the public method footprint of GuestViewBase and derived types. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 2 months 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/memory/weak_ptr.h" 8 #include "base/memory/weak_ptr.h"
9 #include "components/guest_view/browser/guest_view.h" 9 #include "components/guest_view/browser/guest_view.h"
10 10
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
50 }; 50 };
51 51
52 class MimeHandlerViewGuest : 52 class MimeHandlerViewGuest :
53 public guest_view::GuestView<MimeHandlerViewGuest> { 53 public guest_view::GuestView<MimeHandlerViewGuest> {
54 public: 54 public:
55 static guest_view::GuestViewBase* Create( 55 static guest_view::GuestViewBase* Create(
56 content::WebContents* owner_web_contents); 56 content::WebContents* owner_web_contents);
57 57
58 static const char Type[]; 58 static const char Type[];
59 59
60 // GuestViewBase implementation.
61 const char* GetAPINamespace() const override;
62 int GetTaskPrefix() const override;
63 void CreateWebContents(const base::DictionaryValue& create_params,
64 const WebContentsCreatedCallback& callback) override;
65 void DidAttachToEmbedder() override;
66 void DidInitialize(const base::DictionaryValue& create_params) override;
67 bool ShouldHandleFindRequestsForEmbedder() const override;
68 bool ZoomPropagatesFromEmbedderToGuest() const override;
69
70 // WebContentsDelegate implementation.
71 content::WebContents* OpenURLFromTab(
72 content::WebContents* source,
73 const content::OpenURLParams& params) override;
74 bool HandleContextMenu(const content::ContextMenuParams& params) override;
75 bool PreHandleGestureEvent(content::WebContents* source,
76 const blink::WebGestureEvent& event) override;
77 content::JavaScriptDialogManager* GetJavaScriptDialogManager(
78 content::WebContents* source) override;
79 bool SaveFrame(const GURL& url, const content::Referrer& referrer) override;
80
81 // content::WebContentsObserver implementation.
82 void DocumentOnLoadCompletedInMainFrame() override;
83
84 std::string view_id() const { return view_id_; }
85 base::WeakPtr<StreamContainer> GetStream() const;
86
87 protected: 60 protected:
88 explicit MimeHandlerViewGuest(content::WebContents* owner_web_contents); 61 explicit MimeHandlerViewGuest(content::WebContents* owner_web_contents);
89 ~MimeHandlerViewGuest() override; 62 ~MimeHandlerViewGuest() override;
90 63
64 // GuestViewBase implementation.
65 void CreateWebContents(const base::DictionaryValue& create_params,
Fady Samuel 2015/10/09 22:35:19 Why are these protected and not private?
paulmeyer 2015/10/16 21:13:03 Because they are overridden by TestMimeHandlerView
Fady Samuel 2015/10/16 21:17:28 Make TestMimeHandlerViewGuest a friend class inste
paulmeyer 2015/10/21 19:45:12 Done.
66 const WebContentsCreatedCallback& callback) override;
67 void DidAttachToEmbedder() override;
68
91 private: 69 private:
70 // GuestViewBase implementation.
71 const char* GetAPINamespace() const final;
72 int GetTaskPrefix() const final;
73 void DidInitialize(const base::DictionaryValue& create_params) final;
74 bool ShouldHandleFindRequestsForEmbedder() const final;
75 bool ZoomPropagatesFromEmbedderToGuest() const final;
76
77 // WebContentsDelegate implementation.
78 content::WebContents* OpenURLFromTab(
79 content::WebContents* source,
80 const content::OpenURLParams& params) final;
81 bool HandleContextMenu(const content::ContextMenuParams& params) final;
82 bool PreHandleGestureEvent(content::WebContents* source,
83 const blink::WebGestureEvent& event) final;
84 content::JavaScriptDialogManager* GetJavaScriptDialogManager(
85 content::WebContents* source) final;
86 bool SaveFrame(const GURL& url, const content::Referrer& referrer) final;
87
88 // content::WebContentsObserver implementation.
89 void DocumentOnLoadCompletedInMainFrame() final;
90
91 std::string view_id() const { return view_id_; }
92 base::WeakPtr<StreamContainer> GetStream() const;
93
92 scoped_ptr<MimeHandlerViewGuestDelegate> delegate_; 94 scoped_ptr<MimeHandlerViewGuestDelegate> delegate_;
93 scoped_ptr<StreamContainer> stream_; 95 scoped_ptr<StreamContainer> stream_;
94 std::string view_id_; 96 std::string view_id_;
95 97
96 DISALLOW_COPY_AND_ASSIGN(MimeHandlerViewGuest); 98 DISALLOW_COPY_AND_ASSIGN(MimeHandlerViewGuest);
97 }; 99 };
98 100
99 } // namespace extensions 101 } // namespace extensions
100 102
101 #endif // EXTENSIONS_BROWSER_GUEST_VIEW_MIME_HANDLER_VIEW_MIME_HANDLER_VIEW_GUE ST_H_ 103 #endif // EXTENSIONS_BROWSER_GUEST_VIEW_MIME_HANDLER_VIEW_MIME_HANDLER_VIEW_GUE ST_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698