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

Side by Side Diff: chrome/test/chromedriver/chrome/device_metrics_override_manager.h

Issue 251933005: [ChromeDriver] Support mobile emulation on desktop Chrome. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 7 months 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 (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2014 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 #ifndef CHROME_TEST_CHROMEDRIVER_CHROME_GEOLOCATION_OVERRIDE_MANAGER_H_ 5 #ifndef CHROME_TEST_CHROMEDRIVER_CHROME_DEVICE_METRICS_OVERRIDE_MANAGER_H_
6 #define CHROME_TEST_CHROMEDRIVER_CHROME_GEOLOCATION_OVERRIDE_MANAGER_H_ 6 #define CHROME_TEST_CHROMEDRIVER_CHROME_DEVICE_METRICS_OVERRIDE_MANAGER_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
11 #include "base/compiler_specific.h" 11 #include "base/compiler_specific.h"
12 #include "base/memory/scoped_ptr.h" 12 #include "base/memory/scoped_ptr.h"
13 #include "chrome/test/chromedriver/chrome/devtools_event_listener.h" 13 #include "chrome/test/chromedriver/chrome/devtools_event_listener.h"
14 14
15 namespace base { 15 namespace base {
16 class DictionaryValue; 16 class DictionaryValue;
17 } 17 }
18 18
19 class DevToolsClient; 19 class DevToolsClient;
20 struct Geoposition; 20 struct DeviceMetrics;
21 class Status; 21 class Status;
22 22
23 // Overrides the geolocation, if requested, for the duration of the 23 // Overrides the device metrics, if requested, for the duration of the
24 // given |DevToolsClient|'s lifetime. 24 // given |DevToolsClient|'s lifetime.
25 class GeolocationOverrideManager : public DevToolsEventListener { 25 class DeviceMetricsOverrideManager : public DevToolsEventListener {
26 public: 26 public:
27 explicit GeolocationOverrideManager(DevToolsClient* client); 27 explicit DeviceMetricsOverrideManager(DevToolsClient* client);
28 virtual ~GeolocationOverrideManager(); 28 virtual ~DeviceMetricsOverrideManager();
29 29
30 Status OverrideGeolocation(const Geoposition& geoposition); 30 Status OverrideDeviceMetrics(const DeviceMetrics& DeviceMetrics);
stgao 2014/05/03 00:15:20 Maybe we don't have to add this function, as we do
sam.rawlins 2014/05/06 23:51:46 Done.
31 31
32 // Overridden from DevToolsEventListener: 32 // Overridden from DevToolsEventListener:
33 virtual Status OnConnected(DevToolsClient* client) OVERRIDE; 33 virtual Status OnConnected(DevToolsClient* client) OVERRIDE;
34 virtual Status OnEvent(DevToolsClient* client, 34 virtual Status OnEvent(DevToolsClient* client,
35 const std::string& method, 35 const std::string& method,
36 const base::DictionaryValue& params) OVERRIDE; 36 const base::DictionaryValue& params) OVERRIDE;
37 37
38 private: 38 private:
39 Status ApplyOverrideIfNeeded(); 39 Status ApplyOverrideIfNeeded();
40 40
41 DevToolsClient* client_; 41 DevToolsClient* client_;
42 scoped_ptr<Geoposition> overridden_geoposition_; 42 scoped_ptr<DeviceMetrics> overridden_device_metrics_;
43 43
44 DISALLOW_COPY_AND_ASSIGN(GeolocationOverrideManager); 44 DISALLOW_COPY_AND_ASSIGN(DeviceMetricsOverrideManager);
45 }; 45 };
46 46
47 #endif // CHROME_TEST_CHROMEDRIVER_CHROME_GEOLOCATION_OVERRIDE_MANAGER_H_ 47 #endif // CHROME_TEST_CHROMEDRIVER_CHROME_DEVICE_METRICS_OVERRIDE_MANAGER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698