1 // Copyright (c) 2012 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 CHROME_BROWSER_CHROMEOS_INPUT_METHOD_DELAYABLE_WIDGET_H_
6 #define CHROME_BROWSER_CHROMEOS_INPUT_METHOD_DELAYABLE_WIDGET_H_
8 #include "base/timer/timer.h"
9 #include "ui/views/widget/widget.h"
12 namespace input_method {
14 // This class implements widget which can show/hide with given delay.
15 class DelayableWidget : public views::Widget {
18 virtual ~DelayableWidget();
21 virtual void Show() OVERRIDE;
23 // Shows window after |milliseconds| milli secs. This function can be called
24 // in the DelayShow/DelayHide delay duration. In such case, previous operation
26 void DelayShow(unsigned int milliseconds);
31 // Hides window after |milliseconds| milli secs. This function can be called
32 // in the DelayShow/DelayHide delay duration. In such case, previous operation
34 void DelayHide(unsigned int milliseconds);
37 base::OneShotTimer<DelayableWidget> show_hide_timer_;
39 DISALLOW_COPY_AND_ASSIGN(DelayableWidget);
42 } // namespace input_method
43 } // namespace chromeos
45 #endif // CHROME_BROWSER_CHROMEOS_INPUT_METHOD_DELAYABLE_WIDGET_H_