OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 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 | 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 CONTENT_RENDERER_RESIZING_MODE_SELECTOR_H_ | 5 #ifndef CONTENT_RENDERER_RESIZING_MODE_SELECTOR_H_ |
6 #define CONTENT_RENDERER_RESIZING_MODE_SELECTOR_H_ | 6 #define CONTENT_RENDERER_RESIZING_MODE_SELECTOR_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 | 9 |
10 struct ViewMsg_Resize_Params; | 10 struct ViewMsg_Resize_Params; |
11 | 11 |
12 namespace content { | 12 namespace content { |
13 | 13 |
14 class RenderWidget; | 14 class RenderWidget; |
15 | 15 |
16 // Enables switching between two modes of resizing: | 16 // Enables switching between two modes of resizing: |
17 // 1) The "normal" (asynchronous) resizing, which involves sending messages to | 17 // 1) The "normal" (asynchronous) resizing, which involves sending messages to |
18 // and receiving them from host; and | 18 // and receiving them from host; and |
19 // 2) The synchronous mode, which short-circuits the resizing logic to operate | 19 // 2) The synchronous mode, which short-circuits the resizing logic to operate |
20 // strictly inside renderer. | 20 // strictly inside renderer. |
21 // The latter is necessary to support a handful of layout tests that were | 21 // The latter is necessary to support a handful of layout tests that were |
22 // written with the expectation of a synchronous resize, and we're going to | 22 // written with the expectation of a synchronous resize, and we're going to |
23 // eventually rewrite or remove all of them. See http://crbug.com/309760 for | 23 // eventually rewrite or remove all of them. See http://crbug.com/309760 for |
24 // details. | 24 // details. |
25 class ResizingModeSelector { | 25 class ResizingModeSelector { |
26 public: | 26 public: |
27 ResizingModeSelector(); | 27 ResizingModeSelector(); |
28 | 28 bool NeverUsesSynchronousResize() const; |
29 bool ShouldAbortOnResize(RenderWidget* widget, | 29 bool ShouldAbortOnResize(RenderWidget* widget, |
30 const ViewMsg_Resize_Params& params); | 30 const ViewMsg_Resize_Params& params); |
31 | 31 |
32 void set_is_synchronous_mode(bool mode); | 32 void set_is_synchronous_mode(bool mode); |
33 bool is_synchronous_mode() const; | 33 bool is_synchronous_mode() const; |
34 | 34 |
35 private: | 35 private: |
36 bool is_synchronous_mode_; | 36 bool is_synchronous_mode_; |
37 | 37 |
38 DISALLOW_COPY_AND_ASSIGN(ResizingModeSelector); | 38 DISALLOW_COPY_AND_ASSIGN(ResizingModeSelector); |
39 }; | 39 }; |
40 | 40 |
41 } // namespace content | 41 } // namespace content |
42 | 42 |
43 #endif // CONTENT_RENDERER_RESIZING_MODE_SELECTOR_H_ | 43 #endif // CONTENT_RENDERER_RESIZING_MODE_SELECTOR_H_ |
OLD | NEW |