Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(499)

Unified Diff: chrome/browser/chromeos/input_method/mode_indicator_delegate_view.h

Issue 98703003: Mode Indicator using BubbleDelegateView. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added comment about offscreen handling. Created 7 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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_

Powered by Google App Engine
This is Rietveld 408576698