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

Side by Side Diff: views/focus/view_storage.h

Issue 5685007: Rename all methods accessing Singleton<T> as GetInstance(). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 10 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 | Annotate | Revision Log
« no previous file with comments | « views/focus/focus_manager.cc ('k') | views/focus/view_storage.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 (c) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 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 VIEWS_FOCUS_VIEW_STORAGE_H_ 5 #ifndef VIEWS_FOCUS_VIEW_STORAGE_H_
6 #define VIEWS_FOCUS_VIEW_STORAGE_H_ 6 #define VIEWS_FOCUS_VIEW_STORAGE_H_
7 #pragma once 7 #pragma once
8 8
9 #include "base/singleton.h" 9 #include "base/singleton.h"
10 #include "views/view.h" 10 #include "views/view.h"
11 11
12 // This class is a simple storage place for storing/retrieving views. It is 12 // This class is a simple storage place for storing/retrieving views. It is
13 // used for example in the FocusManager to store/restore focused views when the 13 // used for example in the FocusManager to store/restore focused views when the
14 // main window becomes active/inactive. 14 // main window becomes active/inactive.
15 // It automatically removes a view from the storage if the view is removed from 15 // It automatically removes a view from the storage if the view is removed from
16 // the tree hierarchy. 16 // the tree hierarchy.
17 // 17 //
18 // To use it, you first need to create a view storage id that can then be used 18 // To use it, you first need to create a view storage id that can then be used
19 // to store/retrieve views. 19 // to store/retrieve views.
20 20
21 namespace views { 21 namespace views {
22 22
23 class ViewStorage { 23 class ViewStorage {
24 public: 24 public:
25 // Returns the global ViewStorage instance. 25 // Returns the global ViewStorage instance.
26 // It is guaranted to be non NULL. 26 // It is guaranted to be non NULL.
27 static ViewStorage* GetSharedInstance(); 27 static ViewStorage* GetInstance();
28 28
29 // Returns a unique storage id that can be used to store/retrieve views. 29 // Returns a unique storage id that can be used to store/retrieve views.
30 int CreateStorageID(); 30 int CreateStorageID();
31 31
32 // Associates |view| with the specified |storage_id|. 32 // Associates |view| with the specified |storage_id|.
33 void StoreView(int storage_id, View* view); 33 void StoreView(int storage_id, View* view);
34 34
35 // Returns the view associated with |storage_id| if any, NULL otherwise. 35 // Returns the view associated with |storage_id| if any, NULL otherwise.
36 View* RetrieveView(int storage_id); 36 View* RetrieveView(int storage_id);
37 37
(...skipping 25 matching lines...) Expand all
63 63
64 // Association View to id, used to speed up view notification removal. 64 // Association View to id, used to speed up view notification removal.
65 std::map<View*, std::vector<int>*> view_to_ids_; 65 std::map<View*, std::vector<int>*> view_to_ids_;
66 66
67 DISALLOW_COPY_AND_ASSIGN(ViewStorage); 67 DISALLOW_COPY_AND_ASSIGN(ViewStorage);
68 }; 68 };
69 69
70 } // namespace views 70 } // namespace views
71 71
72 #endif // VIEWS_FOCUS_VIEW_STORAGE_H_ 72 #endif // VIEWS_FOCUS_VIEW_STORAGE_H_
OLDNEW
« no previous file with comments | « views/focus/focus_manager.cc ('k') | views/focus/view_storage.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698