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

Side by Side Diff: ash/shelf/scoped_observer_with_duplicated_sources.h

Issue 1540753002: Switch to standard integer types in ash/. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: arraysize Created 5 years 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 | « ash/shelf/overflow_button.h ('k') | ash/shelf/shelf.h » ('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 ASH_SHELF_SCOPED_OBSERVER_WITH_DUPLICATED_SOURCES_H_ 5 #ifndef ASH_SHELF_SCOPED_OBSERVER_WITH_DUPLICATED_SOURCES_H_
6 #define ASH_SHELF_SCOPED_OBSERVER_WITH_DUPLICATED_SOURCES_H_ 6 #define ASH_SHELF_SCOPED_OBSERVER_WITH_DUPLICATED_SOURCES_H_
7 7
8 #include <map> 8 #include <map>
9 9
10 #include "base/basictypes.h"
11 #include "base/logging.h" 10 #include "base/logging.h"
11 #include "base/macros.h"
12 12
13 // ScopedObserverWithDuplicatedSources is used to keep track of the set of 13 // ScopedObserverWithDuplicatedSources is used to keep track of the set of
14 // sources an object has attached itself to as an observer. When 14 // sources an object has attached itself to as an observer. When
15 // ScopedObserverWithDuplicatedSources is destroyed it removes the object as an 15 // ScopedObserverWithDuplicatedSources is destroyed it removes the object as an
16 // observer from all sources it has been added to. 16 // observer from all sources it has been added to.
17 // ScopedObserverWithDuplicatedSources adds |observer| once for a particular 17 // ScopedObserverWithDuplicatedSources adds |observer| once for a particular
18 // source, no matter how many times Add() is invoked. Additionaly |observer| is 18 // source, no matter how many times Add() is invoked. Additionaly |observer| is
19 // only removed once Remove() is invoked the same number of times as Add(). 19 // only removed once Remove() is invoked the same number of times as Add().
20 20
21 template <class Source, class Observer> 21 template <class Source, class Observer>
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
61 61
62 Observer* observer_; 62 Observer* observer_;
63 63
64 // Map Source and its adding count. 64 // Map Source and its adding count.
65 std::map<Source*, int> counted_sources_; 65 std::map<Source*, int> counted_sources_;
66 66
67 DISALLOW_COPY_AND_ASSIGN(ScopedObserverWithDuplicatedSources); 67 DISALLOW_COPY_AND_ASSIGN(ScopedObserverWithDuplicatedSources);
68 }; 68 };
69 69
70 #endif // ASH_SHELF_SCOPED_OBSERVER_WITH_DUPLICATED_SOURCES_H_ 70 #endif // ASH_SHELF_SCOPED_OBSERVER_WITH_DUPLICATED_SOURCES_H_
OLDNEW
« no previous file with comments | « ash/shelf/overflow_button.h ('k') | ash/shelf/shelf.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698