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

Side by Side Diff: ui/gfx/sequential_id_generator.h

Issue 23498059: Remove last dependencies on ui/base from ui/gfx (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: last rebase Created 7 years, 2 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/gfx/selection_model.h ('k') | ui/gfx/shadow_value.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 (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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_GFX_SEQUENTIAL_ID_GENERATOR_H_ 5 #ifndef UI_GFX_SEQUENTIAL_ID_GENERATOR_H_
6 #define UI_GFX_SEQUENTIAL_ID_GENERATOR_H_ 6 #define UI_GFX_SEQUENTIAL_ID_GENERATOR_H_
7 7
8 #include <map> 8 #include <map>
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
11 #include "base/containers/hash_tables.h" 11 #include "base/containers/hash_tables.h"
12 #include "ui/base/ui_export.h" 12 #include "ui/gfx/gfx_export.h"
13 13
14 namespace ui { 14 namespace ui {
15 15
16 // This is used to generate a series of sequential ID numbers in a way that a 16 // This is used to generate a series of sequential ID numbers in a way that a
17 // new ID is always the lowest possible ID in the sequence. 17 // new ID is always the lowest possible ID in the sequence.
18 class UI_EXPORT SequentialIDGenerator { 18 class GFX_EXPORT SequentialIDGenerator {
19 public: 19 public:
20 // Creates a new generator with the specified lower bound for the IDs. 20 // Creates a new generator with the specified lower bound for the IDs.
21 explicit SequentialIDGenerator(uint32 min_id); 21 explicit SequentialIDGenerator(uint32 min_id);
22 ~SequentialIDGenerator(); 22 ~SequentialIDGenerator();
23 23
24 // Generates a unique ID to represent |number|. The generated ID is the 24 // Generates a unique ID to represent |number|. The generated ID is the
25 // smallest available ID greater than or equal to the |min_id| specified 25 // smallest available ID greater than or equal to the |min_id| specified
26 // during creation of the generator. 26 // during creation of the generator.
27 uint32 GetGeneratedID(uint32 number); 27 uint32 GetGeneratedID(uint32 number);
28 28
(...skipping 22 matching lines...) Expand all
51 51
52 uint32 min_id_; 52 uint32 min_id_;
53 uint32 min_available_id_; 53 uint32 min_available_id_;
54 54
55 DISALLOW_COPY_AND_ASSIGN(SequentialIDGenerator); 55 DISALLOW_COPY_AND_ASSIGN(SequentialIDGenerator);
56 }; 56 };
57 57
58 } // namespace ui 58 } // namespace ui
59 59
60 #endif // UI_GFX_SEQUENTIAL_ID_GENERATOR_H_ 60 #endif // UI_GFX_SEQUENTIAL_ID_GENERATOR_H_
OLDNEW
« no previous file with comments | « ui/gfx/selection_model.h ('k') | ui/gfx/shadow_value.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698