| 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 410 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 421 int32 opener_id, | 421 int32 opener_id, |
| 422 const content::RendererPreferences& renderer_prefs, | 422 const content::RendererPreferences& renderer_prefs, |
| 423 const WebPreferences& webkit_prefs, | 423 const WebPreferences& webkit_prefs, |
| 424 SharedRenderViewCounter* counter, | 424 SharedRenderViewCounter* counter, |
| 425 int32 routing_id, | 425 int32 routing_id, |
| 426 int32 surface_id, | 426 int32 surface_id, |
| 427 int64 session_storage_namespace_id, | 427 int64 session_storage_namespace_id, |
| 428 const string16& frame_name, | 428 const string16& frame_name, |
| 429 int32 next_page_id, | 429 int32 next_page_id, |
| 430 const WebKit::WebScreenInfo& screen_info, | 430 const WebKit::WebScreenInfo& screen_info, |
| 431 bool guest) | 431 bool guest, |
| 432 AccessibilityMode accessibility_mode) |
| 432 : RenderWidget(WebKit::WebPopupTypeNone, screen_info), | 433 : RenderWidget(WebKit::WebPopupTypeNone, screen_info), |
| 433 webkit_preferences_(webkit_prefs), | 434 webkit_preferences_(webkit_prefs), |
| 434 send_content_state_immediately_(false), | 435 send_content_state_immediately_(false), |
| 435 enabled_bindings_(0), | 436 enabled_bindings_(0), |
| 436 send_preferred_size_changes_(false), | 437 send_preferred_size_changes_(false), |
| 437 is_loading_(false), | 438 is_loading_(false), |
| 438 navigation_gesture_(NavigationGestureUnknown), | 439 navigation_gesture_(NavigationGestureUnknown), |
| 439 opened_by_user_gesture_(true), | 440 opened_by_user_gesture_(true), |
| 440 opener_suppressed_(false), | 441 opener_suppressed_(false), |
| 441 page_id_(-1), | 442 page_id_(-1), |
| (...skipping 18 matching lines...) Expand all Loading... |
| 460 p2p_socket_dispatcher_(NULL), | 461 p2p_socket_dispatcher_(NULL), |
| 461 devtools_agent_(NULL), | 462 devtools_agent_(NULL), |
| 462 renderer_accessibility_(NULL), | 463 renderer_accessibility_(NULL), |
| 463 mouse_lock_dispatcher_(NULL), | 464 mouse_lock_dispatcher_(NULL), |
| 464 session_storage_namespace_id_(session_storage_namespace_id), | 465 session_storage_namespace_id_(session_storage_namespace_id), |
| 465 handling_select_range_(false), | 466 handling_select_range_(false), |
| 466 #if defined(OS_WIN) | 467 #if defined(OS_WIN) |
| 467 focused_plugin_id_(-1), | 468 focused_plugin_id_(-1), |
| 468 #endif | 469 #endif |
| 469 guest_(guest), | 470 guest_(guest), |
| 471 accessibility_mode_(accessibility_mode), |
| 470 ALLOW_THIS_IN_INITIALIZER_LIST(pepper_delegate_(this)) { | 472 ALLOW_THIS_IN_INITIALIZER_LIST(pepper_delegate_(this)) { |
| 471 routing_id_ = routing_id; | 473 routing_id_ = routing_id; |
| 472 surface_id_ = surface_id; | 474 surface_id_ = surface_id; |
| 473 if (opener_id != MSG_ROUTING_NONE) | 475 if (opener_id != MSG_ROUTING_NONE) |
| 474 opener_id_ = opener_id; | 476 opener_id_ = opener_id; |
| 475 | 477 |
| 476 // Ensure we start with a valid next_page_id_ from the browser. | 478 // Ensure we start with a valid next_page_id_ from the browser. |
| 477 DCHECK_GE(next_page_id_, 0); | 479 DCHECK_GE(next_page_id_, 0); |
| 478 | 480 |
| 479 #if defined(ENABLE_NOTIFICATIONS) | 481 #if defined(ENABLE_NOTIFICATIONS) |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 530 #endif | 532 #endif |
| 531 | 533 |
| 532 new MHTMLGenerator(this); | 534 new MHTMLGenerator(this); |
| 533 #if defined(OS_MACOSX) | 535 #if defined(OS_MACOSX) |
| 534 new TextInputClientObserver(this); | 536 new TextInputClientObserver(this); |
| 535 #endif // defined(OS_MACOSX) | 537 #endif // defined(OS_MACOSX) |
| 536 | 538 |
| 537 // The next group of objects all implement RenderViewObserver, so are deleted | 539 // The next group of objects all implement RenderViewObserver, so are deleted |
| 538 // along with the RenderView automatically. | 540 // along with the RenderView automatically. |
| 539 devtools_agent_ = new DevToolsAgent(this); | 541 devtools_agent_ = new DevToolsAgent(this); |
| 540 renderer_accessibility_ = new RendererAccessibility(this); | 542 renderer_accessibility_ = new RendererAccessibility(this, accessibility_mode); |
| 541 mouse_lock_dispatcher_ = new MouseLockDispatcher(this); | 543 mouse_lock_dispatcher_ = new MouseLockDispatcher(this); |
| 542 intents_host_ = new WebIntentsHost(this); | 544 intents_host_ = new WebIntentsHost(this); |
| 543 | 545 |
| 544 new IdleUserDetector(this); | 546 new IdleUserDetector(this); |
| 545 | 547 |
| 546 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); | 548 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); |
| 547 if (command_line.HasSwitch(switches::kDomAutomationController)) | 549 if (command_line.HasSwitch(switches::kDomAutomationController)) |
| 548 enabled_bindings_ |= content::BINDINGS_POLICY_DOM_AUTOMATION; | 550 enabled_bindings_ |= content::BINDINGS_POLICY_DOM_AUTOMATION; |
| 549 | 551 |
| 550 ProcessViewLayoutFlags(command_line); | 552 ProcessViewLayoutFlags(command_line); |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 620 int32 opener_id, | 622 int32 opener_id, |
| 621 const content::RendererPreferences& renderer_prefs, | 623 const content::RendererPreferences& renderer_prefs, |
| 622 const WebPreferences& webkit_prefs, | 624 const WebPreferences& webkit_prefs, |
| 623 SharedRenderViewCounter* counter, | 625 SharedRenderViewCounter* counter, |
| 624 int32 routing_id, | 626 int32 routing_id, |
| 625 int32 surface_id, | 627 int32 surface_id, |
| 626 int64 session_storage_namespace_id, | 628 int64 session_storage_namespace_id, |
| 627 const string16& frame_name, | 629 const string16& frame_name, |
| 628 int32 next_page_id, | 630 int32 next_page_id, |
| 629 const WebKit::WebScreenInfo& screen_info, | 631 const WebKit::WebScreenInfo& screen_info, |
| 630 bool guest) { | 632 bool guest, |
| 633 AccessibilityMode accessibility_mode) { |
| 631 DCHECK(routing_id != MSG_ROUTING_NONE); | 634 DCHECK(routing_id != MSG_ROUTING_NONE); |
| 632 return new RenderViewImpl( | 635 return new RenderViewImpl( |
| 633 parent_hwnd, | 636 parent_hwnd, |
| 634 opener_id, | 637 opener_id, |
| 635 renderer_prefs, | 638 renderer_prefs, |
| 636 webkit_prefs, | 639 webkit_prefs, |
| 637 counter, | 640 counter, |
| 638 routing_id, | 641 routing_id, |
| 639 surface_id, | 642 surface_id, |
| 640 session_storage_namespace_id, | 643 session_storage_namespace_id, |
| 641 frame_name, | 644 frame_name, |
| 642 next_page_id, | 645 next_page_id, |
| 643 screen_info, | 646 screen_info, |
| 644 guest); | 647 guest, |
| 648 accessibility_mode); |
| 645 } | 649 } |
| 646 | 650 |
| 647 WebKit::WebPeerConnectionHandler* RenderViewImpl::CreatePeerConnectionHandler( | 651 WebKit::WebPeerConnectionHandler* RenderViewImpl::CreatePeerConnectionHandler( |
| 648 WebKit::WebPeerConnectionHandlerClient* client) { | 652 WebKit::WebPeerConnectionHandlerClient* client) { |
| 649 const CommandLine* cmd_line = CommandLine::ForCurrentProcess(); | 653 const CommandLine* cmd_line = CommandLine::ForCurrentProcess(); |
| 650 if (!cmd_line->HasSwitch(switches::kEnableMediaStream)) | 654 if (!cmd_line->HasSwitch(switches::kEnableMediaStream)) |
| 651 return NULL; | 655 return NULL; |
| 652 EnsureMediaStreamImpl(); | 656 EnsureMediaStreamImpl(); |
| 653 if (!media_stream_impl_.get()) | 657 if (!media_stream_impl_.get()) |
| 654 return NULL; | 658 return NULL; |
| (...skipping 838 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1493 routing_id_, | 1497 routing_id_, |
| 1494 renderer_preferences_, | 1498 renderer_preferences_, |
| 1495 webkit_preferences_, | 1499 webkit_preferences_, |
| 1496 shared_popup_counter_, | 1500 shared_popup_counter_, |
| 1497 routing_id, | 1501 routing_id, |
| 1498 surface_id, | 1502 surface_id, |
| 1499 cloned_session_storage_namespace_id, | 1503 cloned_session_storage_namespace_id, |
| 1500 frame_name, | 1504 frame_name, |
| 1501 1, | 1505 1, |
| 1502 screen_info_, | 1506 screen_info_, |
| 1503 guest_); | 1507 guest_, |
| 1508 accessibility_mode_); |
| 1504 view->opened_by_user_gesture_ = params.user_gesture; | 1509 view->opened_by_user_gesture_ = params.user_gesture; |
| 1505 | 1510 |
| 1506 // Record whether the creator frame is trying to suppress the opener field. | 1511 // Record whether the creator frame is trying to suppress the opener field. |
| 1507 view->opener_suppressed_ = params.opener_suppressed; | 1512 view->opener_suppressed_ = params.opener_suppressed; |
| 1508 | 1513 |
| 1509 // Record the security origin of the creator. | 1514 // Record the security origin of the creator. |
| 1510 GURL creator_url(creator->document().securityOrigin().toString().utf8()); | 1515 GURL creator_url(creator->document().securityOrigin().toString().utf8()); |
| 1511 if (!creator_url.is_valid() || !creator_url.IsStandard()) | 1516 if (!creator_url.is_valid() || !creator_url.IsStandard()) |
| 1512 creator_url = GURL(); | 1517 creator_url = GURL(); |
| 1513 view->creator_url_ = creator_url; | 1518 view->creator_url_ = creator_url; |
| (...skipping 3719 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5233 bool RenderViewImpl::WebWidgetHandlesCompositorScheduling() const { | 5238 bool RenderViewImpl::WebWidgetHandlesCompositorScheduling() const { |
| 5234 return !!RenderThreadImpl::current()->compositor_thread(); | 5239 return !!RenderThreadImpl::current()->compositor_thread(); |
| 5235 } | 5240 } |
| 5236 | 5241 |
| 5237 void RenderViewImpl::OnJavaBridgeInit() { | 5242 void RenderViewImpl::OnJavaBridgeInit() { |
| 5238 DCHECK(!java_bridge_dispatcher_.get()); | 5243 DCHECK(!java_bridge_dispatcher_.get()); |
| 5239 #if defined(ENABLE_JAVA_BRIDGE) | 5244 #if defined(ENABLE_JAVA_BRIDGE) |
| 5240 java_bridge_dispatcher_.reset(new JavaBridgeDispatcher(this)); | 5245 java_bridge_dispatcher_.reset(new JavaBridgeDispatcher(this)); |
| 5241 #endif | 5246 #endif |
| 5242 } | 5247 } |
| OLD | NEW |