| Index: content/renderer/render_widget.h
|
| diff --git a/content/renderer/render_widget.h b/content/renderer/render_widget.h
|
| index d43934766c7721ab33372ac17d67eb9b2f1f0c53..5c4c1c86cd30863d714c59e52c998c5eb9e19c7d 100644
|
| --- a/content/renderer/render_widget.h
|
| +++ b/content/renderer/render_widget.h
|
| @@ -65,9 +65,11 @@ class Range;
|
| }
|
|
|
| namespace content {
|
| +class ExternalPopupMenu;
|
| class PepperPluginInstanceImpl;
|
| class RenderWidgetCompositor;
|
| class RenderWidgetTest;
|
| +struct ContextMenuParams;
|
| struct GpuRenderingStats;
|
| struct WebPluginGeometry;
|
|
|
| @@ -223,6 +225,22 @@ class CONTENT_EXPORT RenderWidget
|
|
|
| bool is_swapped_out() { return is_swapped_out_; }
|
|
|
| + // ScreenMetricsEmulator class manages screen emulation inside a render
|
| + // widget. This includes resizing, placing view on the screen at desired
|
| + // position, changing device scale factor, and scaling down the whole
|
| + // widget if required to fit into the browser window.
|
| + class ScreenMetricsEmulator;
|
| +
|
| + // Emulates screen and widget metrics. Supplied values override everything
|
| + // coming from host.
|
| + void EmulateScreenMetrics(
|
| + bool enabled,
|
| + const gfx::Size& device_size,
|
| + const gfx::Rect& widget_rect,
|
| + float device_scale_factor,
|
| + bool fit_to_view);
|
| + void SetPopupOriginAdjustmentsForEmulation(ScreenMetricsEmulator* emulator);
|
| +
|
| protected:
|
| // Friend RefCounted so that the dtor can be non-public. Using this class
|
| // without ref-counting is an error.
|
| @@ -291,6 +309,11 @@ class CONTENT_EXPORT RenderWidget
|
| const gfx::Rect& resizer_rect,
|
| bool is_fullscreen,
|
| ResizeAck resize_ack);
|
| + virtual void SetScreenMetricsEmulationParameters(bool enabled,
|
| + float device_scale_factor, float root_layer_scale);
|
| + void SetExternalPopupOriginAdjustmentsForEmulation(
|
| + ExternalPopupMenu* popup, ScreenMetricsEmulator* emulator);
|
| + virtual void OnShowHostContextMenu(ContextMenuParams* params);
|
|
|
| // RenderWidget IPC message handlers
|
| void OnHandleInputEvent(const WebKit::WebInputEvent* event,
|
| @@ -753,6 +776,14 @@ class CONTENT_EXPORT RenderWidget
|
| int outstanding_ime_acks_;
|
| #endif
|
|
|
| + scoped_ptr<ScreenMetricsEmulator> screen_metrics_emulator_;
|
| +
|
| + // Popups may be displaced when screen metrics emulation is enabled.
|
| + // These values are used to properly adjust popup position.
|
| + gfx::Point popup_view_origin_for_emulation_;
|
| + gfx::Point popup_screen_origin_for_emulation_;
|
| + float popup_origin_scale_for_emulation_;
|
| +
|
| base::WeakPtrFactory<RenderWidget> weak_ptr_factory_;
|
|
|
| DISALLOW_COPY_AND_ASSIGN(RenderWidget);
|
|
|