Pass resources to dependents as zip files instead of directories
[chromium-blink-merge.git] / ash / host / ash_window_tree_host_ozone.cc
blob6fd0b26cd647a89753c8cbe116548926af2f1f83
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 #include "ash/host/ash_window_tree_host.h"
7 #include "ash/host/ash_window_tree_host_init_params.h"
8 #include "ash/host/root_window_transformer.h"
9 #include "ash/host/transformer_helper.h"
10 #include "base/command_line.h"
11 #include "ui/aura/window_tree_host_ozone.h"
12 #include "ui/gfx/geometry/insets.h"
13 #include "ui/gfx/transform.h"
15 namespace ash {
16 namespace {
18 class AshWindowTreeHostOzone : public AshWindowTreeHost,
19 public aura::WindowTreeHostOzone {
20 public:
21 explicit AshWindowTreeHostOzone(const gfx::Rect& initial_bounds);
22 virtual ~AshWindowTreeHostOzone();
24 private:
25 // AshWindowTreeHost:
26 virtual void ToggleFullScreen() OVERRIDE;
27 virtual bool ConfineCursorToRootWindow() OVERRIDE;
28 virtual void UnConfineCursor() OVERRIDE;
29 virtual void SetRootWindowTransformer(
30 scoped_ptr<RootWindowTransformer> transformer) OVERRIDE;
31 virtual gfx::Insets GetHostInsets() const OVERRIDE;
32 virtual aura::WindowTreeHost* AsWindowTreeHost() OVERRIDE;
33 virtual void SetRootTransform(const gfx::Transform& transform) OVERRIDE;
34 virtual gfx::Transform GetRootTransform() const OVERRIDE;
35 virtual gfx::Transform GetInverseRootTransform() const OVERRIDE;
36 virtual void UpdateRootWindowSize(const gfx::Size& host_size) OVERRIDE;
38 TransformerHelper transformer_helper_;
40 DISALLOW_COPY_AND_ASSIGN(AshWindowTreeHostOzone);
43 AshWindowTreeHostOzone::AshWindowTreeHostOzone(const gfx::Rect& initial_bounds)
44 : aura::WindowTreeHostOzone(initial_bounds),
45 transformer_helper_(this) {}
47 AshWindowTreeHostOzone::~AshWindowTreeHostOzone() {}
49 void AshWindowTreeHostOzone::ToggleFullScreen() {
50 NOTIMPLEMENTED();
53 bool AshWindowTreeHostOzone::ConfineCursorToRootWindow() {
54 return false;
57 void AshWindowTreeHostOzone::UnConfineCursor() {
58 NOTIMPLEMENTED();
61 void AshWindowTreeHostOzone::SetRootWindowTransformer(
62 scoped_ptr<RootWindowTransformer> transformer) {
63 transformer_helper_.SetRootWindowTransformer(transformer.Pass());
66 gfx::Insets AshWindowTreeHostOzone::GetHostInsets() const {
67 return transformer_helper_.GetHostInsets();
70 aura::WindowTreeHost* AshWindowTreeHostOzone::AsWindowTreeHost() {
71 return this;
74 void AshWindowTreeHostOzone::SetRootTransform(const gfx::Transform& transform) {
75 transformer_helper_.GetTransform();
78 gfx::Transform AshWindowTreeHostOzone::GetRootTransform() const {
79 return transformer_helper_.GetTransform();
82 gfx::Transform AshWindowTreeHostOzone::GetInverseRootTransform() const {
83 return transformer_helper_.GetInverseTransform();
86 void AshWindowTreeHostOzone::UpdateRootWindowSize(const gfx::Size& host_size) {
87 transformer_helper_.UpdateWindowSize(host_size);
90 } // namespace
92 AshWindowTreeHost* AshWindowTreeHost::Create(
93 const AshWindowTreeHostInitParams& init_params) {
94 return new AshWindowTreeHostOzone(init_params.initial_bounds);
97 } // namespace ash