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/renderer/render_view_impl.h" | 5 #include "content/renderer/render_view_impl.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <cmath> | 8 #include <cmath> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 379 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
390 last_page_id_sent_to_browser_(-1), | 390 last_page_id_sent_to_browser_(-1), |
391 next_page_id_(next_page_id), | 391 next_page_id_(next_page_id), |
392 history_list_offset_(-1), | 392 history_list_offset_(-1), |
393 history_list_length_(0), | 393 history_list_length_(0), |
394 target_url_status_(TARGET_NONE), | 394 target_url_status_(TARGET_NONE), |
395 selection_text_offset_(0), | 395 selection_text_offset_(0), |
396 cached_is_main_frame_pinned_to_left_(false), | 396 cached_is_main_frame_pinned_to_left_(false), |
397 cached_is_main_frame_pinned_to_right_(false), | 397 cached_is_main_frame_pinned_to_right_(false), |
398 cached_has_main_frame_horizontal_scrollbar_(false), | 398 cached_has_main_frame_horizontal_scrollbar_(false), |
399 cached_has_main_frame_vertical_scrollbar_(false), | 399 cached_has_main_frame_vertical_scrollbar_(false), |
400 context_has_swapbuffers_complete_callback_(false), | |
401 queried_for_swapbuffers_complete_callback_(false), | |
402 ALLOW_THIS_IN_INITIALIZER_LIST(cookie_jar_(this)), | 400 ALLOW_THIS_IN_INITIALIZER_LIST(cookie_jar_(this)), |
403 geolocation_dispatcher_(NULL), | 401 geolocation_dispatcher_(NULL), |
404 speech_input_dispatcher_(NULL), | 402 speech_input_dispatcher_(NULL), |
405 device_orientation_dispatcher_(NULL), | 403 device_orientation_dispatcher_(NULL), |
406 media_stream_dispatcher_(NULL), | 404 media_stream_dispatcher_(NULL), |
407 p2p_socket_dispatcher_(NULL), | 405 p2p_socket_dispatcher_(NULL), |
408 devtools_agent_(NULL), | 406 devtools_agent_(NULL), |
409 renderer_accessibility_(NULL), | 407 renderer_accessibility_(NULL), |
410 mouse_lock_dispatcher_(NULL), | 408 mouse_lock_dispatcher_(NULL), |
411 session_storage_namespace_id_(session_storage_namespace_id), | 409 session_storage_namespace_id_(session_storage_namespace_id), |
(...skipping 4078 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4490 plugin_it != plugin_delegates_.end(); ++plugin_it) { | 4488 plugin_it != plugin_delegates_.end(); ++plugin_it) { |
4491 (*plugin_it)->SetContainerVisibility(true); | 4489 (*plugin_it)->SetContainerVisibility(true); |
4492 } | 4490 } |
4493 #endif // OS_MACOSX | 4491 #endif // OS_MACOSX |
4494 } | 4492 } |
4495 | 4493 |
4496 bool RenderViewImpl::SupportsAsynchronousSwapBuffers() { | 4494 bool RenderViewImpl::SupportsAsynchronousSwapBuffers() { |
4497 if (WebWidgetHandlesCompositorScheduling()) | 4495 if (WebWidgetHandlesCompositorScheduling()) |
4498 return false; | 4496 return false; |
4499 | 4497 |
4500 if (queried_for_swapbuffers_complete_callback_) | |
4501 return context_has_swapbuffers_complete_callback_; | |
4502 | |
4503 queried_for_swapbuffers_complete_callback_ = true; | |
4504 | |
4505 WebKit::WebGraphicsContext3D* context = webview()->graphicsContext3D(); | 4498 WebKit::WebGraphicsContext3D* context = webview()->graphicsContext3D(); |
4506 if (context) { | 4499 if (!context) |
4507 context->makeContextCurrent(); | 4500 return false; |
4508 std::string extensions(context->getRequestableExtensionsCHROMIUM().utf8()); | 4501 std::string extensions(context->getRequestableExtensionsCHROMIUM().utf8()); |
4509 context_has_swapbuffers_complete_callback_ = | 4502 return extensions.find("GL_CHROMIUM_swapbuffers_complete_callback") != |
4510 extensions.find("GL_CHROMIUM_swapbuffers_complete_callback") | 4503 std::string::npos; |
4511 != std::string::npos; | |
4512 } | |
4513 | |
4514 return context_has_swapbuffers_complete_callback_; | |
4515 } | 4504 } |
4516 | 4505 |
4517 void RenderViewImpl::OnSetFocus(bool enable) { | 4506 void RenderViewImpl::OnSetFocus(bool enable) { |
4518 RenderWidget::OnSetFocus(enable); | 4507 RenderWidget::OnSetFocus(enable); |
4519 | 4508 |
4520 if (webview() && webview()->isActive()) { | 4509 if (webview() && webview()->isActive()) { |
4521 // Notify all NPAPI plugins. | 4510 // Notify all NPAPI plugins. |
4522 std::set<WebPluginDelegateProxy*>::iterator plugin_it; | 4511 std::set<WebPluginDelegateProxy*>::iterator plugin_it; |
4523 for (plugin_it = plugin_delegates_.begin(); | 4512 for (plugin_it = plugin_delegates_.begin(); |
4524 plugin_it != plugin_delegates_.end(); ++plugin_it) { | 4513 plugin_it != plugin_delegates_.end(); ++plugin_it) { |
(...skipping 434 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4959 bool RenderViewImpl::WebWidgetHandlesCompositorScheduling() const { | 4948 bool RenderViewImpl::WebWidgetHandlesCompositorScheduling() const { |
4960 return !!RenderThreadImpl::current()->compositor_thread(); | 4949 return !!RenderThreadImpl::current()->compositor_thread(); |
4961 } | 4950 } |
4962 | 4951 |
4963 void RenderViewImpl::OnJavaBridgeInit() { | 4952 void RenderViewImpl::OnJavaBridgeInit() { |
4964 DCHECK(!java_bridge_dispatcher_.get()); | 4953 DCHECK(!java_bridge_dispatcher_.get()); |
4965 #if defined(ENABLE_JAVA_BRIDGE) | 4954 #if defined(ENABLE_JAVA_BRIDGE) |
4966 java_bridge_dispatcher_.reset(new JavaBridgeDispatcher(this)); | 4955 java_bridge_dispatcher_.reset(new JavaBridgeDispatcher(this)); |
4967 #endif | 4956 #endif |
4968 } | 4957 } |
OLD | NEW |