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

Side by Side Diff: chrome/browser/guest_view/guest_view_manager.h

Issue 426593007: Refactor guest view availability to be API not permission based. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 4 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 | Annotate | Revision Log
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 CHROME_BROWSER_GUEST_VIEW_GUEST_VIEW_MANAGER_H_ 5 #ifndef CHROME_BROWSER_GUEST_VIEW_GUEST_VIEW_MANAGER_H_
6 #define CHROME_BROWSER_GUEST_VIEW_GUEST_VIEW_MANAGER_H_ 6 #define CHROME_BROWSER_GUEST_VIEW_GUEST_VIEW_MANAGER_H_
7 7
8 #include <map> 8 #include <map>
9 9
10 #include "base/gtest_prod_util.h" 10 #include "base/gtest_prod_util.h"
11 #include "base/lazy_instance.h" 11 #include "base/lazy_instance.h"
12 #include "base/macros.h" 12 #include "base/macros.h"
13 #include "content/public/browser/browser_plugin_guest_manager.h" 13 #include "content/public/browser/browser_plugin_guest_manager.h"
14 #include "content/public/browser/site_instance.h" 14 #include "content/public/browser/site_instance.h"
15 #include "content/public/browser/web_contents.h" 15 #include "content/public/browser/web_contents.h"
16 16
17 class AppViewGuest; 17 class AppViewGuest;
18 class GuestViewBase; 18 class GuestViewBase;
19 class GuestViewManagerFactory; 19 class GuestViewManagerFactory;
20 class GURL; 20 class GURL;
21 21
22 namespace content { 22 namespace content {
23 class BrowserContext; 23 class BrowserContext;
24 class WebContents;
24 } // namespace content 25 } // namespace content
25 26
26 namespace guestview { 27 namespace guestview {
27 class TestGuestViewManager; 28 class TestGuestViewManager;
28 } // namespace guestview 29 } // namespace guestview
29 30
30 class GuestViewManager : public content::BrowserPluginGuestManager, 31 class GuestViewManager : public content::BrowserPluginGuestManager,
31 public base::SupportsUserData::Data { 32 public base::SupportsUserData::Data {
32 public: 33 public:
33 explicit GuestViewManager(content::BrowserContext* context); 34 explicit GuestViewManager(content::BrowserContext* context);
(...skipping 12 matching lines...) Expand all
46 // this method will return NULL. If no WebContents exists with the given 47 // this method will return NULL. If no WebContents exists with the given
47 // instance ID, then NULL will also be returned. 48 // instance ID, then NULL will also be returned.
48 content::WebContents* GetGuestByInstanceIDSafely( 49 content::WebContents* GetGuestByInstanceIDSafely(
49 int guest_instance_id, 50 int guest_instance_id,
50 int embedder_render_process_id); 51 int embedder_render_process_id);
51 52
52 int GetNextInstanceID(); 53 int GetNextInstanceID();
53 54
54 typedef base::Callback<void(content::WebContents*)> 55 typedef base::Callback<void(content::WebContents*)>
55 WebContentsCreatedCallback; 56 WebContentsCreatedCallback;
56 void CreateGuest( 57 void CreateGuest(const std::string& view_type,
57 const std::string& view_type, 58 const std::string& embedder_extension_id,
58 const std::string& embedder_extension_id, 59 int embedder_render_process_id,
59 int embedder_render_process_id, 60 content::WebContents* embedder_web_contents,
not at google - send to devlin 2014/07/31 22:07:45 Pity I needed to do this, all I want is a URL.
60 const base::DictionaryValue& create_params, 61 const base::DictionaryValue& create_params,
61 const WebContentsCreatedCallback& callback); 62 const WebContentsCreatedCallback& callback);
62 63
63 content::WebContents* CreateGuestWithWebContentsParams( 64 content::WebContents* CreateGuestWithWebContentsParams(
64 const std::string& view_type, 65 const std::string& view_type,
65 const std::string& embedder_extension_id, 66 const std::string& embedder_extension_id,
66 int embedder_render_process_id, 67 int embedder_render_process_id,
67 const content::WebContents::CreateParams& create_params); 68 const content::WebContents::CreateParams& create_params);
68 69
69 content::SiteInstance* GetGuestSiteInstance( 70 content::SiteInstance* GetGuestSiteInstance(
70 const GURL& guest_site); 71 const GURL& guest_site);
71 72
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
121 // The remaining instance IDs that are greater than 122 // The remaining instance IDs that are greater than
122 // |last_instance_id_removed_| are kept here. 123 // |last_instance_id_removed_| are kept here.
123 std::set<int> removed_instance_ids_; 124 std::set<int> removed_instance_ids_;
124 125
125 content::BrowserContext* context_; 126 content::BrowserContext* context_;
126 127
127 DISALLOW_COPY_AND_ASSIGN(GuestViewManager); 128 DISALLOW_COPY_AND_ASSIGN(GuestViewManager);
128 }; 129 };
129 130
130 #endif // CHROME_BROWSER_GUEST_VIEW_GUEST_VIEW_MANAGER_H_ 131 #endif // CHROME_BROWSER_GUEST_VIEW_GUEST_VIEW_MANAGER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698