Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(6309)

Unified Diff: chrome/browser/ui/touch/frame/touch_browser_frame_view.h

Issue 6384004: Browser should get notified if a views textfield changes focus. In addition, (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Re-did CL according to discussions Created 9 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/touch/frame/touch_browser_frame_view.h
diff --git a/chrome/browser/ui/touch/frame/touch_browser_frame_view.h b/chrome/browser/ui/touch/frame/touch_browser_frame_view.h
index 35da0b543bd2287ddda428a927de357b08ca2310..6450278d2b293211bb358aebd7fd1d2818d0a9d9 100644
--- a/chrome/browser/ui/touch/frame/touch_browser_frame_view.h
+++ b/chrome/browser/ui/touch/frame/touch_browser_frame_view.h
@@ -10,6 +10,8 @@
#include "chrome/common/notification_observer.h"
#include "chrome/common/notification_registrar.h"
rjkroege 2011/01/27 00:04:22 no blank line
varunjain 2011/01/27 00:19:34 Done.
+#include "views/focus/focus_manager.h"
+
class BrowserFrame;
class BrowserView;
class KeyboardContainerView;
@@ -19,20 +21,36 @@ class NotificationSource;
class TouchBrowserFrameView : public OpaqueBrowserFrameView,
public NotificationObserver {
public:
+
+ // 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.
+ // as showing/hiding virtual keyboard.
+ class TouchBrowserFocusChangeListener : public views::FocusChangeListener {
+ public:
+ TouchBrowserFocusChangeListener(TouchBrowserFrameView* browser_frame);
+
+ // views::FocusChangeListener implementation
+ virtual void FocusWillChange(views::View* focused_before,
+ views::View* focused_now);
+
+ private:
+ TouchBrowserFrameView* touch_browser_frame_;
+ };
+
// Constructs a non-client view for an BrowserFrame.
TouchBrowserFrameView(BrowserFrame* frame, BrowserView* browser_view);
virtual ~TouchBrowserFrameView();
// Overridden from OpaqueBrowserFrameView
virtual void Layout();
+ virtual void UpdateKeyboardAndLayout(bool should_show_keyboard);
protected:
// Overridden from OpaqueBrowserFrameView
virtual int GetReservedHeight() const;
+ virtual void ViewHierarchyChanged(bool is_add, View* parent, View* child);
private:
virtual void InitVirtualKeyboard();
- virtual void UpdateKeyboardAndLayout(bool should_show_keyboard);
// Overridden from NotificationObserver.
virtual void Observe(NotificationType type,
@@ -42,6 +60,7 @@ class TouchBrowserFrameView : public OpaqueBrowserFrameView,
bool keyboard_showing_;
KeyboardContainerView* keyboard_;
NotificationRegistrar registrar_;
+ scoped_ptr<TouchBrowserFocusChangeListener> focus_change_listener_;
DISALLOW_COPY_AND_ASSIGN(TouchBrowserFrameView);
};

Powered by Google App Engine
This is Rietveld 408576698