1 // Copyright 2014 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.
5 #ifndef ASH_HOST_TRANSFORMER_HELPER_H_
6 #define ASH_HOST_TRANSFORMER_HELPER_H_
8 #include "base/memory/scoped_ptr.h"
17 class AshWindowTreeHost
;
18 class RootWindowTransformer
;
20 // A helper class to handle ash specific feature that requires
21 // transforming a root window (such as rotation, UI zooming).
22 class TransformerHelper
{
24 explicit TransformerHelper(AshWindowTreeHost
* ash_host
);
27 // Initializes the transformer with identity transform.
30 // Returns the the insets that specifies the effective root window
31 // area within the host window.
32 gfx::Insets
GetHostInsets() const;
34 // Sets a simple transform with no host insets.
35 void SetTransform(const gfx::Transform
& transform
);
37 // Sets a RootWindowTransformer which takes the insets into account.
38 void SetRootWindowTransformer(scoped_ptr
<RootWindowTransformer
> transformer
);
40 // Returns the transforms applied to the root window.
41 gfx::Transform
GetTransform() const;
42 gfx::Transform
GetInverseTransform() const;
44 // Updates the root window size based on the host size and
46 void UpdateWindowSize(const gfx::Size
& host_size
);
49 AshWindowTreeHost
* ash_host_
;
50 scoped_ptr
<RootWindowTransformer
> transformer_
;
52 DISALLOW_COPY_AND_ASSIGN(TransformerHelper
);
57 #endif // ASH_HOST_TRANSFORMER_HELPER_H_