Commit b854eb45 authored by danakj's avatar danakj Committed by Commit Bot

Don't disable emulation if params change but emulation is off.

The renderer doesn't expect emulation to be disabled if already
disabled, and no need to do any work.

R=yangguo@chromium.org

Bug: 1015926
Change-Id: Ib35f232761ec096519af777752d327be5de99b3e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1868656
Auto-Submit: danakj <danakj@chromium.org>
Reviewed-by: default avatarYang Guo <yangguo@chromium.org>
Commit-Queue: Yang Guo <yangguo@chromium.org>
Commit-Queue: danakj <danakj@chromium.org>
Cr-Commit-Position: refs/heads/master@{#708265}
parent 116b788f
...@@ -336,11 +336,15 @@ blink::WebDeviceEmulationParams EmulationHandler::GetDeviceEmulationParams() { ...@@ -336,11 +336,15 @@ blink::WebDeviceEmulationParams EmulationHandler::GetDeviceEmulationParams() {
void EmulationHandler::SetDeviceEmulationParams( void EmulationHandler::SetDeviceEmulationParams(
const blink::WebDeviceEmulationParams& params) { const blink::WebDeviceEmulationParams& params) {
bool enabled = params != blink::WebDeviceEmulationParams(); bool enabled = params != blink::WebDeviceEmulationParams();
if (params != device_emulation_params_) { bool enable_changed = enabled != device_emulation_enabled_;
device_emulation_enabled_ = enabled; bool params_changed = params != device_emulation_params_;
device_emulation_params_ = params; if (!device_emulation_enabled_ && !enable_changed)
UpdateDeviceEmulationState(); return; // Still disabled.
} if (!enable_changed && !params_changed)
return; // Nothing changed.
device_emulation_enabled_ = enabled;
device_emulation_params_ = params;
UpdateDeviceEmulationState();
} }
WebContentsImpl* EmulationHandler::GetWebContents() { WebContentsImpl* EmulationHandler::GetWebContents() {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment