| OLD | NEW |
| 1 // Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2009 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 "base/gfx/rect.h" | 5 #include "base/gfx/rect.h" |
| 6 #include "base/logging.h" | 6 #include "base/logging.h" |
| 7 #include "base/message_loop.h" | 7 #include "base/message_loop.h" |
| 8 #include "base/string_util.h" | 8 #include "base/string_util.h" |
| 9 #include "base/utf_string_conversions.h" | 9 #include "base/utf_string_conversions.h" |
| 10 #include "net/base/escape.h" | 10 #include "net/base/escape.h" |
| (...skipping 388 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 399 for (size_t i = 0; i < params.attributeNames.size(); ++i) { | 399 for (size_t i = 0; i < params.attributeNames.size(); ++i) { |
| 400 arg_names_.push_back(params.attributeNames[i].utf8()); | 400 arg_names_.push_back(params.attributeNames[i].utf8()); |
| 401 arg_values_.push_back(params.attributeValues[i].utf8()); | 401 arg_values_.push_back(params.attributeValues[i].utf8()); |
| 402 } | 402 } |
| 403 } | 403 } |
| 404 | 404 |
| 405 WebPluginImpl::~WebPluginImpl() { | 405 WebPluginImpl::~WebPluginImpl() { |
| 406 } | 406 } |
| 407 | 407 |
| 408 void WebPluginImpl::SetWindow(gfx::PluginWindowHandle window) { | 408 void WebPluginImpl::SetWindow(gfx::PluginWindowHandle window) { |
| 409 #if defined(OS_MACOSX) |
| 410 // The only time this is called twice, and the second time with a |
| 411 // non-zero PluginWindowHandle, is the case when this WebPluginImpl |
| 412 // is created on behalf of the GPU plugin. This entire code path |
| 413 // will go away soon, as soon as the GPU plugin becomes the GPU |
| 414 // process, so it is being separated out for easy deletion. |
| 415 |
| 416 // The logic we want here is: if (window) DCHECK(!window_); |
| 417 DCHECK(!(window_ && window)); |
| 418 window_ = window; |
| 419 // Lie to ourselves about being windowless even if we got a fake |
| 420 // plugin window handle, so we continue to get input events. |
| 421 windowless_ = true; |
| 422 accepts_input_events_ = true; |
| 423 // We do not really need to notify the page delegate that a plugin |
| 424 // window was created -- so don't. |
| 425 #else |
| 409 if (window) { | 426 if (window) { |
| 410 DCHECK(!windowless_); | 427 DCHECK(!windowless_); |
| 411 window_ = window; | 428 window_ = window; |
| 412 accepts_input_events_ = false; | 429 accepts_input_events_ = false; |
| 413 if (page_delegate_) { | 430 if (page_delegate_) { |
| 414 // Tell the view delegate that the plugin window was created, so that it | 431 // Tell the view delegate that the plugin window was created, so that it |
| 415 // can create necessary container widgets. | 432 // can create necessary container widgets. |
| 416 page_delegate_->CreatedPluginWindow(window); | 433 page_delegate_->CreatedPluginWindow(window); |
| 417 } | 434 } |
| 418 } else { | 435 } else { |
| 419 DCHECK(!window_); // Make sure not called twice. | 436 DCHECK(!window_); // Make sure not called twice. |
| 420 windowless_ = true; | 437 windowless_ = true; |
| 421 accepts_input_events_ = true; | 438 accepts_input_events_ = true; |
| 422 } | 439 } |
| 440 #endif |
| 423 } | 441 } |
| 424 | 442 |
| 425 void WebPluginImpl::WillDestroyWindow(gfx::PluginWindowHandle window) { | 443 void WebPluginImpl::WillDestroyWindow(gfx::PluginWindowHandle window) { |
| 426 DCHECK_EQ(window, window_); | 444 DCHECK_EQ(window, window_); |
| 427 window_ = NULL; | 445 window_ = NULL; |
| 428 if (page_delegate_) | 446 if (page_delegate_) |
| 429 page_delegate_->WillDestroyPluginWindow(window); | 447 page_delegate_->WillDestroyPluginWindow(window); |
| 430 } | 448 } |
| 431 | 449 |
| 432 GURL WebPluginImpl::CompleteURL(const char* url) { | 450 GURL WebPluginImpl::CompleteURL(const char* url) { |
| (...skipping 695 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1128 WebDevToolsAgent* WebPluginImpl::GetDevToolsAgent() { | 1146 WebDevToolsAgent* WebPluginImpl::GetDevToolsAgent() { |
| 1129 if (!webframe_) | 1147 if (!webframe_) |
| 1130 return NULL; | 1148 return NULL; |
| 1131 WebView* view = webframe_->view(); | 1149 WebView* view = webframe_->view(); |
| 1132 if (!view) | 1150 if (!view) |
| 1133 return NULL; | 1151 return NULL; |
| 1134 return view->devToolsAgent(); | 1152 return view->devToolsAgent(); |
| 1135 } | 1153 } |
| 1136 | 1154 |
| 1137 } // namespace webkit_glue | 1155 } // namespace webkit_glue |
| OLD | NEW |