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

Side by Side Diff: extensions/browser/guest_view/app_view/app_view_guest.h

Issue 1181893003: Kill bad apps. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 6 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_APP_VIEW_APP_VIEW_GUEST_H_ 5 #ifndef EXTENSIONS_BROWSER_GUEST_VIEW_APP_VIEW_APP_VIEW_GUEST_H_
6 #define EXTENSIONS_BROWSER_GUEST_VIEW_APP_VIEW_APP_VIEW_GUEST_H_ 6 #define EXTENSIONS_BROWSER_GUEST_VIEW_APP_VIEW_APP_VIEW_GUEST_H_
7 7
8 #include "base/id_map.h" 8 #include "base/id_map.h"
9 #include "components/guest_view/browser/guest_view.h" 9 #include "components/guest_view/browser/guest_view.h"
10 #include "extensions/browser/extension_function_dispatcher.h" 10 #include "extensions/browser/extension_function_dispatcher.h"
11 #include "extensions/browser/guest_view/app_view/app_view_guest_delegate.h" 11 #include "extensions/browser/guest_view/app_view/app_view_guest_delegate.h"
12 12
13 namespace extensions { 13 namespace extensions {
14 class Extension; 14 class Extension;
15 class ExtensionHost; 15 class ExtensionHost;
16 16
17 // An AppViewGuest provides the browser-side implementation of <appview> API. 17 // An AppViewGuest provides the browser-side implementation of <appview> API.
18 // AppViewGuest is created on attachment. That is, when a guest WebContents is 18 // AppViewGuest is created on attachment. That is, when a guest WebContents is
19 // associated with a particular embedder WebContents. This happens on calls to 19 // associated with a particular embedder WebContents. This happens on calls to
20 // the connect API. 20 // the connect API.
21 class AppViewGuest : public guest_view::GuestView<AppViewGuest>, 21 class AppViewGuest : public guest_view::GuestView<AppViewGuest>,
22 public ExtensionFunctionDispatcher::Delegate { 22 public ExtensionFunctionDispatcher::Delegate {
23 public: 23 public:
24 static const char Type[]; 24 static const char Type[];
25 25
26 // Completes the creation of a WebContents associated with the provided 26 // Completes the creation of a WebContents associated with the provided
27 // |guest_extensions_id|. 27 // |guest_extensions_id|.
28 static bool CompletePendingRequest( 28 static bool CompletePendingRequest(content::BrowserContext* browser_context,
29 content::BrowserContext* browser_context, 29 const GURL& url,
30 const GURL& url, 30 int guest_instance_id,
31 int guest_instance_id, 31 const std::string& guest_extension_id,
32 const std::string& guest_extension_id); 32 int guest_render_process_host_id);
lfg 2015/06/12 21:43:47 Update the comment above to reflect the new parame
EhsanK 2015/06/25 16:19:51 Done.
lfg 2015/06/26 21:46:05 Forgot to update this?
EhsanK 2015/06/30 16:53:10 Yes. :(. Done.
33 33
34 static GuestViewBase* Create(content::WebContents* owner_web_contents); 34 static GuestViewBase* Create(content::WebContents* owner_web_contents);
35 35
36 static void AddFakeRequestInfoForTesting(
37 const Extension* guest_extension,
38 AppViewGuest* app_view_guest,
39 GuestViewBase::WebContentsCreatedCallback& callback,
40 int guest_instance_id);
lfg 2015/06/12 21:43:47 Why did you make this a static and pass the app_vi
EhsanK 2015/06/25 16:19:51 None except that this function is nothing but an "
lfg 2015/06/26 21:46:05 I just thought it was strange to be a static and p
EhsanK 2015/06/30 16:53:10 I ended up going towards another direction. I have
41
36 // ExtensionFunctionDispatcher::Delegate implementation. 42 // ExtensionFunctionDispatcher::Delegate implementation.
37 WindowController* GetExtensionWindowController() const override; 43 WindowController* GetExtensionWindowController() const override;
38 content::WebContents* GetAssociatedWebContents() const override; 44 content::WebContents* GetAssociatedWebContents() const override;
39 45
40 // content::WebContentsObserver implementation. 46 // content::WebContentsObserver implementation.
41 bool OnMessageReceived(const IPC::Message& message) override; 47 bool OnMessageReceived(const IPC::Message& message) override;
42 48
43 // content::WebContentsDelegate implementation. 49 // content::WebContentsDelegate implementation.
44 bool HandleContextMenu(const content::ContextMenuParams& params) override; 50 bool HandleContextMenu(const content::ContextMenuParams& params) override;
45 void RequestMediaAccessPermission( 51 void RequestMediaAccessPermission(
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
85 // This is used to ensure pending tasks will not fire after this object is 91 // This is used to ensure pending tasks will not fire after this object is
86 // destroyed. 92 // destroyed.
87 base::WeakPtrFactory<AppViewGuest> weak_ptr_factory_; 93 base::WeakPtrFactory<AppViewGuest> weak_ptr_factory_;
88 94
89 DISALLOW_COPY_AND_ASSIGN(AppViewGuest); 95 DISALLOW_COPY_AND_ASSIGN(AppViewGuest);
90 }; 96 };
91 97
92 } // namespace extensions 98 } // namespace extensions
93 99
94 #endif // EXTENSIONS_BROWSER_GUEST_VIEW_APP_VIEW_APP_VIEW_GUEST_H_ 100 #endif // EXTENSIONS_BROWSER_GUEST_VIEW_APP_VIEW_APP_VIEW_GUEST_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698