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

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

Issue 6334101: Removal of chrome.experimental.popup set of APIs (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 10 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
« no previous file with comments | « ui/views/focus/focus_manager.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 #include "views/focus/focus_manager.h" 5 #include "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 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 "Attempting to remove an unregistered WidgetFocusChangeListener."; 47 "Attempting to remove an unregistered WidgetFocusChangeListener.";
48 } 48 }
49 } 49 }
50 50
51 void FocusManager::WidgetFocusManager::OnWidgetFocusEvent( 51 void FocusManager::WidgetFocusManager::OnWidgetFocusEvent(
52 gfx::NativeView focused_before, 52 gfx::NativeView focused_before,
53 gfx::NativeView focused_now) { 53 gfx::NativeView focused_now) {
54 if (!enabled_) 54 if (!enabled_)
55 return; 55 return;
56 56
57 // Perform a safe iteration over the focus listeners, as the array of 57 // Perform a safe iteration over the focus listeners, as the array
58 // may change during notification. 58 // may change during notification.
59 WidgetFocusChangeListenerList local_listeners(focus_change_listeners_); 59 WidgetFocusChangeListenerList local_listeners(focus_change_listeners_);
60 WidgetFocusChangeListenerList::iterator iter(local_listeners.begin()); 60 WidgetFocusChangeListenerList::iterator iter(local_listeners.begin());
61 for (;iter != local_listeners.end(); ++iter) { 61 for (;iter != local_listeners.end(); ++iter) {
62 (*iter)->NativeFocusWillChange(focused_before, focused_now); 62 (*iter)->NativeFocusWillChange(focused_before, focused_now);
63 } 63 }
64 } 64 }
65 65
66 // static 66 // static
67 FocusManager::WidgetFocusManager* 67 FocusManager::WidgetFocusManager*
(...skipping 461 matching lines...) Expand 10 before | Expand all | Expand 10 after
529 std::find(focus_change_listeners_.begin(), focus_change_listeners_.end(), 529 std::find(focus_change_listeners_.begin(), focus_change_listeners_.end(),
530 listener); 530 listener);
531 if (place == focus_change_listeners_.end()) { 531 if (place == focus_change_listeners_.end()) {
532 NOTREACHED() << "Removing a listener that isn't registered."; 532 NOTREACHED() << "Removing a listener that isn't registered.";
533 return; 533 return;
534 } 534 }
535 focus_change_listeners_.erase(place); 535 focus_change_listeners_.erase(place);
536 } 536 }
537 537
538 } // namespace views 538 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/focus/focus_manager.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698