Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/ui/views/frame/opaque_browser_frame_view.h" | 9 #include "chrome/browser/ui/views/frame/opaque_browser_frame_view.h" |
| 10 #include "chrome/common/notification_observer.h" | 10 #include "chrome/common/notification_observer.h" |
| 11 #include "chrome/common/notification_registrar.h" | 11 #include "chrome/common/notification_registrar.h" |
| 12 | 12 |
|
rjkroege
2011/01/27 00:04:22
no blank line
varunjain
2011/01/27 00:19:34
Done.
| |
| 13 #include "views/focus/focus_manager.h" | |
| 14 | |
| 13 class BrowserFrame; | 15 class BrowserFrame; |
| 14 class BrowserView; | 16 class BrowserView; |
| 15 class KeyboardContainerView; | 17 class KeyboardContainerView; |
| 16 class NotificationDetails; | 18 class NotificationDetails; |
| 17 class NotificationSource; | 19 class NotificationSource; |
| 18 | 20 |
| 19 class TouchBrowserFrameView : public OpaqueBrowserFrameView, | 21 class TouchBrowserFrameView : public OpaqueBrowserFrameView, |
| 20 public NotificationObserver { | 22 public NotificationObserver { |
| 21 public: | 23 public: |
| 24 | |
| 25 // A focus listner that performs touch specific tasks on focus change such | |
|
rjkroege
2011/01/27 00:04:22
sp listener
varunjain
2011/01/27 00:19:34
Done.
| |
| 26 // as showing/hiding virtual keyboard. | |
| 27 class TouchBrowserFocusChangeListener : public views::FocusChangeListener { | |
| 28 public: | |
| 29 TouchBrowserFocusChangeListener(TouchBrowserFrameView* browser_frame); | |
| 30 | |
| 31 // views::FocusChangeListener implementation | |
| 32 virtual void FocusWillChange(views::View* focused_before, | |
| 33 views::View* focused_now); | |
| 34 | |
| 35 private: | |
| 36 TouchBrowserFrameView* touch_browser_frame_; | |
| 37 }; | |
| 38 | |
| 22 // Constructs a non-client view for an BrowserFrame. | 39 // Constructs a non-client view for an BrowserFrame. |
| 23 TouchBrowserFrameView(BrowserFrame* frame, BrowserView* browser_view); | 40 TouchBrowserFrameView(BrowserFrame* frame, BrowserView* browser_view); |
| 24 virtual ~TouchBrowserFrameView(); | 41 virtual ~TouchBrowserFrameView(); |
| 25 | 42 |
| 26 // Overridden from OpaqueBrowserFrameView | 43 // Overridden from OpaqueBrowserFrameView |
| 27 virtual void Layout(); | 44 virtual void Layout(); |
| 45 virtual void UpdateKeyboardAndLayout(bool should_show_keyboard); | |
| 28 | 46 |
| 29 protected: | 47 protected: |
| 30 // Overridden from OpaqueBrowserFrameView | 48 // Overridden from OpaqueBrowserFrameView |
| 31 virtual int GetReservedHeight() const; | 49 virtual int GetReservedHeight() const; |
| 50 virtual void ViewHierarchyChanged(bool is_add, View* parent, View* child); | |
| 32 | 51 |
| 33 private: | 52 private: |
| 34 virtual void InitVirtualKeyboard(); | 53 virtual void InitVirtualKeyboard(); |
| 35 virtual void UpdateKeyboardAndLayout(bool should_show_keyboard); | |
| 36 | 54 |
| 37 // Overridden from NotificationObserver. | 55 // Overridden from NotificationObserver. |
| 38 virtual void Observe(NotificationType type, | 56 virtual void Observe(NotificationType type, |
| 39 const NotificationSource& source, | 57 const NotificationSource& source, |
| 40 const NotificationDetails& details); | 58 const NotificationDetails& details); |
| 41 | 59 |
| 42 bool keyboard_showing_; | 60 bool keyboard_showing_; |
| 43 KeyboardContainerView* keyboard_; | 61 KeyboardContainerView* keyboard_; |
| 44 NotificationRegistrar registrar_; | 62 NotificationRegistrar registrar_; |
| 63 scoped_ptr<TouchBrowserFocusChangeListener> focus_change_listener_; | |
| 45 | 64 |
| 46 DISALLOW_COPY_AND_ASSIGN(TouchBrowserFrameView); | 65 DISALLOW_COPY_AND_ASSIGN(TouchBrowserFrameView); |
| 47 }; | 66 }; |
| 48 | 67 |
| 49 #endif // CHROME_BROWSER_UI_TOUCH_FRAME_TOUCH_BROWSER_FRAME_VIEW_H_ | 68 #endif // CHROME_BROWSER_UI_TOUCH_FRAME_TOUCH_BROWSER_FRAME_VIEW_H_ |
| OLD | NEW |