OLD | NEW |
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 COMPONENTS_GUEST_VIEW_BROWSER_GUEST_VIEW_MANAGER_H_ | 5 #ifndef COMPONENTS_GUEST_VIEW_BROWSER_GUEST_VIEW_MANAGER_H_ |
6 #define COMPONENTS_GUEST_VIEW_BROWSER_GUEST_VIEW_MANAGER_H_ | 6 #define COMPONENTS_GUEST_VIEW_BROWSER_GUEST_VIEW_MANAGER_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <set> | 9 #include <set> |
10 #include <vector> | 10 #include <vector> |
11 | 11 |
12 #include "base/bind.h" | 12 #include "base/bind.h" |
13 #include "base/gtest_prod_util.h" | |
14 #include "base/lazy_instance.h" | 13 #include "base/lazy_instance.h" |
15 #include "base/macros.h" | 14 #include "base/macros.h" |
16 #include "base/memory/weak_ptr.h" | 15 #include "base/memory/weak_ptr.h" |
17 #include "content/public/browser/browser_plugin_guest_manager.h" | 16 #include "content/public/browser/browser_plugin_guest_manager.h" |
18 #include "content/public/browser/site_instance.h" | 17 #include "content/public/browser/site_instance.h" |
19 #include "content/public/browser/web_contents.h" | 18 #include "content/public/browser/web_contents.h" |
20 | 19 |
21 class GURL; | 20 class GURL; |
22 | 21 |
23 namespace content { | 22 namespace content { |
(...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
253 | 252 |
254 content::BrowserContext* context_; | 253 content::BrowserContext* context_; |
255 | 254 |
256 scoped_ptr<GuestViewManagerDelegate> delegate_; | 255 scoped_ptr<GuestViewManagerDelegate> delegate_; |
257 | 256 |
258 // This tracks which GuestView embedders are currently being observed. | 257 // This tracks which GuestView embedders are currently being observed. |
259 std::set<int> embedders_observed_; | 258 std::set<int> embedders_observed_; |
260 | 259 |
261 // |view_destruction_callback_map_| maps from embedder process ID to view ID | 260 // |view_destruction_callback_map_| maps from embedder process ID to view ID |
262 // to a vector of callback functions to be called when that view is destroyed. | 261 // to a vector of callback functions to be called when that view is destroyed. |
263 using Callbacks = std::vector<base::Closure> ; | 262 using Callbacks = std::vector<base::Closure>; |
264 using CallbacksForEachViewID = std::map<int, Callbacks> ; | 263 using CallbacksForEachViewID = std::map<int, Callbacks>; |
265 using CallbacksForEachEmbedderID = std::map<int, CallbacksForEachViewID> ; | 264 using CallbacksForEachEmbedderID = std::map<int, CallbacksForEachViewID>; |
266 CallbacksForEachEmbedderID view_destruction_callback_map_; | 265 CallbacksForEachEmbedderID view_destruction_callback_map_; |
267 | 266 |
268 // This is used to ensure that an EmbedderRenderProcessHostObserver will not | 267 // This is used to ensure that an EmbedderRenderProcessHostObserver will not |
269 // call into this GuestViewManager after it has been destroyed. | 268 // call into this GuestViewManager after it has been destroyed. |
270 base::WeakPtrFactory<GuestViewManager> weak_ptr_factory_; | 269 base::WeakPtrFactory<GuestViewManager> weak_ptr_factory_; |
271 | 270 |
| 271 private: |
272 DISALLOW_COPY_AND_ASSIGN(GuestViewManager); | 272 DISALLOW_COPY_AND_ASSIGN(GuestViewManager); |
273 }; | 273 }; |
274 | 274 |
275 } // namespace guest_view | 275 } // namespace guest_view |
276 | 276 |
277 #endif // COMPONETS_GUEST_VIEW_BROWSER_GUEST_VIEW_MANAGER_H_ | 277 #endif // COMPONENTS_GUEST_VIEW_BROWSER_GUEST_VIEW_MANAGER_H_ |
OLD | NEW |