OLD | NEW |
(Empty) | |
| 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. |
| 4 |
| 5 #ifndef CONTENT_BROWSER_BROWSER_PLUGIN_TEST_GUEST_MANAGER_DELEGATE_H_ |
| 6 #define CONTENT_BROWSER_BROWSER_PLUGIN_TEST_GUEST_MANAGER_DELEGATE_H_ |
| 7 |
| 8 #include <map> |
| 9 |
| 10 #include "base/memory/singleton.h" |
| 11 #include "content/public/browser/browser_plugin_guest_manager_delegate.h" |
| 12 |
| 13 namespace content { |
| 14 |
| 15 // This class is temporary until BrowserPluginHostTest.* tests are entirely |
| 16 // moved out of content. |
| 17 class TestGuestManagerDelegate : public BrowserPluginGuestManagerDelegate { |
| 18 public: |
| 19 virtual ~TestGuestManagerDelegate(); |
| 20 |
| 21 static TestGuestManagerDelegate* GetInstance(); |
| 22 |
| 23 // BrowserPluginGuestManagerDelegate implementation. |
| 24 virtual int GetNextInstanceID() OVERRIDE; |
| 25 virtual void AddGuest(int guest_instance_id, |
| 26 WebContents* guest_web_contents) OVERRIDE; |
| 27 virtual void RemoveGuest(int guest_instance_id) OVERRIDE; |
| 28 virtual WebContents* GetGuestByInstanceID( |
| 29 int guest_instance_id, |
| 30 int embedder_render_process_id) OVERRIDE; |
| 31 virtual bool CanEmbedderAccessInstanceIDMaybeKill( |
| 32 int embedder_render_process_id, |
| 33 int guest_instance_id) OVERRIDE; |
| 34 virtual bool CanEmbedderAccessInstanceID(int embedder_render_process_id, |
| 35 int guest_instance_id) OVERRIDE; |
| 36 virtual SiteInstance* GetGuestSiteInstance( |
| 37 const GURL& guest_site) OVERRIDE; |
| 38 virtual bool ForEachGuest(WebContents* embedder_web_contents, |
| 39 const GuestCallback& callback) OVERRIDE; |
| 40 |
| 41 private: |
| 42 friend struct DefaultSingletonTraits<TestGuestManagerDelegate>; |
| 43 TestGuestManagerDelegate(); |
| 44 // Contains guests' WebContents, mapping from their instance ids. |
| 45 typedef std::map<int, WebContents*> GuestInstanceMap; |
| 46 GuestInstanceMap guest_web_contents_by_instance_id_; |
| 47 |
| 48 int next_instance_id_; |
| 49 |
| 50 DISALLOW_COPY_AND_ASSIGN(TestGuestManagerDelegate); |
| 51 }; |
| 52 |
| 53 } // namespace content |
| 54 |
| 55 #endif // CONTENT_BROWSER_BROWSER_PLUGIN_TEST_GUEST_MANAGER_DELEGATE_H_ |
OLD | NEW |