summaryrefslogtreecommitdiffstats
path: root/athena/screen/screen_manager_impl.h
blob: 17385428a9c9a6a4f3d34fd0c2790ed8136c2a9b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
// Copyright 2014 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 ATHENA_SCREEN_SCREEN_MANAGER_IMPL_H_
#define ATHENA_SCREEN_SCREEN_MANAGER_IMPL_H_

#include "athena/athena_export.h"
#include "athena/screen/public/screen_manager.h"
#include "base/memory/scoped_ptr.h"
#include "ui/aura/client/window_tree_client.h"

namespace aura {
namespace client {
class FocusClient;
class ScreenPositionClient;
}
}

namespace wm {
class ScopedCaptureClient;
}

namespace athena {
class AcceleratorHandler;

class ATHENA_EXPORT ScreenManagerImpl : public ScreenManager,
                                        public aura::client::WindowTreeClient {
 public:
  explicit ScreenManagerImpl(aura::Window* root_window);
  virtual ~ScreenManagerImpl();

  void Init();

  // Returns a container which has |priority|. Null if such container
  // doesn't exist.
  aura::Window* FindContainerByPriority(int priority);

 private:
  // ScreenManager:
  virtual aura::Window* CreateContainer(const ContainerParams& params) override;
  virtual aura::Window* GetContext() override;
  virtual void SetRotation(gfx::Display::Rotation rotation) override;
  virtual void SetRotationLocked(bool rotation_locked) override;

  // aura::client::WindowTreeClient:
  virtual aura::Window* GetDefaultParent(aura::Window* context,
                                         aura::Window* window,
                                         const gfx::Rect& bounds) override;

  int GetModalContainerPriority(aura::Window* window, aura::Window* parent);

  // Returns a container with |params.default_parent| == true.
  aura::Window* GetDefaultContainer();

  // Not owned.
  aura::Window* root_window_;

  scoped_ptr<aura::client::FocusClient> focus_client_;
  scoped_ptr<AcceleratorHandler> accelerator_handler_;
  scoped_ptr<::wm::ScopedCaptureClient> capture_client_;
  scoped_ptr<aura::client::ScreenPositionClient> screen_position_client_;

  gfx::Display::Rotation last_requested_rotation_;
  bool rotation_locked_;

  DISALLOW_COPY_AND_ASSIGN(ScreenManagerImpl);
};

}  // namespace athena

#endif  // ATHENA_SCREEN_SCREEN_MANAGER_IMPL_H_