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

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

Issue 294023002: aura: Updates the text input client when native activation changes. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Synced. Created 6 years, 6 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 #include "ui/views/focus/focus_manager.h" 5 #include "ui/views/focus/focus_manager.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/auto_reset.h" 10 #include "base/auto_reset.h"
(...skipping 295 matching lines...) Expand 10 before | Expand all | Expand 10 after
306 if (widget->widget_delegate()->ShouldAdvanceFocusToTopLevelWidget()) 306 if (widget->widget_delegate()->ShouldAdvanceFocusToTopLevelWidget())
307 widget = widget_; 307 widget = widget_;
308 return GetNextFocusableView(NULL, widget, reverse, true); 308 return GetNextFocusableView(NULL, widget, reverse, true);
309 } 309 }
310 } 310 }
311 return NULL; 311 return NULL;
312 } 312 }
313 313
314 void FocusManager::SetFocusedViewWithReason( 314 void FocusManager::SetFocusedViewWithReason(
315 View* view, FocusChangeReason reason) { 315 View* view, FocusChangeReason reason) {
316 if (focused_view_ == view) 316 if (focused_view_ == view) {
317 // In the case that the widget lost the focus and gained it back without
318 // changing the focused view, we have to make the text input client focused.
319 FocusTextInputClient(focused_view_);
317 return; 320 return;
321 }
318 322
319 base::AutoReset<bool> auto_changing_focus(&is_changing_focus_, true); 323 base::AutoReset<bool> auto_changing_focus(&is_changing_focus_, true);
320 // Update the reason for the focus change (since this is checked by 324 // Update the reason for the focus change (since this is checked by
321 // some listeners), then notify all listeners. 325 // some listeners), then notify all listeners.
322 focus_change_reason_ = reason; 326 focus_change_reason_ = reason;
323 FOR_EACH_OBSERVER(FocusChangeListener, focus_change_listeners_, 327 FOR_EACH_OBSERVER(FocusChangeListener, focus_change_listeners_,
324 OnWillChangeFocus(focused_view_, view)); 328 OnWillChangeFocus(focused_view_, view));
325 329
326 View* old_focused_view = focused_view_; 330 View* old_focused_view = focused_view_;
327 focused_view_ = view; 331 focused_view_ = view;
(...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after
579 } 583 }
580 if (key_code == ui::VKEY_RIGHT || key_code == ui::VKEY_DOWN) { 584 if (key_code == ui::VKEY_RIGHT || key_code == ui::VKEY_DOWN) {
581 AdvanceFocus(false); 585 AdvanceFocus(false);
582 return true; 586 return true;
583 } 587 }
584 588
585 return false; 589 return false;
586 } 590 }
587 591
588 } // namespace views 592 } // namespace views
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698