OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 #include "content/browser/browser_plugin/test_browser_plugin_guest_manager.h" | 5 #include "content/browser/browser_plugin/test_browser_plugin_guest_manager.h" |
6 | 6 |
7 #include "content/browser/web_contents/web_contents_impl.h" | 7 #include "content/browser/web_contents/web_contents_impl.h" |
8 #include "content/public/test/test_utils.h" | 8 #include "content/public/test/test_utils.h" |
9 | 9 |
10 namespace content { | 10 namespace content { |
11 | 11 |
12 TestBrowserPluginGuestManager::TestBrowserPluginGuestManager() { | 12 TestBrowserPluginGuestManager::TestBrowserPluginGuestManager() { |
13 } | 13 } |
14 | 14 |
15 TestBrowserPluginGuestManager::~TestBrowserPluginGuestManager() { | 15 TestBrowserPluginGuestManager::~TestBrowserPluginGuestManager() { |
16 } | 16 } |
17 | 17 |
18 void TestBrowserPluginGuestManager::AddGuest( | 18 void TestBrowserPluginGuestManager::AddGuest( |
19 int instance_id, | 19 int instance_id, |
20 WebContentsImpl* guest_web_contents) { | 20 WebContentsImpl* guest_web_contents) { |
21 BrowserPluginGuestManager::AddGuest(instance_id, guest_web_contents); | 21 BrowserPluginGuestManager::AddGuest(instance_id, guest_web_contents); |
22 if (message_loop_runner_) | 22 if (message_loop_runner_.get()) |
23 message_loop_runner_->Quit(); | 23 message_loop_runner_->Quit(); |
24 } | 24 } |
25 | 25 |
26 void TestBrowserPluginGuestManager::WaitForGuestAdded() { | 26 void TestBrowserPluginGuestManager::WaitForGuestAdded() { |
27 // Check if guests were already created. | 27 // Check if guests were already created. |
28 if (guest_web_contents_by_instance_id_.size() > 0) | 28 if (guest_web_contents_by_instance_id_.size() > 0) |
29 return; | 29 return; |
30 // Wait otherwise. | 30 // Wait otherwise. |
31 message_loop_runner_ = new MessageLoopRunner(); | 31 message_loop_runner_ = new MessageLoopRunner(); |
32 message_loop_runner_->Run(); | 32 message_loop_runner_->Run(); |
33 } | 33 } |
34 | 34 |
35 } // namespace content | 35 } // namespace content |
OLD | NEW |