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 |
33 namespace views { | |
34 class LayerPropertySetter; | |
35 } | |
36 | |
31 class TouchBrowserFrameView | 37 class TouchBrowserFrameView |
32 : public OpaqueBrowserFrameView, | 38 : public OpaqueBrowserFrameView, |
33 public views::FocusChangeListener, | 39 public views::FocusChangeListener, |
34 public TabStripModelObserver, | 40 public TabStripModelObserver, |
35 #if defined(OS_CHROMEOS) | 41 #if defined(OS_CHROMEOS) |
36 public | 42 public |
37 chromeos::input_method::InputMethodManager::VirtualKeyboardObserver, | 43 chromeos::input_method::InputMethodManager::VirtualKeyboardObserver, |
38 #endif | 44 #endif |
39 public ui::AnimationDelegate { | 45 public ui::AnimationDelegate, |
46 public sensors::Listener { | |
40 public: | 47 public: |
41 enum VirtualKeyboardType { | 48 enum VirtualKeyboardType { |
42 NONE, | 49 NONE, |
43 GENERIC, | 50 GENERIC, |
44 URL, | 51 URL, |
45 }; | 52 }; |
46 | 53 |
47 // Internal class name. | 54 // Internal class name. |
48 static const char kViewClassName[]; | 55 static const char kViewClassName[]; |
49 | 56 |
(...skipping 13 matching lines...) Expand all Loading... | |
63 views::View* focused_now); | 70 views::View* focused_now); |
64 | 71 |
65 #if defined(OS_CHROMEOS) | 72 #if defined(OS_CHROMEOS) |
66 // input_method::InputMethodManager::VirtualKeyboardObserver implementation. | 73 // input_method::InputMethodManager::VirtualKeyboardObserver implementation. |
67 virtual void VirtualKeyboardChanged( | 74 virtual void VirtualKeyboardChanged( |
68 chromeos::input_method::InputMethodManager* manager, | 75 chromeos::input_method::InputMethodManager* manager, |
69 const chromeos::input_method::VirtualKeyboard& virtual_keyboard, | 76 const chromeos::input_method::VirtualKeyboard& virtual_keyboard, |
70 const std::string& virtual_keyboard_layout); | 77 const std::string& virtual_keyboard_layout); |
71 #endif | 78 #endif |
72 | 79 |
80 // sensors::Listener implementation | |
81 virtual void OnScreenOrientationChanged( | |
82 const sensors::ScreenOrientation& change) OVERRIDE; | |
83 | |
73 protected: | 84 protected: |
74 // Overridden from OpaqueBrowserFrameView | 85 // Overridden from OpaqueBrowserFrameView |
75 virtual int GetReservedHeight() const; | 86 virtual int GetReservedHeight() const; |
76 virtual void ViewHierarchyChanged(bool is_add, View* parent, View* child); | 87 virtual void ViewHierarchyChanged(bool is_add, View* parent, View* child); |
77 | 88 |
78 private: | 89 private: |
79 virtual void InitVirtualKeyboard(); | 90 virtual void InitVirtualKeyboard(); |
80 virtual void UpdateKeyboardAndLayout(bool should_show_keyboard); | 91 virtual void UpdateKeyboardAndLayout(bool should_show_keyboard); |
81 virtual VirtualKeyboardType DecideKeyboardStateForView(views::View* view); | 92 virtual VirtualKeyboardType DecideKeyboardStateForView(views::View* view); |
82 | 93 |
(...skipping 15 matching lines...) Expand all Loading... | |
98 // Overridden from ui::AnimationDelegate: | 109 // Overridden from ui::AnimationDelegate: |
99 virtual void AnimationProgressed(const ui::Animation* animation); | 110 virtual void AnimationProgressed(const ui::Animation* animation); |
100 virtual void AnimationEnded(const ui::Animation* animation); | 111 virtual void AnimationEnded(const ui::Animation* animation); |
101 | 112 |
102 bool keyboard_showing_; | 113 bool keyboard_showing_; |
103 int keyboard_height_; | 114 int keyboard_height_; |
104 bool focus_listener_added_; | 115 bool focus_listener_added_; |
105 KeyboardContainerView* keyboard_; | 116 KeyboardContainerView* keyboard_; |
106 NotificationRegistrar registrar_; | 117 NotificationRegistrar registrar_; |
107 GURL url_; | 118 GURL url_; |
119 views::LayerPropertySetter* setter_; | |
sky
2011/08/25 21:10:12
Initialize this. In fact maybe this should just be
| |
108 | 120 |
109 scoped_ptr<ui::SlideAnimation> animation_; | 121 scoped_ptr<ui::SlideAnimation> animation_; |
110 | 122 |
111 DISALLOW_COPY_AND_ASSIGN(TouchBrowserFrameView); | 123 DISALLOW_COPY_AND_ASSIGN(TouchBrowserFrameView); |
112 }; | 124 }; |
113 | 125 |
114 #endif // CHROME_BROWSER_UI_TOUCH_FRAME_TOUCH_BROWSER_FRAME_VIEW_H_ | 126 #endif // CHROME_BROWSER_UI_TOUCH_FRAME_TOUCH_BROWSER_FRAME_VIEW_H_ |
OLD | NEW |