Roll src/third_party/WebKit 06cb9e9:a978ee5 (svn 202558:202559)
[chromium-blink-merge.git] / ui / chromeos / ime / mode_indicator_view.h
blob4a2e962c4328b18a2903003b7fcb93fa176d4ec1
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 UI_CHROMEOS_IME_MODE_INDICATOR_VIEW_H_
6 #define UI_CHROMEOS_IME_MODE_INDICATOR_VIEW_H_
8 #include "base/strings/string16.h"
9 #include "base/timer/timer.h"
10 #include "ui/chromeos/ui_chromeos_export.h"
11 #include "ui/gfx/geometry/rect.h"
12 #include "ui/gfx/native_widget_types.h"
13 #include "ui/views/bubble/bubble_delegate.h"
15 namespace views {
16 class Label;
17 class Widget;
18 } // namespace views
20 namespace ui {
21 namespace ime {
23 class UI_CHROMEOS_EXPORT ModeIndicatorView : public views::BubbleDelegateView {
24 public:
25 ModeIndicatorView(gfx::NativeView parent,
26 const gfx::Rect& cursor_bounds,
27 const base::string16& label);
28 ~ModeIndicatorView() override;
30 // Show the mode indicator then hide with fading animation.
31 void ShowAndFadeOut();
33 // views::BubbleDelegateView override:
34 gfx::Size GetPreferredSize() const override;
36 protected:
37 // views::BubbleDelegateView override:
38 const char* GetClassName() const override;
39 void Init() override;
41 // views::WidgetDelegateView overrides:
42 views::NonClientFrameView* CreateNonClientFrameView(
43 views::Widget* widget) override;
45 private:
46 gfx::Rect cursor_bounds_;
47 views::Label* label_view_;
48 base::OneShotTimer<views::Widget> timer_;
50 DISALLOW_COPY_AND_ASSIGN(ModeIndicatorView);
53 } // namespace ime
54 } // namespace ui
56 #endif // UI_CHROMEOS_IME_MODE_INDICATOR_VIEW_H_