| 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_UI_TOUCH_FRAME_TOUCH_BROWSER_FRAME_VIEW_H_ | 5 #ifndef CHROME_BROWSER_UI_TOUCH_FRAME_TOUCH_BROWSER_FRAME_VIEW_H_ |
| 6 #define CHROME_BROWSER_UI_TOUCH_FRAME_TOUCH_BROWSER_FRAME_VIEW_H_ | 6 #define CHROME_BROWSER_UI_TOUCH_FRAME_TOUCH_BROWSER_FRAME_VIEW_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include "chrome/browser/tabs/tab_strip_model_observer.h" | 9 #include "chrome/browser/tabs/tab_strip_model_observer.h" |
| 10 #include "chrome/browser/ui/views/frame/opaque_browser_frame_view.h" | 10 #include "chrome/browser/ui/views/frame/opaque_browser_frame_view.h" |
| 11 #include "content/browser/sensors/sensors_provider.h" |
| 11 #include "content/common/notification_observer.h" | 12 #include "content/common/notification_observer.h" |
| 12 #include "content/common/notification_registrar.h" | 13 #include "content/common/notification_registrar.h" |
| 14 #include "content/common/sensors.h" |
| 13 #include "ui/base/animation/animation_delegate.h" | 15 #include "ui/base/animation/animation_delegate.h" |
| 14 #include "views/focus/focus_manager.h" | 16 #include "views/focus/focus_manager.h" |
| 15 | 17 |
| 16 #if defined(OS_CHROMEOS) | 18 #if defined(OS_CHROMEOS) |
| 17 #include "chrome/browser/chromeos/input_method/input_method_manager.h" | 19 #include "chrome/browser/chromeos/input_method/input_method_manager.h" |
| 18 #endif | 20 #endif |
| 19 | 21 |
| 20 class BrowserFrame; | 22 class BrowserFrame; |
| 21 class BrowserView; | 23 class BrowserView; |
| 22 class KeyboardContainerView; | 24 class KeyboardContainerView; |
| 23 class NotificationDetails; | 25 class NotificationDetails; |
| 24 class NotificationSource; | 26 class NotificationSource; |
| 25 | 27 |
| 26 namespace ui { | 28 namespace ui { |
| 27 class SlideAnimation; | 29 class SlideAnimation; |
| 28 } | 30 } |
| 29 | 31 |
| 30 class TouchBrowserFrameView | 32 class TouchBrowserFrameView |
| 31 : public OpaqueBrowserFrameView, | 33 : public OpaqueBrowserFrameView, |
| 32 public views::FocusChangeListener, | 34 public views::FocusChangeListener, |
| 33 public TabStripModelObserver, | 35 public TabStripModelObserver, |
| 34 #if defined(OS_CHROMEOS) | 36 #if defined(OS_CHROMEOS) |
| 35 public | 37 public |
| 36 chromeos::input_method::InputMethodManager::VirtualKeyboardObserver, | 38 chromeos::input_method::InputMethodManager::VirtualKeyboardObserver, |
| 37 #endif | 39 #endif |
| 38 public ui::AnimationDelegate { | 40 public ui::AnimationDelegate, |
| 41 public sensors::Listener { |
| 39 public: | 42 public: |
| 40 enum VirtualKeyboardType { | 43 enum VirtualKeyboardType { |
| 41 NONE, | 44 NONE, |
| 42 GENERIC, | 45 GENERIC, |
| 43 URL, | 46 URL, |
| 44 }; | 47 }; |
| 45 | 48 |
| 46 // Internal class name. | 49 // Internal class name. |
| 47 static const char kViewClassName[]; | 50 static const char kViewClassName[]; |
| 48 | 51 |
| (...skipping 12 matching lines...) Expand all Loading... |
| 61 views::View* focused_now); | 64 views::View* focused_now); |
| 62 | 65 |
| 63 #if defined(OS_CHROMEOS) | 66 #if defined(OS_CHROMEOS) |
| 64 // input_method::InputMethodManager::VirtualKeyboardObserver implementation. | 67 // input_method::InputMethodManager::VirtualKeyboardObserver implementation. |
| 65 virtual void VirtualKeyboardChanged( | 68 virtual void VirtualKeyboardChanged( |
| 66 chromeos::input_method::InputMethodManager* manager, | 69 chromeos::input_method::InputMethodManager* manager, |
| 67 const chromeos::input_method::VirtualKeyboard& virtual_keyboard, | 70 const chromeos::input_method::VirtualKeyboard& virtual_keyboard, |
| 68 const std::string& virtual_keyboard_layout); | 71 const std::string& virtual_keyboard_layout); |
| 69 #endif | 72 #endif |
| 70 | 73 |
| 74 // sensors::Listener implementation |
| 75 virtual void OnScreenOrientationChanged( |
| 76 const sensors::ScreenOrientation& change) OVERRIDE; |
| 77 |
| 71 protected: | 78 protected: |
| 72 // Overridden from OpaqueBrowserFrameView | 79 // Overridden from OpaqueBrowserFrameView |
| 73 virtual int GetReservedHeight() const; | 80 virtual int GetReservedHeight() const; |
| 74 virtual void ViewHierarchyChanged(bool is_add, View* parent, View* child); | 81 virtual void ViewHierarchyChanged(bool is_add, View* parent, View* child); |
| 75 | 82 |
| 76 private: | 83 private: |
| 77 virtual void InitVirtualKeyboard(); | 84 virtual void InitVirtualKeyboard(); |
| 78 virtual void UpdateKeyboardAndLayout(bool should_show_keyboard); | 85 virtual void UpdateKeyboardAndLayout(bool should_show_keyboard); |
| 79 virtual VirtualKeyboardType DecideKeyboardStateForView(views::View* view); | 86 virtual VirtualKeyboardType DecideKeyboardStateForView(views::View* view); |
| 80 | 87 |
| (...skipping 15 matching lines...) Expand all Loading... |
| 96 // Overridden from ui::AnimationDelegate: | 103 // Overridden from ui::AnimationDelegate: |
| 97 virtual void AnimationProgressed(const ui::Animation* animation); | 104 virtual void AnimationProgressed(const ui::Animation* animation); |
| 98 virtual void AnimationEnded(const ui::Animation* animation); | 105 virtual void AnimationEnded(const ui::Animation* animation); |
| 99 | 106 |
| 100 bool keyboard_showing_; | 107 bool keyboard_showing_; |
| 101 int keyboard_height_; | 108 int keyboard_height_; |
| 102 bool focus_listener_added_; | 109 bool focus_listener_added_; |
| 103 KeyboardContainerView* keyboard_; | 110 KeyboardContainerView* keyboard_; |
| 104 NotificationRegistrar registrar_; | 111 NotificationRegistrar registrar_; |
| 105 | 112 |
| 113 // the degrees the frame is rotated. |
| 114 int degrees_; |
| 115 |
| 106 scoped_ptr<ui::SlideAnimation> animation_; | 116 scoped_ptr<ui::SlideAnimation> animation_; |
| 107 | 117 |
| 108 DISALLOW_COPY_AND_ASSIGN(TouchBrowserFrameView); | 118 DISALLOW_COPY_AND_ASSIGN(TouchBrowserFrameView); |
| 109 }; | 119 }; |
| 110 | 120 |
| 111 #endif // CHROME_BROWSER_UI_TOUCH_FRAME_TOUCH_BROWSER_FRAME_VIEW_H_ | 121 #endif // CHROME_BROWSER_UI_TOUCH_FRAME_TOUCH_BROWSER_FRAME_VIEW_H_ |
| OLD | NEW |