blob: 7a95ea1f5312e7036e5da63785141fad1a5c8fcc (
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
|
// 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 ASH_IME_MODE_INDICATOR_VIEW_H_
#define ASH_IME_MODE_INDICATOR_VIEW_H_
#include "ash/ash_export.h"
#include "base/strings/string16.h"
#include "base/timer/timer.h"
#include "ui/gfx/native_widget_types.h"
#include "ui/gfx/rect.h"
#include "ui/views/bubble/bubble_delegate.h"
namespace views {
class Label;
} // namespace views
namespace ash {
namespace ime {
class ASH_EXPORT ModeIndicatorView : public views::BubbleDelegateView {
public:
ModeIndicatorView(gfx::NativeView parent,
const gfx::Rect& cursor_bounds,
const base::string16& label);
virtual ~ModeIndicatorView();
// Show the mode indicator then hide with fading animation.
void ShowAndFadeOut();
// views::BubbleDelegateView override:
virtual gfx::Size GetPreferredSize() OVERRIDE;
protected:
// views::BubbleDelegateView override:
virtual void Init() OVERRIDE;
// views::WidgetDelegateView overrides:
virtual views::NonClientFrameView* CreateNonClientFrameView(
views::Widget* widget) OVERRIDE;
private:
// Hide the window with fading animation. This is called from
// ShowAndFadeOut.
void FadeOut();
gfx::Rect cursor_bounds_;
views::Label* label_view_;
base::OneShotTimer<ModeIndicatorView> timer_;
};
} // namespace ime
} // namespace ash
#endif // ASH_IME_MODE_INDICATOR_VIEW_H_
|