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

Side by Side Diff: ui/events/event_target_iterator.h

Issue 1081103008: Update {virtual,override} to follow C++11 style in ui. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 8 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
« no previous file with comments | « ui/events/event_processor_unittest.cc ('k') | ui/shell_dialogs/select_file_dialog_win.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 #ifndef UI_EVENTS_EVENT_TARGET_ITERATOR_H_ 5 #ifndef UI_EVENTS_EVENT_TARGET_ITERATOR_H_
6 #define UI_EVENTS_EVENT_TARGET_ITERATOR_H_ 6 #define UI_EVENTS_EVENT_TARGET_ITERATOR_H_
7 7
8 #include <vector> 8 #include <vector>
9 9
10 namespace ui { 10 namespace ui {
(...skipping 10 matching lines...) Expand all
21 // Provides an EventTargetIterator implementation for iterating over a list of 21 // Provides an EventTargetIterator implementation for iterating over a list of
22 // EventTargets. The list is iterated in the reverse order, since typically the 22 // EventTargets. The list is iterated in the reverse order, since typically the
23 // EventTargets are maintained in increasing z-order in the lists. 23 // EventTargets are maintained in increasing z-order in the lists.
24 template<typename T> 24 template<typename T>
25 class EventTargetIteratorImpl : public EventTargetIterator { 25 class EventTargetIteratorImpl : public EventTargetIterator {
26 public: 26 public:
27 explicit EventTargetIteratorImpl(const std::vector<T*>& children) 27 explicit EventTargetIteratorImpl(const std::vector<T*>& children)
28 : begin_(children.rbegin()), 28 : begin_(children.rbegin()),
29 end_(children.rend()) { 29 end_(children.rend()) {
30 } 30 }
31 virtual ~EventTargetIteratorImpl() {} 31 ~EventTargetIteratorImpl() override {}
32 32
33 virtual EventTarget* GetNextTarget() override { 33 EventTarget* GetNextTarget() override {
34 if (begin_ == end_) 34 if (begin_ == end_)
35 return NULL; 35 return NULL;
36 EventTarget* target = *(begin_); 36 EventTarget* target = *(begin_);
37 ++begin_; 37 ++begin_;
38 return target; 38 return target;
39 } 39 }
40 40
41 private: 41 private:
42 typename std::vector<T*>::const_reverse_iterator begin_; 42 typename std::vector<T*>::const_reverse_iterator begin_;
43 typename std::vector<T*>::const_reverse_iterator end_; 43 typename std::vector<T*>::const_reverse_iterator end_;
44 }; 44 };
45 45
46 } // namespace ui 46 } // namespace ui
47 47
48 #endif // UI_EVENTS_EVENT_TARGET_ITERATOR_H_ 48 #endif // UI_EVENTS_EVENT_TARGET_ITERATOR_H_
OLDNEW
« no previous file with comments | « ui/events/event_processor_unittest.cc ('k') | ui/shell_dialogs/select_file_dialog_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698