1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef CHROME_TEST_CHROMEDRIVER_CHROME_MOBILE_EMULATION_OVERRIDE_MANAGER_H_
6 #define CHROME_TEST_CHROMEDRIVER_CHROME_MOBILE_EMULATION_OVERRIDE_MANAGER_H_
10 #include "base/basictypes.h"
11 #include "base/compiler_specific.h"
12 #include "base/memory/scoped_ptr.h"
13 #include "chrome/test/chromedriver/chrome/devtools_event_listener.h"
16 class DictionaryValue
;
24 // Overrides the device metrics, if requested, for the duration of the
25 // given |DevToolsClient|'s lifetime.
26 class MobileEmulationOverrideManager
: public DevToolsEventListener
{
28 MobileEmulationOverrideManager(DevToolsClient
* client
,
29 const DeviceMetrics
* device_metrics
,
30 const BrowserInfo
* browser_info
);
31 ~MobileEmulationOverrideManager() override
;
33 // Overridden from DevToolsEventListener:
34 Status
OnConnected(DevToolsClient
* client
) override
;
35 Status
OnEvent(DevToolsClient
* client
,
36 const std::string
& method
,
37 const base::DictionaryValue
& params
) override
;
40 Status
ApplyOverrideIfNeeded();
42 DevToolsClient
* client_
;
43 const DeviceMetrics
* overridden_device_metrics_
;
44 const BrowserInfo
* browser_info_
;
46 DISALLOW_COPY_AND_ASSIGN(MobileEmulationOverrideManager
);
49 #endif // CHROME_TEST_CHROMEDRIVER_CHROME_MOBILE_EMULATION_OVERRIDE_MANAGER_H_