Index: chrome/browser/chromeos/input_method/mode_indicator_delegate_view.h |
diff --git a/chrome/browser/chromeos/input_method/mode_indicator_delegate_view.h b/chrome/browser/chromeos/input_method/mode_indicator_delegate_view.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..223c7efc5fb77da17a4868c551889d2824b0201c |
--- /dev/null |
+++ b/chrome/browser/chromeos/input_method/mode_indicator_delegate_view.h |
@@ -0,0 +1,49 @@ |
+// Copyright 2013 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 CHROME_BROWSER_CHROMEOS_INPUT_METHOD_MODE_INDICATOR_DELEGATE_VIEW_H_ |
+#define CHROME_BROWSER_CHROMEOS_INPUT_METHOD_MODE_INDICATOR_DELEGATE_VIEW_H_ |
+ |
+#include "base/strings/string16.h" |
+#include "base/timer/timer.h" |
+#include "ui/gfx/rect.h" |
+#include "ui/views/bubble/bubble_delegate.h" |
+ |
+namespace views { |
+class Label; |
+} // namespace views |
+ |
+namespace chromeos { |
+namespace input_method { |
+ |
+class ModeIndicatorDelegateView : public views::BubbleDelegateView { |
+ public: |
+ ModeIndicatorDelegateView(const gfx::Rect& cursor_bounds, |
+ const string16& label); |
+ virtual ~ModeIndicatorDelegateView(); |
+ |
+ // 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; |
+ |
+ private: |
+ // Hide the window with fading animation. This is called from |
+ // ShowAndFadeOut. |
+ void FadeOut(); |
+ |
+ gfx::Rect cursor_bounds_; |
+ views::Label* label_view_; |
+ base::OneShotTimer<ModeIndicatorDelegateView> timer_; |
+}; |
+ |
+} // namespace input_method |
+} // namespace chromeos |
+ |
+#endif // CHROME_BROWSER_CHROMEOS_INPUT_METHOD_MODE_INDICATOR_DELEGATE_VIEW_H_ |