Chromium Code Reviews| 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/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" |
| 16 #include "ui/base/animation/slide_animation.h" | |
|
sadrul
2011/07/15 15:25:48
Forward declaration is generally preferred over in
| |
| 14 #include "views/focus/focus_manager.h" | 17 #include "views/focus/focus_manager.h" |
| 15 | 18 |
| 16 #if defined(OS_CHROMEOS) | 19 #if defined(OS_CHROMEOS) |
| 17 #include "chrome/browser/chromeos/input_method/input_method_manager.h" | 20 #include "chrome/browser/chromeos/input_method/input_method_manager.h" |
| 18 #endif | 21 #endif |
| 19 | 22 |
| 20 class BrowserFrame; | 23 class BrowserFrame; |
| 21 class BrowserView; | 24 class BrowserView; |
| 22 class KeyboardContainerView; | 25 class KeyboardContainerView; |
| 23 class NotificationDetails; | 26 class NotificationDetails; |
| 24 class NotificationSource; | 27 class NotificationSource; |
| 25 | 28 |
| 26 namespace ui { | |
| 27 class SlideAnimation; | |
| 28 } | |
| 29 | |
| 30 class TouchBrowserFrameView | 29 class TouchBrowserFrameView |
| 31 : public OpaqueBrowserFrameView, | 30 : public OpaqueBrowserFrameView, |
| 32 public views::FocusChangeListener, | 31 public views::FocusChangeListener, |
| 33 public TabStripModelObserver, | 32 public TabStripModelObserver, |
| 34 #if defined(OS_CHROMEOS) | 33 #if defined(OS_CHROMEOS) |
| 35 public | 34 public |
| 36 chromeos::input_method::InputMethodManager::VirtualKeyboardObserver, | 35 chromeos::input_method::InputMethodManager::VirtualKeyboardObserver, |
| 37 #endif | 36 #endif |
| 38 public ui::AnimationDelegate { | 37 public ui::AnimationDelegate, |
| 38 public sensors::Listener { | |
| 39 public: | 39 public: |
| 40 enum VirtualKeyboardType { | 40 enum VirtualKeyboardType { |
| 41 NONE, | 41 NONE, |
| 42 GENERIC, | 42 GENERIC, |
| 43 URL, | 43 URL, |
| 44 }; | 44 }; |
| 45 | 45 |
| 46 // Internal class name. | 46 // Internal class name. |
| 47 static const char kViewClassName[]; | 47 static const char kViewClassName[]; |
| 48 | 48 |
| (...skipping 12 matching lines...) Expand all Loading... | |
| 61 views::View* focused_now); | 61 views::View* focused_now); |
| 62 | 62 |
| 63 #if defined(OS_CHROMEOS) | 63 #if defined(OS_CHROMEOS) |
| 64 // input_method::InputMethodManager::VirtualKeyboardObserver implementation. | 64 // input_method::InputMethodManager::VirtualKeyboardObserver implementation. |
| 65 virtual void VirtualKeyboardChanged( | 65 virtual void VirtualKeyboardChanged( |
| 66 chromeos::input_method::InputMethodManager* manager, | 66 chromeos::input_method::InputMethodManager* manager, |
| 67 const chromeos::input_method::VirtualKeyboard& virtual_keyboard, | 67 const chromeos::input_method::VirtualKeyboard& virtual_keyboard, |
| 68 const std::string& virtual_keyboard_layout); | 68 const std::string& virtual_keyboard_layout); |
| 69 #endif | 69 #endif |
| 70 | 70 |
| 71 // sensors::Listener implementation | |
| 72 virtual void OnScreenOrientationChange( | |
| 73 const sensors::ScreenOrientation& change) OVERRIDE; | |
| 74 | |
| 71 protected: | 75 protected: |
| 72 // Overridden from OpaqueBrowserFrameView | 76 // Overridden from OpaqueBrowserFrameView |
| 73 virtual int GetReservedHeight() const; | 77 virtual int GetReservedHeight() const; |
| 74 virtual void ViewHierarchyChanged(bool is_add, View* parent, View* child); | 78 virtual void ViewHierarchyChanged(bool is_add, View* parent, View* child); |
| 75 | 79 |
| 76 private: | 80 private: |
| 77 virtual void InitVirtualKeyboard(); | 81 virtual void InitVirtualKeyboard(); |
| 78 virtual void UpdateKeyboardAndLayout(bool should_show_keyboard); | 82 virtual void UpdateKeyboardAndLayout(bool should_show_keyboard); |
| 79 virtual VirtualKeyboardType DecideKeyboardStateForView(views::View* view); | 83 virtual VirtualKeyboardType DecideKeyboardStateForView(views::View* view); |
| 80 | 84 |
| (...skipping 14 matching lines...) Expand all Loading... | |
| 95 | 99 |
| 96 // Overridden from ui::AnimationDelegate: | 100 // Overridden from ui::AnimationDelegate: |
| 97 virtual void AnimationProgressed(const ui::Animation* animation); | 101 virtual void AnimationProgressed(const ui::Animation* animation); |
| 98 virtual void AnimationEnded(const ui::Animation* animation); | 102 virtual void AnimationEnded(const ui::Animation* animation); |
| 99 | 103 |
| 100 bool keyboard_showing_; | 104 bool keyboard_showing_; |
| 101 int keyboard_height_; | 105 int keyboard_height_; |
| 102 bool focus_listener_added_; | 106 bool focus_listener_added_; |
| 103 KeyboardContainerView* keyboard_; | 107 KeyboardContainerView* keyboard_; |
| 104 NotificationRegistrar registrar_; | 108 NotificationRegistrar registrar_; |
| 109 sensors::ScreenOrientation::Side up_; | |
| 105 | 110 |
| 106 scoped_ptr<ui::SlideAnimation> animation_; | 111 scoped_ptr<ui::SlideAnimation> animation_; |
| 107 | 112 |
| 108 DISALLOW_COPY_AND_ASSIGN(TouchBrowserFrameView); | 113 DISALLOW_COPY_AND_ASSIGN(TouchBrowserFrameView); |
| 109 }; | 114 }; |
| 110 | 115 |
| 111 #endif // CHROME_BROWSER_UI_TOUCH_FRAME_TOUCH_BROWSER_FRAME_VIEW_H_ | 116 #endif // CHROME_BROWSER_UI_TOUCH_FRAME_TOUCH_BROWSER_FRAME_VIEW_H_ |
| OLD | NEW |