| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CHROME_BROWSER_CHROMEOS_LOGIN_TOUCH_LOGIN_VIEW_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_LOGIN_TOUCH_LOGIN_VIEW_H_ |
| 6 #define CHROME_BROWSER_CHROMEOS_LOGIN_TOUCH_LOGIN_VIEW_H_ | 6 #define CHROME_BROWSER_CHROMEOS_LOGIN_TOUCH_LOGIN_VIEW_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include "chrome/browser/chromeos/login/webui_login_view.h" | 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 | 10 |
| 23 namespace chromeos { | 11 namespace chromeos { |
| 24 | 12 |
| 25 // Subclass of the WebUILoginView. This view adds in support for a virtual | 13 // Subclass of the WebUILoginView. This view adds in support for a virtual |
| 26 // keyboard, which appears and disappears depending if text areas have | 14 // keyboard, which appears and disappears depending if text areas have |
| 27 // focus. This is only build in TOUCH_UI enabled builds. | 15 // focus. This is only build in TOUCH_UI enabled builds. |
| 28 class TouchLoginView : public WebUILoginView, | 16 class TouchLoginView : public WebUILoginView { |
| 29 public views::FocusChangeListener, | |
| 30 public NotificationObserver, | |
| 31 public ui::AnimationDelegate { | |
| 32 public: | 17 public: |
| 33 enum VirtualKeyboardType { | |
| 34 NONE, | |
| 35 GENERIC, | |
| 36 URL, | |
| 37 }; | |
| 38 | |
| 39 TouchLoginView(); | 18 TouchLoginView(); |
| 40 virtual ~TouchLoginView(); | 19 virtual ~TouchLoginView(); |
| 41 | 20 |
| 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 protected: | |
| 53 // Overridden from views::View: | |
| 54 virtual void Layout() OVERRIDE; | |
| 55 | |
| 56 private: | 21 private: |
| 57 void InitVirtualKeyboard(); | |
| 58 void UpdateKeyboardAndLayout(bool should_show_keyboard); | |
| 59 VirtualKeyboardType DecideKeyboardStateForView(views::View* view); | |
| 60 | |
| 61 // Overridden from NotificationObserver. | |
| 62 virtual void Observe(NotificationType type, | |
| 63 const NotificationSource& source, | |
| 64 const NotificationDetails& details) OVERRIDE; | |
| 65 | |
| 66 // Overridden from ui::AnimationDelegate: | |
| 67 virtual void AnimationProgressed(const ui::Animation* animation) OVERRIDE; | |
| 68 virtual void AnimationEnded(const ui::Animation* animation) OVERRIDE; | |
| 69 | |
| 70 bool keyboard_showing_; | |
| 71 int keyboard_height_; | |
| 72 bool focus_listener_added_; | |
| 73 KeyboardContainerView* keyboard_; | |
| 74 NotificationRegistrar registrar_; | |
| 75 | |
| 76 scoped_ptr<ui::SlideAnimation> animation_; | |
| 77 | 22 |
| 78 DISALLOW_COPY_AND_ASSIGN(TouchLoginView); | 23 DISALLOW_COPY_AND_ASSIGN(TouchLoginView); |
| 79 }; | 24 }; |
| 80 | 25 |
| 81 } // namespace chromeos | 26 } // namespace chromeos |
| 82 | 27 |
| 83 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_TOUCH_LOGIN_VIEW_H_ | 28 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_TOUCH_LOGIN_VIEW_H_ |
| OLD | NEW |