[email protected] | 5b45ad4 | 2013-10-25 00:42:04 | [diff] [blame] | 1 | // 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 | |
avi | 1023d01 | 2015-12-25 02:39:14 | [diff] [blame] | 8 | #include "base/macros.h" |
[email protected] | 5b45ad4 | 2013-10-25 00:42:04 | [diff] [blame] | 9 | |
[email protected] | 5b45ad4 | 2013-10-25 00:42:04 | [diff] [blame] | 10 | namespace content { |
| 11 | |
| 12 | class RenderWidget; |
fsamuel | 664e8b6 | 2016-01-20 19:54:01 | [diff] [blame] | 13 | struct ResizeParams; |
[email protected] | 5b45ad4 | 2013-10-25 00:42:04 | [diff] [blame] | 14 | |
| 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. |
| 24 | class ResizingModeSelector { |
| 25 | public: |
| 26 | ResizingModeSelector(); |
[email protected] | f7c1f09 | 2013-11-05 20:20:56 | [diff] [blame] | 27 | bool NeverUsesSynchronousResize() const; |
fsamuel | 664e8b6 | 2016-01-20 19:54:01 | [diff] [blame] | 28 | bool ShouldAbortOnResize(RenderWidget* widget, const ResizeParams& params); |
[email protected] | 5b45ad4 | 2013-10-25 00:42:04 | [diff] [blame] | 29 | |
| 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_ |