
I had to add a RenderViewVisitor to ensure that all secondary windows get their resize mode values applied properly, but other than that, this is a simple flipping-the-flag type of thing. BUG=309760 R=jam Review URL: https://codereview.chromium.org/53493003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@233069 0039d316-1c4b-4281-b951-d872f2087c98
44 lines
1.3 KiB
C++
44 lines
1.3 KiB
C++
// Copyright 2013 The Chromium Authors. All rights reserved.
|
|
// Use of this source code is governed by a BSD-style license that can be
|
|
// found in the LICENSE file.
|
|
|
|
#ifndef CONTENT_RENDERER_RESIZING_MODE_SELECTOR_H_
|
|
#define CONTENT_RENDERER_RESIZING_MODE_SELECTOR_H_
|
|
|
|
#include "base/basictypes.h"
|
|
|
|
struct ViewMsg_Resize_Params;
|
|
|
|
namespace content {
|
|
|
|
class RenderWidget;
|
|
|
|
// Enables switching between two modes of resizing:
|
|
// 1) The "normal" (asynchronous) resizing, which involves sending messages to
|
|
// and receiving them from host; and
|
|
// 2) The synchronous mode, which short-circuits the resizing logic to operate
|
|
// strictly inside renderer.
|
|
// The latter is necessary to support a handful of layout tests that were
|
|
// written with the expectation of a synchronous resize, and we're going to
|
|
// eventually rewrite or remove all of them. See http://crbug.com/309760 for
|
|
// details.
|
|
class ResizingModeSelector {
|
|
public:
|
|
ResizingModeSelector();
|
|
bool NeverUsesSynchronousResize() const;
|
|
bool ShouldAbortOnResize(RenderWidget* widget,
|
|
const ViewMsg_Resize_Params& params);
|
|
|
|
void set_is_synchronous_mode(bool mode);
|
|
bool is_synchronous_mode() const;
|
|
|
|
private:
|
|
bool is_synchronous_mode_;
|
|
|
|
DISALLOW_COPY_AND_ASSIGN(ResizingModeSelector);
|
|
};
|
|
|
|
} // namespace content
|
|
|
|
#endif // CONTENT_RENDERER_RESIZING_MODE_SELECTOR_H_
|