| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 | 8 |
| 9 #include "build/build_config.h" | 9 #include "build/build_config.h" |
| 10 | 10 |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 79 "Attempting to remove an unregistered WidgetFocusChangeListener."; | 79 "Attempting to remove an unregistered WidgetFocusChangeListener."; |
| 80 } | 80 } |
| 81 } | 81 } |
| 82 | 82 |
| 83 void FocusManager::WidgetFocusManager::OnWidgetFocusEvent( | 83 void FocusManager::WidgetFocusManager::OnWidgetFocusEvent( |
| 84 gfx::NativeView focused_before, | 84 gfx::NativeView focused_before, |
| 85 gfx::NativeView focused_now) { | 85 gfx::NativeView focused_now) { |
| 86 if (!enabled_) | 86 if (!enabled_) |
| 87 return; | 87 return; |
| 88 | 88 |
| 89 // Perform a safe iteration over the focus listeners, as the array of | 89 // Perform a safe iteration over the focus listeners, as the array |
| 90 // may change during notification. | 90 // may change during notification. |
| 91 WidgetFocusChangeListenerList local_listeners(focus_change_listeners_); | 91 WidgetFocusChangeListenerList local_listeners(focus_change_listeners_); |
| 92 WidgetFocusChangeListenerList::iterator iter(local_listeners.begin()); | 92 WidgetFocusChangeListenerList::iterator iter(local_listeners.begin()); |
| 93 for (;iter != local_listeners.end(); ++iter) { | 93 for (;iter != local_listeners.end(); ++iter) { |
| 94 (*iter)->NativeFocusWillChange(focused_before, focused_now); | 94 (*iter)->NativeFocusWillChange(focused_before, focused_now); |
| 95 } | 95 } |
| 96 } | 96 } |
| 97 | 97 |
| 98 // static | 98 // static |
| 99 FocusManager::WidgetFocusManager* | 99 FocusManager::WidgetFocusManager* |
| (...skipping 364 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 464 !IsTraverseForward(direction), | 464 !IsTraverseForward(direction), |
| 465 FocusSearch::DOWN, | 465 FocusSearch::DOWN, |
| 466 false, | 466 false, |
| 467 &new_focus_traversable, | 467 &new_focus_traversable, |
| 468 &new_starting_view); | 468 &new_starting_view); |
| 469 } | 469 } |
| 470 return v; | 470 return v; |
| 471 } | 471 } |
| 472 | 472 |
| 473 } // namespace ui | 473 } // namespace ui |
| OLD | NEW |