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

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: Added a TODO comment. 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 296 matching lines...) Expand 10 before | Expand all | Expand 10 after
307 if (widget->widget_delegate()->ShouldAdvanceFocusToTopLevelWidget()) 307 if (widget->widget_delegate()->ShouldAdvanceFocusToTopLevelWidget())
308 widget = widget_; 308 widget = widget_;
309 return GetNextFocusableView(NULL, widget, reverse, true); 309 return GetNextFocusableView(NULL, widget, reverse, true);
310 } 310 }
311 } 311 }
312 return NULL; 312 return NULL;
313 } 313 }
314 314
315 void FocusManager::SetFocusedViewWithReason( 315 void FocusManager::SetFocusedViewWithReason(
316 View* view, FocusChangeReason reason) { 316 View* view, FocusChangeReason reason) {
317 if (focused_view_ == view) 317 if (focused_view_ == view) {
318 // In the case that the widget lost the focus and gained it back without
319 // changing the focused view, we have to make the text input client focused.
320 // TODO(yukishiino): Remove this hack once we fix http://crbug.com/383236
321 FocusTextInputClient(focused_view_);
318 return; 322 return;
323 }
319 324
320 base::AutoReset<bool> auto_changing_focus(&is_changing_focus_, true); 325 base::AutoReset<bool> auto_changing_focus(&is_changing_focus_, true);
321 // Update the reason for the focus change (since this is checked by 326 // Update the reason for the focus change (since this is checked by
322 // some listeners), then notify all listeners. 327 // some listeners), then notify all listeners.
323 focus_change_reason_ = reason; 328 focus_change_reason_ = reason;
324 FOR_EACH_OBSERVER(FocusChangeListener, focus_change_listeners_, 329 FOR_EACH_OBSERVER(FocusChangeListener, focus_change_listeners_,
325 OnWillChangeFocus(focused_view_, view)); 330 OnWillChangeFocus(focused_view_, view));
326 331
327 View* old_focused_view = focused_view_; 332 View* old_focused_view = focused_view_;
328 focused_view_ = view; 333 focused_view_ = view;
(...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after
580 } 585 }
581 if (key_code == ui::VKEY_RIGHT || key_code == ui::VKEY_DOWN) { 586 if (key_code == ui::VKEY_RIGHT || key_code == ui::VKEY_DOWN) {
582 AdvanceFocus(false); 587 AdvanceFocus(false);
583 return true; 588 return true;
584 } 589 }
585 590
586 return false; 591 return false;
587 } 592 }
588 593
589 } // namespace views 594 } // namespace views
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/omnibox/omnibox_view_views_browsertest.cc ('k') | ui/views/focus/focus_manager_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698