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

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

Issue 6622002: Do all OOLing in the views code. linux_views now builds clean with the clang plugin. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 9 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) 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 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 56
57 // Perform a safe iteration over the focus listeners, as the array 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 FocusManager::WidgetFocusManager::WidgetFocusManager() : enabled_(true) {}
67
68 FocusManager::WidgetFocusManager::~WidgetFocusManager() {}
69
66 // static 70 // static
67 FocusManager::WidgetFocusManager* 71 FocusManager::WidgetFocusManager*
68 FocusManager::WidgetFocusManager::GetInstance() { 72 FocusManager::WidgetFocusManager::GetInstance() {
69 return Singleton<WidgetFocusManager>::get(); 73 return Singleton<WidgetFocusManager>::get();
70 } 74 }
71 75
72 // FocusManager ----------------------------------------------------- 76 // FocusManager -----------------------------------------------------
73 77
74 FocusManager::FocusManager(Widget* widget) 78 FocusManager::FocusManager(Widget* widget)
75 : widget_(widget), 79 : widget_(widget),
(...skipping 419 matching lines...) Expand 10 before | Expand all | Expand 10 after
495 std::find(focus_change_listeners_.begin(), focus_change_listeners_.end(), 499 std::find(focus_change_listeners_.begin(), focus_change_listeners_.end(),
496 listener); 500 listener);
497 if (place == focus_change_listeners_.end()) { 501 if (place == focus_change_listeners_.end()) {
498 NOTREACHED() << "Removing a listener that isn't registered."; 502 NOTREACHED() << "Removing a listener that isn't registered.";
499 return; 503 return;
500 } 504 }
501 focus_change_listeners_.erase(place); 505 focus_change_listeners_.erase(place);
502 } 506 }
503 507
504 } // namespace views 508 } // namespace views
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698