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

Side by Side Diff: chrome/browser/chromeos/login/touch_login_view.h

Issue 7302015: A keyboard widget that manages itself (the animation and all that). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: merge with trunk Created 9 years, 4 months 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | chrome/browser/chromeos/login/touch_login_view.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2011 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.
4
5 #ifndef CHROME_BROWSER_CHROMEOS_LOGIN_TOUCH_LOGIN_VIEW_H_
6 #define CHROME_BROWSER_CHROMEOS_LOGIN_TOUCH_LOGIN_VIEW_H_
7 #pragma once
8
9 #include "chrome/browser/chromeos/login/webui_login_view.h"
10 #include "content/common/notification_observer.h"
11 #include "content/common/notification_registrar.h"
12 #include "ui/base/animation/animation_delegate.h"
13 #include "views/focus/focus_manager.h"
14
15 class KeyboardContainerView;
16 class NotificationDetails;
17 class NotificationSource;
18
19 namespace ui {
20 class SlideAnimation;
21 }
22
23 namespace chromeos {
24
25 // Subclass of the WebUILoginView. This view adds in support for a virtual
26 // keyboard, which appears and disappears depending if text areas have
27 // focus. This is only build in TOUCH_UI enabled builds.
28 class TouchLoginView : public WebUILoginView,
29 public views::FocusChangeListener,
30 public NotificationObserver,
31 public ui::AnimationDelegate {
32 public:
33 enum VirtualKeyboardType {
34 NONE,
35 GENERIC,
36 URL,
37 };
38
39 TouchLoginView();
40 virtual ~TouchLoginView();
41
42 // Overriden from WebUILoginView:
43 virtual void Init() OVERRIDE;
44
45 // Overriden from views::Views:
46 virtual std::string GetClassName() const OVERRIDE;
47
48 // Overridden from views::FocusChangeListener:
49 virtual void FocusWillChange(views::View* focused_before,
50 views::View* focused_now) OVERRIDE;
51
52 // Overridden from chromeos::WebUILoginView:
53 virtual void OnWindowCreated() OVERRIDE;
54
55 protected:
56 // Overridden from views::View:
57 virtual void Layout() OVERRIDE;
58
59 // Overridden from chromeos::WebUILoginView:
60 virtual void InitStatusArea() OVERRIDE;
61
62 private:
63 void InitVirtualKeyboard();
64 void UpdateKeyboardAndLayout(bool should_show_keyboard);
65 VirtualKeyboardType DecideKeyboardStateForView(views::View* view);
66
67 // Overridden from NotificationObserver.
68 virtual void Observe(int type,
69 const NotificationSource& source,
70 const NotificationDetails& details) OVERRIDE;
71
72 // Overridden from ui::AnimationDelegate:
73 virtual void AnimationProgressed(const ui::Animation* animation) OVERRIDE;
74 virtual void AnimationEnded(const ui::Animation* animation) OVERRIDE;
75
76 bool keyboard_showing_;
77 int keyboard_height_;
78 bool focus_listener_added_;
79 KeyboardContainerView* keyboard_;
80 NotificationRegistrar registrar_;
81
82 scoped_ptr<ui::SlideAnimation> animation_;
83
84 DISALLOW_COPY_AND_ASSIGN(TouchLoginView);
85 };
86
87 } // namespace chromeos
88
89 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_TOUCH_LOGIN_VIEW_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/chromeos/login/touch_login_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698