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 2516 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2527 void RenderViewImpl::OnResetPageEncodingToDefault() { | 2527 void RenderViewImpl::OnResetPageEncodingToDefault() { |
2528 WebString no_encoding; | 2528 WebString no_encoding; |
2529 webview()->setPageEncoding(no_encoding); | 2529 webview()->setPageEncoding(no_encoding); |
2530 } | 2530 } |
2531 | 2531 |
2532 void RenderViewImpl::OnAllowBindings(int enabled_bindings_flags) { | 2532 void RenderViewImpl::OnAllowBindings(int enabled_bindings_flags) { |
2533 if ((enabled_bindings_flags & BINDINGS_POLICY_WEB_UI) && | 2533 if ((enabled_bindings_flags & BINDINGS_POLICY_WEB_UI) && |
2534 !(enabled_bindings_ & BINDINGS_POLICY_WEB_UI)) { | 2534 !(enabled_bindings_ & BINDINGS_POLICY_WEB_UI)) { |
2535 // WebUIExtensionData deletes itself when we're destroyed. | 2535 // WebUIExtensionData deletes itself when we're destroyed. |
2536 new WebUIExtensionData(this); | 2536 new WebUIExtensionData(this); |
| 2537 } |
| 2538 |
| 2539 // Enable Mojo bindings if either WebUI or Mojo bindings are being added to |
| 2540 // the policy and neither was previously present. |
| 2541 if (!(enabled_bindings_ & (BINDINGS_POLICY_WEB_UI | BINDINGS_POLICY_MOJO)) && |
| 2542 (enabled_bindings_flags & |
| 2543 (BINDINGS_POLICY_WEB_UI | BINDINGS_POLICY_MOJO)) && |
| 2544 GetMainRenderFrame()) { |
2537 // MojoBindingsController deletes itself when we're destroyed. | 2545 // MojoBindingsController deletes itself when we're destroyed. |
2538 new MojoBindingsController(this); | 2546 new MojoBindingsController(this); |
2539 } | 2547 } |
2540 | 2548 |
2541 enabled_bindings_ |= enabled_bindings_flags; | 2549 enabled_bindings_ |= enabled_bindings_flags; |
2542 | 2550 |
2543 // Keep track of the total bindings accumulated in this process. | 2551 // Keep track of the total bindings accumulated in this process. |
2544 RenderProcess::current()->AddBindings(enabled_bindings_flags); | 2552 RenderProcess::current()->AddBindings(enabled_bindings_flags); |
2545 } | 2553 } |
2546 | 2554 |
(...skipping 1162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3709 if (IsUseZoomForDSFEnabled()) { | 3717 if (IsUseZoomForDSFEnabled()) { |
3710 compositor_->SetPaintedDeviceScaleFactor(device_scale_factor_); | 3718 compositor_->SetPaintedDeviceScaleFactor(device_scale_factor_); |
3711 webview()->setZoomFactorForDeviceScaleFactor( | 3719 webview()->setZoomFactorForDeviceScaleFactor( |
3712 device_scale_factor_); | 3720 device_scale_factor_); |
3713 } else { | 3721 } else { |
3714 webview()->setDeviceScaleFactor(device_scale_factor_); | 3722 webview()->setDeviceScaleFactor(device_scale_factor_); |
3715 } | 3723 } |
3716 } | 3724 } |
3717 | 3725 |
3718 } // namespace content | 3726 } // namespace content |
OLD | NEW |