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/browser/tabs/tab_strip_model_observer.h" | 10 #include "chrome/browser/tabs/tab_strip_model_observer.h" |
| 11 #include "chrome/common/notification_observer.h" | 11 #include "chrome/common/notification_observer.h" |
| 12 #include "chrome/common/notification_registrar.h" | 12 #include "chrome/common/notification_registrar.h" |
| 13 #include "views/focus/focus_manager.h" | |
| 13 | 14 |
| 14 class BrowserFrame; | 15 class BrowserFrame; |
| 15 class BrowserView; | 16 class BrowserView; |
| 16 class KeyboardContainerView; | 17 class KeyboardContainerView; |
| 17 class NotificationDetails; | 18 class NotificationDetails; |
| 18 class NotificationSource; | 19 class NotificationSource; |
| 19 | 20 |
| 20 class TouchBrowserFrameView : public OpaqueBrowserFrameView, | 21 class TouchBrowserFrameView : public OpaqueBrowserFrameView, |
| 22 public views::FocusChangeListener, | |
| 21 public TabStripModelObserver, | 23 public TabStripModelObserver, |
| 22 public NotificationObserver { | 24 public NotificationObserver { |
| 23 public: | 25 public: |
| 24 // Constructs a non-client view for an BrowserFrame. | 26 // Constructs a non-client view for an BrowserFrame. |
| 25 TouchBrowserFrameView(BrowserFrame* frame, BrowserView* browser_view); | 27 TouchBrowserFrameView(BrowserFrame* frame, BrowserView* browser_view); |
| 26 virtual ~TouchBrowserFrameView(); | 28 virtual ~TouchBrowserFrameView(); |
| 27 | 29 |
| 28 // Overridden from OpaqueBrowserFrameView | 30 // Overridden from OpaqueBrowserFrameView |
| 29 virtual void Layout(); | 31 virtual void Layout(); |
| 30 | 32 |
| 33 // views::FocusChangeListener implementation | |
| 34 virtual void FocusWillChange(views::View* focused_before, | |
| 35 views::View* focused_now); | |
| 36 | |
| 31 protected: | 37 protected: |
| 32 // Overridden from OpaqueBrowserFrameView | 38 // Overridden from OpaqueBrowserFrameView |
| 33 virtual int GetReservedHeight() const; | 39 virtual int GetReservedHeight() const; |
| 40 virtual void ViewHierarchyChanged(bool is_add, View* parent, View* child); | |
|
oshima
2011/02/04 10:15:27
any specific reason why they're in protected?
varunjain
2011/02/04 16:38:46
Its listed as protected in views::View
| |
| 34 | 41 |
| 35 private: | 42 private: |
| 43 enum VirtualKeyboardType { | |
| 44 NONE, | |
| 45 GENERIC, | |
| 46 URL, | |
| 47 }; | |
| 48 | |
| 36 virtual void InitVirtualKeyboard(); | 49 virtual void InitVirtualKeyboard(); |
| 37 virtual void UpdateKeyboardAndLayout(bool should_show_keyboard); | 50 virtual void UpdateKeyboardAndLayout(bool should_show_keyboard); |
| 38 | 51 |
| 39 // Overrridden from TabStripModelObserver. | 52 // Overrridden from TabStripModelObserver. |
| 40 virtual void TabSelectedAt(TabContentsWrapper* old_contents, | 53 virtual void TabSelectedAt(TabContentsWrapper* old_contents, |
| 41 TabContentsWrapper* new_contents, | 54 TabContentsWrapper* new_contents, |
| 42 int index, | 55 int index, |
| 43 bool user_gesture); | 56 bool user_gesture); |
| 44 | 57 |
| 45 // Overridden from NotificationObserver. | 58 // Overridden from NotificationObserver. |
| 46 virtual void Observe(NotificationType type, | 59 virtual void Observe(NotificationType type, |
| 47 const NotificationSource& source, | 60 const NotificationSource& source, |
| 48 const NotificationDetails& details); | 61 const NotificationDetails& details); |
| 49 | 62 |
| 63 virtual VirtualKeyboardType GetKeyboardType(views::View* view); | |
|
oshima
2011/02/04 10:15:27
why virtual? can this be just a static function, p
varunjain
2011/02/04 16:38:46
Done.
| |
| 64 | |
| 50 bool keyboard_showing_; | 65 bool keyboard_showing_; |
| 51 KeyboardContainerView* keyboard_; | 66 KeyboardContainerView* keyboard_; |
| 52 NotificationRegistrar registrar_; | 67 NotificationRegistrar registrar_; |
| 68 bool focus_listener_added_; | |
|
rjkroege
2011/02/04 15:18:30
put the bools next to each other so the compiler p
varunjain
2011/02/04 16:38:46
Done.
| |
| 53 | 69 |
| 54 DISALLOW_COPY_AND_ASSIGN(TouchBrowserFrameView); | 70 DISALLOW_COPY_AND_ASSIGN(TouchBrowserFrameView); |
| 55 }; | 71 }; |
| 56 | 72 |
| 57 #endif // CHROME_BROWSER_UI_TOUCH_FRAME_TOUCH_BROWSER_FRAME_VIEW_H_ | 73 #endif // CHROME_BROWSER_UI_TOUCH_FRAME_TOUCH_BROWSER_FRAME_VIEW_H_ |
| OLD | NEW |