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" |
(...skipping 11 matching lines...) Expand all Loading... |
22 class KeyboardContainerView; | 22 class KeyboardContainerView; |
23 class NotificationDetails; | 23 class NotificationDetails; |
24 class NotificationSource; | 24 class NotificationSource; |
25 | 25 |
26 namespace ui { | 26 namespace ui { |
27 class SlideAnimation; | 27 class SlideAnimation; |
28 } | 28 } |
29 | 29 |
30 class TouchBrowserFrameView | 30 class TouchBrowserFrameView |
31 : public OpaqueBrowserFrameView, | 31 : public OpaqueBrowserFrameView, |
32 public views::FocusChangeListener, | 32 public views::FocusChangeListener { |
33 public TabStripModelObserver, | |
34 #if defined(OS_CHROMEOS) | |
35 public | |
36 chromeos::input_method::InputMethodManager::VirtualKeyboardObserver, | |
37 #endif | |
38 public ui::AnimationDelegate { | |
39 public: | 33 public: |
40 enum VirtualKeyboardType { | |
41 NONE, | |
42 GENERIC, | |
43 URL, | |
44 }; | |
45 | |
46 // Internal class name. | 34 // Internal class name. |
47 static const char kViewClassName[]; | 35 static const char kViewClassName[]; |
48 | 36 |
49 // Constructs a non-client view for an BrowserFrame. | 37 // Constructs a non-client view for an BrowserFrame. |
50 TouchBrowserFrameView(BrowserFrame* frame, BrowserView* browser_view); | 38 TouchBrowserFrameView(BrowserFrame* frame, BrowserView* browser_view); |
51 virtual ~TouchBrowserFrameView(); | 39 virtual ~TouchBrowserFrameView(); |
52 | 40 |
53 // Overriden from Views. | |
54 virtual std::string GetClassName() const OVERRIDE; | |
55 | 41 |
56 // Overridden from OpaqueBrowserFrameView | 42 private: |
57 virtual void Layout(); | |
58 | |
59 // views::FocusChangeListener implementation | 43 // views::FocusChangeListener implementation |
60 virtual void FocusWillChange(views::View* focused_before, | 44 virtual void FocusWillChange(views::View* focused_before, |
61 views::View* focused_now); | 45 views::View* focused_now); |
62 | 46 |
63 #if defined(OS_CHROMEOS) | 47 // Overridden from views::View |
64 // input_method::InputMethodManager::VirtualKeyboardObserver implementation. | 48 virtual std::string GetClassName() const OVERRIDE; |
65 virtual void VirtualKeyboardChanged( | |
66 chromeos::input_method::InputMethodManager* manager, | |
67 const chromeos::input_method::VirtualKeyboard& virtual_keyboard, | |
68 const std::string& virtual_keyboard_layout); | |
69 #endif | |
70 | |
71 protected: | |
72 // Overridden from OpaqueBrowserFrameView | |
73 virtual int GetReservedHeight() const; | |
74 virtual void ViewHierarchyChanged(bool is_add, View* parent, View* child); | 49 virtual void ViewHierarchyChanged(bool is_add, View* parent, View* child); |
75 | |
76 private: | |
77 virtual void InitVirtualKeyboard(); | |
78 virtual void UpdateKeyboardAndLayout(bool should_show_keyboard); | |
79 virtual VirtualKeyboardType DecideKeyboardStateForView(views::View* view); | |
80 | |
81 // Overridden from views::View | |
82 virtual bool HitTest(const gfx::Point& point) const OVERRIDE; | 50 virtual bool HitTest(const gfx::Point& point) const OVERRIDE; |
83 | 51 |
84 // Overrridden from TabStripModelObserver. | |
85 virtual void ActiveTabChanged(TabContentsWrapper* old_contents, | |
86 TabContentsWrapper* new_contents, | |
87 int index, | |
88 bool user_gesture); | |
89 virtual void TabStripEmpty(); | |
90 | |
91 // Overridden from NotificationObserver. | |
92 virtual void Observe(NotificationType type, | |
93 const NotificationSource& source, | |
94 const NotificationDetails& details); | |
95 | |
96 // Overridden from ui::AnimationDelegate: | |
97 virtual void AnimationProgressed(const ui::Animation* animation); | |
98 virtual void AnimationEnded(const ui::Animation* animation); | |
99 | |
100 bool keyboard_showing_; | |
101 int keyboard_height_; | |
102 bool focus_listener_added_; | 52 bool focus_listener_added_; |
103 KeyboardContainerView* keyboard_; | |
104 NotificationRegistrar registrar_; | |
105 | |
106 scoped_ptr<ui::SlideAnimation> animation_; | |
107 | 53 |
108 DISALLOW_COPY_AND_ASSIGN(TouchBrowserFrameView); | 54 DISALLOW_COPY_AND_ASSIGN(TouchBrowserFrameView); |
109 }; | 55 }; |
110 | 56 |
111 #endif // CHROME_BROWSER_UI_TOUCH_FRAME_TOUCH_BROWSER_FRAME_VIEW_H_ | 57 #endif // CHROME_BROWSER_UI_TOUCH_FRAME_TOUCH_BROWSER_FRAME_VIEW_H_ |
OLD | NEW |