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

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 changes that were missed in last patch 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/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);
34 41
35 private: 42 private:
36 virtual void InitVirtualKeyboard(); 43 virtual void InitVirtualKeyboard();
37 virtual void UpdateKeyboardAndLayout(bool should_show_keyboard); 44 virtual void UpdateKeyboardAndLayout(bool should_show_keyboard);
38 45
39 // Overrridden from TabStripModelObserver. 46 // Overrridden from TabStripModelObserver.
40 virtual void TabSelectedAt(TabContentsWrapper* old_contents, 47 virtual void TabSelectedAt(TabContentsWrapper* old_contents,
41 TabContentsWrapper* new_contents, 48 TabContentsWrapper* new_contents,
42 int index, 49 int index,
43 bool user_gesture); 50 bool user_gesture);
44 51
45 // Overridden from NotificationObserver. 52 // Overridden from NotificationObserver.
46 virtual void Observe(NotificationType type, 53 virtual void Observe(NotificationType type,
47 const NotificationSource& source, 54 const NotificationSource& source,
48 const NotificationDetails& details); 55 const NotificationDetails& details);
49 56
50 bool keyboard_showing_; 57 bool keyboard_showing_;
51 KeyboardContainerView* keyboard_; 58 KeyboardContainerView* keyboard_;
52 NotificationRegistrar registrar_; 59 NotificationRegistrar registrar_;
60 bool focus_listener_added_;
53 61
54 DISALLOW_COPY_AND_ASSIGN(TouchBrowserFrameView); 62 DISALLOW_COPY_AND_ASSIGN(TouchBrowserFrameView);
55 }; 63 };
56 64
57 #endif // CHROME_BROWSER_UI_TOUCH_FRAME_TOUCH_BROWSER_FRAME_VIEW_H_ 65 #endif // CHROME_BROWSER_UI_TOUCH_FRAME_TOUCH_BROWSER_FRAME_VIEW_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698