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