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

Side by Side Diff: webkit/glue/plugins/plugin_instance.cc

Issue 39105: Windowless plugins: basic drawing works. (Closed)
Patch Set: retry Created 11 years, 9 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
OLDNEW
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 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 "config.h" 5 #include "config.h"
6 6
7 #include "build/build_config.h"
8 #if defined(OS_LINUX)
9 #define MOZ_X11 1
10 #endif
11
7 #include "webkit/glue/plugins/plugin_instance.h" 12 #include "webkit/glue/plugins/plugin_instance.h"
8 13
9 #include "base/file_util.h" 14 #include "base/file_util.h"
10 #include "base/lazy_instance.h" 15 #include "base/lazy_instance.h"
11 #include "base/message_loop.h" 16 #include "base/message_loop.h"
12 #include "base/string_util.h" 17 #include "base/string_util.h"
13 #include "base/thread_local.h" 18 #include "base/thread_local.h"
14 #include "webkit/glue/glue_util.h" 19 #include "webkit/glue/glue_util.h"
15 #include "webkit/glue/webplugin.h" 20 #include "webkit/glue/webplugin.h"
16 #include "webkit/glue/webkit_glue.h" 21 #include "webkit/glue/webkit_glue.h"
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
123 bool PluginInstance::HandleEvent(UINT message, WPARAM wParam, LPARAM lParam) { 128 bool PluginInstance::HandleEvent(UINT message, WPARAM wParam, LPARAM lParam) {
124 if (!windowless_) 129 if (!windowless_)
125 return false; 130 return false;
126 131
127 NPEvent windowEvent; 132 NPEvent windowEvent;
128 windowEvent.event = message; 133 windowEvent.event = message;
129 windowEvent.lParam = static_cast<uint32>(lParam); 134 windowEvent.lParam = static_cast<uint32>(lParam);
130 windowEvent.wParam = static_cast<uint32>(wParam); 135 windowEvent.wParam = static_cast<uint32>(wParam);
131 return NPP_HandleEvent(&windowEvent) != 0; 136 return NPP_HandleEvent(&windowEvent) != 0;
132 } 137 }
138 #elif defined(OS_LINUX)
139 bool PluginInstance::HandleEvent(XEvent* event) {
140 if (!windowless_)
141 return false;
142 return NPP_HandleEvent(event);
143 }
133 #endif 144 #endif
134 145
135 bool PluginInstance::Start(const GURL& url, 146 bool PluginInstance::Start(const GURL& url,
136 char** const param_names, 147 char** const param_names,
137 char** const param_values, 148 char** const param_values,
138 int param_count, 149 int param_count,
139 bool load_manually) { 150 bool load_manually) {
140 load_manually_ = load_manually; 151 load_manually_ = load_manually;
141 instance_url_ = url; 152 instance_url_ = url;
142 unsigned short mode = load_manually_ ? NP_FULL : NP_EMBED; 153 unsigned short mode = load_manually_ ? NP_FULL : NP_EMBED;
(...skipping 354 matching lines...) Expand 10 before | Expand all | Expand 10 after
497 plugin_stream, 508 plugin_stream,
498 plugin_stream->notify_needed(), 509 plugin_stream->notify_needed(),
499 plugin_stream->notify_data()); 510 plugin_stream->notify_data());
500 break; 511 break;
501 } 512 }
502 } 513 }
503 } 514 }
504 515
505 } // namespace NPAPI 516 } // namespace NPAPI
506 517
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698