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 522 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
533 | 533 |
534 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); | 534 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); |
535 if (command_line.HasSwitch(switches::kDomAutomationController)) | 535 if (command_line.HasSwitch(switches::kDomAutomationController)) |
536 enabled_bindings_ |= content::BINDINGS_POLICY_DOM_AUTOMATION; | 536 enabled_bindings_ |= content::BINDINGS_POLICY_DOM_AUTOMATION; |
537 | 537 |
538 bool enable_fixed_layout = | 538 bool enable_fixed_layout = |
539 command_line.HasSwitch(switches::kEnableFixedLayout); | 539 command_line.HasSwitch(switches::kEnableFixedLayout); |
540 webview()->enableFixedLayoutMode(enable_fixed_layout); | 540 webview()->enableFixedLayoutMode(enable_fixed_layout); |
541 if (enable_fixed_layout) | 541 if (enable_fixed_layout) |
542 webview()->settings()->setFixedElementsLayoutRelativeToFrame(true); | 542 webview()->settings()->setFixedElementsLayoutRelativeToFrame(true); |
543 base::StringToInt(command_line.GetSwitchValueASCII( | |
544 switches::kDefaultDeviceScaleFactor), | |
545 &default_device_scale_factor_); | |
546 | 543 |
547 content::GetContentClient()->renderer()->RenderViewCreated(this); | 544 content::GetContentClient()->renderer()->RenderViewCreated(this); |
548 } | 545 } |
549 | 546 |
550 RenderViewImpl::~RenderViewImpl() { | 547 RenderViewImpl::~RenderViewImpl() { |
551 history_page_ids_.clear(); | 548 history_page_ids_.clear(); |
552 | 549 |
553 if (decrement_shared_popup_at_destruction_) | 550 if (decrement_shared_popup_at_destruction_) |
554 shared_popup_counter_->data--; | 551 shared_popup_counter_->data--; |
555 | 552 |
(...skipping 3854 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4410 void RenderViewImpl::OnMoveOrResizeStarted() { | 4407 void RenderViewImpl::OnMoveOrResizeStarted() { |
4411 if (webview()) | 4408 if (webview()) |
4412 webview()->hidePopups(); | 4409 webview()->hidePopups(); |
4413 } | 4410 } |
4414 | 4411 |
4415 void RenderViewImpl::OnResize(const gfx::Size& new_size, | 4412 void RenderViewImpl::OnResize(const gfx::Size& new_size, |
4416 const gfx::Rect& resizer_rect, | 4413 const gfx::Rect& resizer_rect, |
4417 bool is_fullscreen) { | 4414 bool is_fullscreen) { |
4418 if (webview()) { | 4415 if (webview()) { |
4419 // This setting has no effect if fixed layout is not enabled. | 4416 // This setting has no effect if fixed layout is not enabled. |
4420 if (default_device_scale_factor_) | 4417 if (webkit_preferences_.default_device_scale_factor) |
4421 webview()->settings()->setLayoutFallbackWidth( | 4418 webview()->settings()->setLayoutFallbackWidth( |
4422 new_size.width() / default_device_scale_factor_); | 4419 new_size.width() / webkit_preferences_.default_device_scale_factor); |
4423 webview()->hidePopups(); | 4420 webview()->hidePopups(); |
4424 if (send_preferred_size_changes_) { | 4421 if (send_preferred_size_changes_) { |
4425 webview()->mainFrame()->setCanHaveScrollbars( | 4422 webview()->mainFrame()->setCanHaveScrollbars( |
4426 ShouldDisplayScrollbars(new_size.width(), new_size.height())); | 4423 ShouldDisplayScrollbars(new_size.width(), new_size.height())); |
4427 } | 4424 } |
4428 UpdateScrollState(webview()->mainFrame()); | 4425 UpdateScrollState(webview()->mainFrame()); |
4429 } | 4426 } |
4430 | 4427 |
4431 RenderWidget::OnResize(new_size, resizer_rect, is_fullscreen); | 4428 RenderWidget::OnResize(new_size, resizer_rect, is_fullscreen); |
4432 } | 4429 } |
(...skipping 665 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5098 bool RenderViewImpl::WebWidgetHandlesCompositorScheduling() const { | 5095 bool RenderViewImpl::WebWidgetHandlesCompositorScheduling() const { |
5099 return !!RenderThreadImpl::current()->compositor_thread(); | 5096 return !!RenderThreadImpl::current()->compositor_thread(); |
5100 } | 5097 } |
5101 | 5098 |
5102 void RenderViewImpl::OnJavaBridgeInit() { | 5099 void RenderViewImpl::OnJavaBridgeInit() { |
5103 DCHECK(!java_bridge_dispatcher_.get()); | 5100 DCHECK(!java_bridge_dispatcher_.get()); |
5104 #if defined(ENABLE_JAVA_BRIDGE) | 5101 #if defined(ENABLE_JAVA_BRIDGE) |
5105 java_bridge_dispatcher_.reset(new JavaBridgeDispatcher(this)); | 5102 java_bridge_dispatcher_.reset(new JavaBridgeDispatcher(this)); |
5106 #endif | 5103 #endif |
5107 } | 5104 } |
OLD | NEW |