Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | |
|
Fady Samuel
2014/09/24 20:50:12
Please add an include guard: https://code.google.c
| |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #include "content/public/test/test_utils.h" | |
| 6 #include "extensions/browser/guest_view/guest_view_manager.h" | |
| 7 #include "extensions/browser/guest_view/guest_view_manager_factory.h" | |
| 8 | |
| 9 namespace extensions { | |
| 10 | |
| 11 class TestGuestViewManager : public GuestViewManager { | |
| 12 public: | |
| 13 explicit TestGuestViewManager(content::BrowserContext* context); | |
| 14 virtual ~TestGuestViewManager(); | |
| 15 | |
| 16 content::WebContents* WaitForGuestCreated(); | |
| 17 void WaitForGuestDeleted(); | |
| 18 | |
| 19 private: | |
| 20 // GuestViewManager override: | |
| 21 virtual void AddGuest(int guest_instance_id, | |
| 22 content::WebContents* guest_web_contents) OVERRIDE; | |
| 23 virtual void RemoveGuest(int guest_instance_id) OVERRIDE; | |
| 24 | |
| 25 bool seen_guest_removed_; | |
| 26 content::WebContents* web_contents_; | |
| 27 scoped_refptr<content::MessageLoopRunner> created_message_loop_runner_; | |
| 28 scoped_refptr<content::MessageLoopRunner> deleted_message_loop_runner_; | |
| 29 | |
| 30 DISALLOW_COPY_AND_ASSIGN(TestGuestViewManager); | |
| 31 }; | |
| 32 | |
| 33 // Test factory for creating test instances of GuestViewManager. | |
| 34 class TestGuestViewManagerFactory : public GuestViewManagerFactory { | |
| 35 public: | |
| 36 TestGuestViewManagerFactory(); | |
| 37 virtual ~TestGuestViewManagerFactory(); | |
| 38 | |
| 39 virtual GuestViewManager* CreateGuestViewManager( | |
| 40 content::BrowserContext* context) OVERRIDE; | |
| 41 | |
| 42 TestGuestViewManager* GetManager(content::BrowserContext* context); | |
| 43 | |
| 44 private: | |
| 45 TestGuestViewManager* test_guest_view_manager_; | |
| 46 | |
| 47 DISALLOW_COPY_AND_ASSIGN(TestGuestViewManagerFactory); | |
| 48 }; | |
| 49 | |
| 50 } // namespace extensions | |
| OLD | NEW |