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

Side by Side Diff: ui/views/focus/focus_manager.h

Issue 173803002: Redesigns the text input focus handling. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Synced. Created 6 years, 7 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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 UI_VIEWS_FOCUS_FOCUS_MANAGER_H_ 5 #ifndef UI_VIEWS_FOCUS_FOCUS_MANAGER_H_
6 #define UI_VIEWS_FOCUS_FOCUS_MANAGER_H_ 6 #define UI_VIEWS_FOCUS_FOCUS_MANAGER_H_
7 7
8 #include <list> 8 #include <list>
9 #include <map> 9 #include <map>
10 10
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 // when traversing up from the nested RootView to know which view to start 65 // when traversing up from the nested RootView to know which view to start
66 // with when going to the next/previous view. 66 // with when going to the next/previous view.
67 // In our example: 67 // In our example:
68 // hwnd_view_container_->GetWidget()->SetFocusTraversableParent( 68 // hwnd_view_container_->GetWidget()->SetFocusTraversableParent(
69 // native_control); 69 // native_control);
70 // 70 //
71 // Note that FocusTraversable do not have to be RootViews: AccessibleToolbarView 71 // Note that FocusTraversable do not have to be RootViews: AccessibleToolbarView
72 // is FocusTraversable. 72 // is FocusTraversable.
73 73
74 namespace ui { 74 namespace ui {
75 class AcceleratorManager;
75 class AcceleratorTarget; 76 class AcceleratorTarget;
76 class AcceleratorManager;
77 class EventHandler; 77 class EventHandler;
78 class KeyEvent; 78 class KeyEvent;
79 } 79 }
80 80
81 namespace views { 81 namespace views {
82 82
83 class FocusManagerDelegate; 83 class FocusManagerDelegate;
84 class FocusSearch; 84 class FocusSearch;
85 class RootView; 85 class RootView;
86 class View; 86 class View;
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
206 // Returns the View that either currently has focus, or if no view has focus 206 // Returns the View that either currently has focus, or if no view has focus
207 // the view that last had focus. 207 // the view that last had focus.
208 View* GetStoredFocusView(); 208 View* GetStoredFocusView();
209 209
210 // Clears the stored focused view. 210 // Clears the stored focused view.
211 void ClearStoredFocusedView(); 211 void ClearStoredFocusedView();
212 212
213 // Returns true if in the process of changing the focused view. 213 // Returns true if in the process of changing the focused view.
214 bool is_changing_focus() const { return is_changing_focus_; } 214 bool is_changing_focus() const { return is_changing_focus_; }
215 215
216 // Changes the text input focus to |view->GetTextInputClient()| iff |view|
217 // is focused. Views must call this method when their internal
218 // TextInputClient instance changes.
219 void OnTextInputClientChanged(View* view);
220
221 // Moves the text input focus into/out from |view|.
222 void FocusTextInputClient(View* view);
223 void BlurTextInputClient(View* view);
224
216 // Disable shortcut handling. 225 // Disable shortcut handling.
217 static void set_shortcut_handling_suspended(bool suspended) { 226 static void set_shortcut_handling_suspended(bool suspended) {
218 shortcut_handling_suspended_ = suspended; 227 shortcut_handling_suspended_ = suspended;
219 } 228 }
220 // Returns whether shortcut handling is currently suspended. 229 // Returns whether shortcut handling is currently suspended.
221 bool shortcut_handling_suspended() { return shortcut_handling_suspended_; } 230 bool shortcut_handling_suspended() { return shortcut_handling_suspended_; }
222 231
223 // Register a keyboard accelerator for the specified target. If multiple 232 // Register a keyboard accelerator for the specified target. If multiple
224 // targets are registered for an accelerator, a target registered later has 233 // targets are registered for an accelerator, a target registered later has
225 // higher priority. 234 // higher priority.
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after
363 372
364 // See description above getter. 373 // See description above getter.
365 bool is_changing_focus_; 374 bool is_changing_focus_;
366 375
367 DISALLOW_COPY_AND_ASSIGN(FocusManager); 376 DISALLOW_COPY_AND_ASSIGN(FocusManager);
368 }; 377 };
369 378
370 } // namespace views 379 } // namespace views
371 380
372 #endif // UI_VIEWS_FOCUS_FOCUS_MANAGER_H_ 381 #endif // UI_VIEWS_FOCUS_FOCUS_MANAGER_H_
OLDNEW
« no previous file with comments | « ui/views/controls/webview/webview_interactive_uitest.cc ('k') | ui/views/focus/focus_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698