blob: 6f2f43a6afb5393e9a4474d92d00eb535e8604b5 [file] [log] [blame]
Yuichiro Hanadafe5239c2018-07-17 09:59:521// Copyright 2018 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.
4
5#ifndef COMPONENTS_EXO_INPUT_METHOD_SURFACE_H_
6#define COMPONENTS_EXO_INPUT_METHOD_SURFACE_H_
7
8#include "base/macros.h"
9#include "components/exo/client_controlled_shell_surface.h"
10#include "components/exo/surface_delegate.h"
11#include "components/exo/surface_observer.h"
12
13namespace exo {
14
15class InputMethodSurfaceManager;
16
17// Handles input method surface role of a given surface.
18class InputMethodSurface : public ClientControlledShellSurface {
19 public:
20 InputMethodSurface(InputMethodSurfaceManager* manager,
21 Surface* surface,
Prabir Pradhan875083e2020-07-22 20:06:2722 bool default_scale_cancellation);
Yuichiro Hanadafe5239c2018-07-17 09:59:5223 ~InputMethodSurface() override;
24
Yuki Awano35a19bd2018-12-12 01:35:0525 static exo::InputMethodSurface* GetInputMethodSurface();
26
Yuichiro Hanadafe5239c2018-07-17 09:59:5227 // Overridden from SurfaceDelegate:
28 void OnSurfaceCommit() override;
29
Tetsui Ohkubo57fcf732020-02-10 03:09:1030 // Overridden from ShellSurfaceBase:
31 void SetWidgetBounds(const gfx::Rect& bounds) override;
32
Yuichiro Hanadadc02dd32018-09-13 03:09:0633 gfx::Rect GetBounds() const;
34
Yuichiro Hanadafe5239c2018-07-17 09:59:5235 private:
36 InputMethodSurfaceManager* const manager_;
37 bool added_to_manager_ = false;
Yuichiro Hanada5eb4d2622019-01-30 01:32:1538 // The bounds of this surface in DIP.
Yuichiro Hanadadc02dd32018-09-13 03:09:0639 gfx::Rect input_method_bounds_;
Yuichiro Hanadafe5239c2018-07-17 09:59:5240
41 DISALLOW_COPY_AND_ASSIGN(InputMethodSurface);
42};
43
44} // namespace exo
45
46#endif // COMPONENTS_EXO_INPUT_METHOD_SURFACE_H_