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

Side by Side 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: minor change 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 #include "views/focus/focus_manager.h"
12 13
13 class BrowserFrame; 14 class BrowserFrame;
14 class BrowserView; 15 class BrowserView;
15 class KeyboardContainerView; 16 class KeyboardContainerView;
16 class NotificationDetails; 17 class NotificationDetails;
17 class NotificationSource; 18 class NotificationSource;
18 19
19 class TouchBrowserFrameView : public OpaqueBrowserFrameView, 20 class TouchBrowserFrameView : public OpaqueBrowserFrameView,
20 public NotificationObserver { 21 public NotificationObserver {
21 public: 22 public:
23
24 // A focus listener that performs touch specific tasks on focus change such
25 // as showing/hiding virtual keyboard.
26 class TouchBrowserFocusChangeListener : public views::FocusChangeListener {
bryeung 2011/01/27 20:50:34 It seems a more common idiom might be to make Touc
varunjain 2011/01/27 23:01:38 Done.
27 public:
28 TouchBrowserFocusChangeListener(TouchBrowserFrameView* browser_frame);
oshima 2011/01/27 19:58:33 explicit
varunjain 2011/01/27 23:01:38 not needed anymore.
29
30 // views::FocusChangeListener implementation
31 virtual void FocusWillChange(views::View* focused_before,
32 views::View* focused_now);
oshima 2011/01/27 19:58:33 indent should be either function(a, b) fu
varunjain 2011/01/27 23:01:38 Done.
33
34 private:
35 TouchBrowserFrameView* touch_browser_frame_;
oshima 2011/01/27 19:58:33 DISALLOW_COPY_AND_ASSIGN
varunjain 2011/01/27 23:01:38 not needed anymore
36 };
oshima 2011/01/27 19:58:33 Does this needs to be here? If not, I'd prefer to
varunjain 2011/01/27 23:01:38 not needed anymore
37
22 // Constructs a non-client view for an BrowserFrame. 38 // Constructs a non-client view for an BrowserFrame.
23 TouchBrowserFrameView(BrowserFrame* frame, BrowserView* browser_view); 39 TouchBrowserFrameView(BrowserFrame* frame, BrowserView* browser_view);
24 virtual ~TouchBrowserFrameView(); 40 virtual ~TouchBrowserFrameView();
25 41
26 // Overridden from OpaqueBrowserFrameView 42 // Overridden from OpaqueBrowserFrameView
27 virtual void Layout(); 43 virtual void Layout();
44 virtual void UpdateKeyboardAndLayout(bool should_show_keyboard);
28 45
29 protected: 46 protected:
30 // Overridden from OpaqueBrowserFrameView 47 // Overridden from OpaqueBrowserFrameView
31 virtual int GetReservedHeight() const; 48 virtual int GetReservedHeight() const;
49 virtual void ViewHierarchyChanged(bool is_add, View* parent, View* child);
32 50
33 private: 51 private:
34 virtual void InitVirtualKeyboard(); 52 virtual void InitVirtualKeyboard();
35 virtual void UpdateKeyboardAndLayout(bool should_show_keyboard);
36 53
37 // Overridden from NotificationObserver. 54 // Overridden from NotificationObserver.
38 virtual void Observe(NotificationType type, 55 virtual void Observe(NotificationType type,
39 const NotificationSource& source, 56 const NotificationSource& source,
40 const NotificationDetails& details); 57 const NotificationDetails& details);
41 58
42 bool keyboard_showing_; 59 bool keyboard_showing_;
43 KeyboardContainerView* keyboard_; 60 KeyboardContainerView* keyboard_;
44 NotificationRegistrar registrar_; 61 NotificationRegistrar registrar_;
62 scoped_ptr<TouchBrowserFocusChangeListener> focus_change_listener_;
oshima 2011/01/27 19:58:33 can this be just a FocusChangeListener?
varunjain 2011/01/27 23:01:38 not needed anymore
45 63
46 DISALLOW_COPY_AND_ASSIGN(TouchBrowserFrameView); 64 DISALLOW_COPY_AND_ASSIGN(TouchBrowserFrameView);
47 }; 65 };
48 66
49 #endif // CHROME_BROWSER_UI_TOUCH_FRAME_TOUCH_BROWSER_FRAME_VIEW_H_ 67 #endif // CHROME_BROWSER_UI_TOUCH_FRAME_TOUCH_BROWSER_FRAME_VIEW_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698