blob: 7b92b9d70e4ac9b60bd0cce7b0908ee1ee77feac [file] [log] [blame]
[email protected]5b45ad42013-10-25 00:42:041// Copyright 2013 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.
4
5#ifndef CONTENT_RENDERER_RESIZING_MODE_SELECTOR_H_
6#define CONTENT_RENDERER_RESIZING_MODE_SELECTOR_H_
7
avi1023d012015-12-25 02:39:148#include "base/macros.h"
[email protected]5b45ad42013-10-25 00:42:049
[email protected]5b45ad42013-10-25 00:42:0410namespace content {
11
12class RenderWidget;
fsamuel664e8b62016-01-20 19:54:0113struct ResizeParams;
[email protected]5b45ad42013-10-25 00:42:0414
15// Enables switching between two modes of resizing:
16// 1) The "normal" (asynchronous) resizing, which involves sending messages to
17// and receiving them from host; and
18// 2) The synchronous mode, which short-circuits the resizing logic to operate
19// strictly inside renderer.
20// The latter is necessary to support a handful of layout tests that were
21// written with the expectation of a synchronous resize, and we're going to
22// eventually rewrite or remove all of them. See http://crbug.com/309760 for
23// details.
24class ResizingModeSelector {
25 public:
26 ResizingModeSelector();
[email protected]f7c1f092013-11-05 20:20:5627 bool NeverUsesSynchronousResize() const;
fsamuel664e8b62016-01-20 19:54:0128 bool ShouldAbortOnResize(RenderWidget* widget, const ResizeParams& params);
[email protected]5b45ad42013-10-25 00:42:0429
30 void set_is_synchronous_mode(bool mode);
31 bool is_synchronous_mode() const;
32
33 private:
34 bool is_synchronous_mode_;
35
36 DISALLOW_COPY_AND_ASSIGN(ResizingModeSelector);
37};
38
39} // namespace content
40
41#endif // CONTENT_RENDERER_RESIZING_MODE_SELECTOR_H_