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 | 9 |
10 #include "base/auto_reset.h" | 10 #include "base/auto_reset.h" |
(...skipping 2368 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2379 WebString no_encoding; | 2379 WebString no_encoding; |
2380 webview()->setPageEncoding(no_encoding); | 2380 webview()->setPageEncoding(no_encoding); |
2381 } | 2381 } |
2382 | 2382 |
2383 void RenderViewImpl::OnAllowBindings(int enabled_bindings_flags) { | 2383 void RenderViewImpl::OnAllowBindings(int enabled_bindings_flags) { |
2384 if ((enabled_bindings_flags & BINDINGS_POLICY_WEB_UI) && | 2384 if ((enabled_bindings_flags & BINDINGS_POLICY_WEB_UI) && |
2385 !(enabled_bindings_ & BINDINGS_POLICY_WEB_UI)) { | 2385 !(enabled_bindings_ & BINDINGS_POLICY_WEB_UI)) { |
2386 // WebUIExtensionData deletes itself when we're destroyed. | 2386 // WebUIExtensionData deletes itself when we're destroyed. |
2387 new WebUIExtensionData(this); | 2387 new WebUIExtensionData(this); |
2388 | 2388 |
2389 if (main_render_frame_) | |
2390 main_render_frame_->EnableMojoBindings(false /* for_layout_tests */); | |
2391 } | |
2392 | |
2393 if ((enabled_bindings_flags & BINDINGS_POLICY_MOJO) && | |
2394 !(enabled_bindings_ & BINDINGS_POLICY_MOJO) && | |
2395 main_render_frame_) { | |
2396 main_render_frame_->EnableMojoBindings(true /* for_layout_tests */); | |
2397 } | 2389 } |
2398 | 2390 |
2399 enabled_bindings_ |= enabled_bindings_flags; | 2391 enabled_bindings_ |= enabled_bindings_flags; |
2400 | 2392 |
2401 // Keep track of the total bindings accumulated in this process. | 2393 // Keep track of the total bindings accumulated in this process. |
2402 RenderProcess::current()->AddBindings(enabled_bindings_flags); | 2394 RenderProcess::current()->AddBindings(enabled_bindings_flags); |
| 2395 |
| 2396 if (main_render_frame_) |
| 2397 main_render_frame_->MaybeEnableMojoBindings(); |
2403 } | 2398 } |
2404 | 2399 |
2405 void RenderViewImpl::OnDragTargetDragEnter(const DropData& drop_data, | 2400 void RenderViewImpl::OnDragTargetDragEnter(const DropData& drop_data, |
2406 const gfx::Point& client_point, | 2401 const gfx::Point& client_point, |
2407 const gfx::Point& screen_point, | 2402 const gfx::Point& screen_point, |
2408 WebDragOperationsMask ops, | 2403 WebDragOperationsMask ops, |
2409 int key_modifiers) { | 2404 int key_modifiers) { |
2410 WebDragOperation operation = webview()->dragTargetDragEnter( | 2405 WebDragOperation operation = webview()->dragTargetDragEnter( |
2411 DropDataToWebDragData(drop_data), | 2406 DropDataToWebDragData(drop_data), |
2412 ConvertWindowPointToViewport(client_point), | 2407 ConvertWindowPointToViewport(client_point), |
(...skipping 1118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3531 if (IsUseZoomForDSFEnabled()) { | 3526 if (IsUseZoomForDSFEnabled()) { |
3532 webview()->setZoomFactorForDeviceScaleFactor(device_scale_factor_); | 3527 webview()->setZoomFactorForDeviceScaleFactor(device_scale_factor_); |
3533 } else { | 3528 } else { |
3534 webview()->setDeviceScaleFactor(device_scale_factor_); | 3529 webview()->setDeviceScaleFactor(device_scale_factor_); |
3535 } | 3530 } |
3536 webview()->settings()->setPreferCompositingToLCDTextEnabled( | 3531 webview()->settings()->setPreferCompositingToLCDTextEnabled( |
3537 PreferCompositingToLCDText(compositor_deps_, device_scale_factor_)); | 3532 PreferCompositingToLCDText(compositor_deps_, device_scale_factor_)); |
3538 } | 3533 } |
3539 | 3534 |
3540 } // namespace content | 3535 } // namespace content |
OLD | NEW |