OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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.h" | 5 #include "content/browser/browser_plugin/test_browser_plugin_guest.h" |
6 | 6 |
7 #include "base/test/test_timeouts.h" | 7 #include "base/test/test_timeouts.h" |
8 #include "content/browser/renderer_host/render_view_host_impl.h" | 8 #include "content/browser/renderer_host/render_view_host_impl.h" |
9 #include "content/browser/web_contents/web_contents_impl.h" | 9 #include "content/browser/web_contents/web_contents_impl.h" |
10 #include "content/common/browser_plugin/browser_plugin_messages.h" | 10 #include "content/common/browser_plugin/browser_plugin_messages.h" |
(...skipping 18 matching lines...) Expand all Loading... |
29 TestBrowserPluginGuest::~TestBrowserPluginGuest() { | 29 TestBrowserPluginGuest::~TestBrowserPluginGuest() { |
30 } | 30 } |
31 | 31 |
32 WebContentsImpl* TestBrowserPluginGuest::web_contents() const { | 32 WebContentsImpl* TestBrowserPluginGuest::web_contents() const { |
33 return static_cast<WebContentsImpl*>(BrowserPluginGuest::web_contents()); | 33 return static_cast<WebContentsImpl*>(BrowserPluginGuest::web_contents()); |
34 } | 34 } |
35 | 35 |
36 void TestBrowserPluginGuest::SendMessageToEmbedder(IPC::Message* msg) { | 36 void TestBrowserPluginGuest::SendMessageToEmbedder(IPC::Message* msg) { |
37 if (msg->type() == BrowserPluginMsg_UpdateRect::ID) { | 37 if (msg->type() == BrowserPluginMsg_UpdateRect::ID) { |
38 update_rect_count_++; | 38 update_rect_count_++; |
39 int instance_id = 0; | 39 BrowserPluginMsg_UpdateRect::Param param; |
40 BrowserPluginMsg_UpdateRect_Params params; | 40 BrowserPluginMsg_UpdateRect::Read(msg, ¶m); |
41 BrowserPluginMsg_UpdateRect::Read(msg, &instance_id, ¶ms); | 41 BrowserPluginMsg_UpdateRect_Params params = param.b; |
42 last_view_size_observed_ = params.view_size; | 42 last_view_size_observed_ = params.view_size; |
43 if (!expected_auto_view_size_.IsEmpty() && | 43 if (!expected_auto_view_size_.IsEmpty() && |
44 expected_auto_view_size_ == params.view_size) { | 44 expected_auto_view_size_ == params.view_size) { |
45 if (auto_view_size_message_loop_runner_) | 45 if (auto_view_size_message_loop_runner_) |
46 auto_view_size_message_loop_runner_->Quit(); | 46 auto_view_size_message_loop_runner_->Quit(); |
47 } | 47 } |
48 if (send_message_loop_runner_) | 48 if (send_message_loop_runner_) |
49 send_message_loop_runner_->Quit(); | 49 send_message_loop_runner_->Quit(); |
50 } | 50 } |
51 BrowserPluginGuest::SendMessageToEmbedder(msg); | 51 BrowserPluginGuest::SendMessageToEmbedder(msg); |
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
178 void TestBrowserPluginGuest::OnImeCancelComposition() { | 178 void TestBrowserPluginGuest::OnImeCancelComposition() { |
179 if (!ime_cancel_observed_) { | 179 if (!ime_cancel_observed_) { |
180 ime_cancel_observed_ = true; | 180 ime_cancel_observed_ = true; |
181 if (ime_cancel_message_loop_runner_) | 181 if (ime_cancel_message_loop_runner_) |
182 ime_cancel_message_loop_runner_->Quit(); | 182 ime_cancel_message_loop_runner_->Quit(); |
183 } | 183 } |
184 BrowserPluginGuest::OnImeCancelComposition(); | 184 BrowserPluginGuest::OnImeCancelComposition(); |
185 } | 185 } |
186 | 186 |
187 } // namespace content | 187 } // namespace content |
OLD | NEW |