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

Side by Side Diff: chrome/browser/chromeos/login/screens/screen_context.h

Issue 328763003: Added usefull utility methods to Screen and ScreenContext. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Comments addressed. Created 6 years, 6 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 | « no previous file | chrome/browser/chromeos/login/screens/screen_context.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) 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 CHROME_BROWSER_CHROMEOS_LOGIN_SCREENS_SCREEN_CONTEXT_H_ 5 #ifndef CHROME_BROWSER_CHROMEOS_LOGIN_SCREENS_SCREEN_CONTEXT_H_
6 #define CHROME_BROWSER_CHROMEOS_LOGIN_SCREENS_SCREEN_CONTEXT_H_ 6 #define CHROME_BROWSER_CHROMEOS_LOGIN_SCREENS_SCREEN_CONTEXT_H_
7 7
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
64 // Returns true if there was changes since last call to 64 // Returns true if there was changes since last call to
65 // GetChangesAndReset(). 65 // GetChangesAndReset().
66 bool HasChanges() const; 66 bool HasChanges() const;
67 67
68 // Stores all changes since the last call to the 68 // Stores all changes since the last call to the
69 // GetChangesAndReset() in |diff|. All previous contents of |diff| 69 // GetChangesAndReset() in |diff|. All previous contents of |diff|
70 // will be thrown away. 70 // will be thrown away.
71 void GetChangesAndReset(base::DictionaryValue* diff); 71 void GetChangesAndReset(base::DictionaryValue* diff);
72 72
73 // Applies changes from |diff| to the context. All keys from |diff| 73 // Applies changes from |diff| to the context. All keys from |diff|
74 // are stored in |keys|. 74 // are stored in |keys|. |keys| argument is optional and can be NULL.
75 void ApplyChanges(const base::DictionaryValue& diff, 75 void ApplyChanges(const base::DictionaryValue& diff,
76 std::vector<std::string>* keys); 76 std::vector<std::string>* keys);
77 77
78 private: 78 private:
79 bool Set(const KeyType& key, base::Value* value); 79 bool Set(const KeyType& key, base::Value* value);
80 80
81 template<typename T> 81 template<typename T>
82 T Get(const KeyType& key) { 82 T Get(const KeyType& key) {
83 DCHECK(CalledOnValidThread()); 83 DCHECK(CalledOnValidThread());
84 const base::Value* value; 84 const base::Value* value;
(...skipping 20 matching lines...) Expand all
105 105
106 // Contains all pending changes. 106 // Contains all pending changes.
107 base::DictionaryValue changes_; 107 base::DictionaryValue changes_;
108 108
109 DISALLOW_COPY_AND_ASSIGN(ScreenContext); 109 DISALLOW_COPY_AND_ASSIGN(ScreenContext);
110 }; 110 };
111 111
112 } // namespace chromeos 112 } // namespace chromeos
113 113
114 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_SCREENS_SCREEN_CONTEXT_H_ 114 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_SCREENS_SCREEN_CONTEXT_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/chromeos/login/screens/screen_context.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698