Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(368)

Side by Side Diff: content/browser/devtools/protocol/emulation_handler.cc

Issue 2590293003: [DevTools] Rework DevToolsSession interaction with domain handlers. (Closed)
Patch Set: Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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/browser/devtools/protocol/emulation_handler.h" 5 #include "content/browser/devtools/protocol/emulation_handler.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/strings/string_number_conversions.h" 9 #include "base/strings/string_number_conversions.h"
10 #include "build/build_config.h" 10 #include "build/build_config.h"
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 if (protocol_value == 48 if (protocol_value ==
49 Emulation::SetTouchEmulationEnabled::ConfigurationEnum::Desktop) { 49 Emulation::SetTouchEmulationEnabled::ConfigurationEnum::Desktop) {
50 result = ui::GestureProviderConfigType::GENERIC_DESKTOP; 50 result = ui::GestureProviderConfigType::GENERIC_DESKTOP;
51 } 51 }
52 return result; 52 return result;
53 } 53 }
54 54
55 } // namespace 55 } // namespace
56 56
57 EmulationHandler::EmulationHandler() 57 EmulationHandler::EmulationHandler()
58 : touch_emulation_enabled_(false), 58 : DevToolsDomainHandler(Emulation::Metainfo::domainName),
59 touch_emulation_enabled_(false),
59 device_emulation_enabled_(false), 60 device_emulation_enabled_(false),
60 host_(nullptr) { 61 host_(nullptr) {
61 } 62 }
62 63
63 EmulationHandler::~EmulationHandler() { 64 EmulationHandler::~EmulationHandler() {
64 } 65 }
65 66
66 void EmulationHandler::SetRenderFrameHost(RenderFrameHostImpl* host) { 67 void EmulationHandler::SetRenderFrameHost(RenderFrameHostImpl* host) {
67 if (host_ == host) 68 if (host_ == host)
68 return; 69 return;
(...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after
278 widget_host->Send(new ViewMsg_EnableDeviceEmulation( 279 widget_host->Send(new ViewMsg_EnableDeviceEmulation(
279 widget_host->GetRoutingID(), device_emulation_params_)); 280 widget_host->GetRoutingID(), device_emulation_params_));
280 } else { 281 } else {
281 widget_host->Send(new ViewMsg_DisableDeviceEmulation( 282 widget_host->Send(new ViewMsg_DisableDeviceEmulation(
282 widget_host->GetRoutingID())); 283 widget_host->GetRoutingID()));
283 } 284 }
284 } 285 }
285 286
286 } // namespace protocol 287 } // namespace protocol
287 } // namespace content 288 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698