Chromium Code Reviews| 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 3328 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3339 command_line.GetSwitchValueASCII(switches::kEnableFixedLayout); | 3339 command_line.GetSwitchValueASCII(switches::kEnableFixedLayout); |
| 3340 std::vector<std::string> tokens; | 3340 std::vector<std::string> tokens; |
| 3341 base::SplitString(str, ',', &tokens); | 3341 base::SplitString(str, ',', &tokens); |
| 3342 if (tokens.size() == 2) { | 3342 if (tokens.size() == 2) { |
| 3343 int width, height; | 3343 int width, height; |
| 3344 if (base::StringToInt(tokens[0], &width) && | 3344 if (base::StringToInt(tokens[0], &width) && |
| 3345 base::StringToInt(tokens[1], &height)) | 3345 base::StringToInt(tokens[1], &height)) |
| 3346 webview()->setFixedLayoutSize(WebSize(width, height)); | 3346 webview()->setFixedLayoutSize(WebSize(width, height)); |
| 3347 } | 3347 } |
| 3348 } | 3348 } |
| 3349 | 3349 float maxPageScaleFactor = 1; |
|
jamesr
2013/03/14 19:55:55
1.f
| |
| 3350 #if defined(OS_CHROMEOS) | |
| 3351 if (!command_line.HasSwitch(switches::kDisablePinch)) | |
| 3352 maxPageScaleFactor = 4; | |
|
jamesr
2013/03/14 19:55:55
4.f
| |
| 3353 #else | |
| 3350 if (command_line.HasSwitch(switches::kEnablePinch)) | 3354 if (command_line.HasSwitch(switches::kEnablePinch)) |
| 3351 webview()->setPageScaleFactorLimits(1, 4); | 3355 maxPageScaleFactor = 4; |
|
jamesr
2013/03/14 19:55:55
4.f
| |
| 3352 else | 3356 #endif |
| 3353 webview()->setPageScaleFactorLimits(1, 1); | 3357 webview()->setPageScaleFactorLimits(1, maxPageScaleFactor); |
|
jamesr
2013/03/14 19:55:55
1.f
| |
| 3354 } | 3358 } |
| 3355 | 3359 |
| 3356 void RenderViewImpl::didStartProvisionalLoad(WebFrame* frame) { | 3360 void RenderViewImpl::didStartProvisionalLoad(WebFrame* frame) { |
| 3357 WebDataSource* ds = frame->provisionalDataSource(); | 3361 WebDataSource* ds = frame->provisionalDataSource(); |
| 3358 | 3362 |
| 3359 // In fast/loader/stop-provisional-loads.html, we abort the load before this | 3363 // In fast/loader/stop-provisional-loads.html, we abort the load before this |
| 3360 // callback is invoked. | 3364 // callback is invoked. |
| 3361 if (!ds) | 3365 if (!ds) |
| 3362 return; | 3366 return; |
| 3363 | 3367 |
| (...skipping 3229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 6593 TransportDIB* dib = TransportDIB::CreateWithHandle(dib_handle); | 6597 TransportDIB* dib = TransportDIB::CreateWithHandle(dib_handle); |
| 6594 RenderProcess::current()->ReleaseTransportDIB(dib); | 6598 RenderProcess::current()->ReleaseTransportDIB(dib); |
| 6595 } | 6599 } |
| 6596 | 6600 |
| 6597 void RenderViewImpl::DidCommitCompositorFrame() { | 6601 void RenderViewImpl::DidCommitCompositorFrame() { |
| 6598 RenderWidget::DidCommitCompositorFrame(); | 6602 RenderWidget::DidCommitCompositorFrame(); |
| 6599 FOR_EACH_OBSERVER(RenderViewObserver, observers_, DidCommitCompositorFrame()); | 6603 FOR_EACH_OBSERVER(RenderViewObserver, observers_, DidCommitCompositorFrame()); |
| 6600 } | 6604 } |
| 6601 | 6605 |
| 6602 } // namespace content | 6606 } // namespace content |
| OLD | NEW |