Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(284)

Side by Side Diff: content/browser/browser_plugin/test_browser_plugin_guest.cc

Issue 283623002: Add support for passing an arbitrary parameter to an IPC message handler. The motivation is for Web… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: sync Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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, &param);
41 BrowserPluginMsg_UpdateRect::Read(msg, &instance_id, &params); 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
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
OLDNEW
« no previous file with comments | « chrome/renderer/spellchecker/spellcheck_provider_test.cc ('k') | content/browser/loader/resource_dispatcher_host_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698