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

Side by Side Diff: chrome/browser/signin/signin_internals_util.cc

Issue 13145003: Rewrite std::string("") to std::string(), Linux edition. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Ugh Created 7 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 #include "chrome/browser/signin/signin_internals_util.h" 5 #include "chrome/browser/signin/signin_internals_util.h"
6 6
7 #include <sstream> 7 #include <sstream>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/strings/string_number_conversions.h" 10 #include "base/strings/string_number_conversions.h"
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
91 } 91 }
92 92
93 #define ENUM_CASE(x) case x: return (std::string(kSigninPrefPrefix) + #x) 93 #define ENUM_CASE(x) case x: return (std::string(kSigninPrefPrefix) + #x)
94 std::string SigninStatusFieldToString(UntimedSigninStatusField field) { 94 std::string SigninStatusFieldToString(UntimedSigninStatusField field) {
95 switch (field) { 95 switch (field) {
96 ENUM_CASE(USERNAME); 96 ENUM_CASE(USERNAME);
97 ENUM_CASE(SID); 97 ENUM_CASE(SID);
98 ENUM_CASE(LSID); 98 ENUM_CASE(LSID);
99 case UNTIMED_FIELDS_END: 99 case UNTIMED_FIELDS_END:
100 NOTREACHED(); 100 NOTREACHED();
101 return ""; 101 return std::string();
102 } 102 }
103 103
104 NOTREACHED(); 104 NOTREACHED();
105 return ""; 105 return std::string();
106 } 106 }
107 107
108 std::string SigninStatusFieldToString(TimedSigninStatusField field) { 108 std::string SigninStatusFieldToString(TimedSigninStatusField field) {
109 switch (field) { 109 switch (field) {
110 ENUM_CASE(SIGNIN_TYPE); 110 ENUM_CASE(SIGNIN_TYPE);
111 ENUM_CASE(CLIENT_LOGIN_STATUS); 111 ENUM_CASE(CLIENT_LOGIN_STATUS);
112 ENUM_CASE(OAUTH_LOGIN_STATUS); 112 ENUM_CASE(OAUTH_LOGIN_STATUS);
113 ENUM_CASE(GET_USER_INFO_STATUS); 113 ENUM_CASE(GET_USER_INFO_STATUS);
114 case TIMED_FIELDS_END: 114 case TIMED_FIELDS_END:
115 NOTREACHED(); 115 NOTREACHED();
116 return ""; 116 return std::string();
117 } 117 }
118 118
119 NOTREACHED(); 119 NOTREACHED();
120 return ""; 120 return std::string();
121 } 121 }
122 122
123 SigninStatus::SigninStatus() 123 SigninStatus::SigninStatus()
124 :untimed_signin_fields(UNTIMED_FIELDS_COUNT), 124 :untimed_signin_fields(UNTIMED_FIELDS_COUNT),
125 timed_signin_fields(TIMED_FIELDS_COUNT) { 125 timed_signin_fields(TIMED_FIELDS_COUNT) {
126 } 126 }
127 127
128 SigninStatus::~SigninStatus() { 128 SigninStatus::~SigninStatus() {
129 } 129 }
130 130
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
196 std::string SigninStatusFieldToLabel(UntimedSigninStatusField field) { 196 std::string SigninStatusFieldToLabel(UntimedSigninStatusField field) {
197 switch (field) { 197 switch (field) {
198 case USERNAME: 198 case USERNAME:
199 return "User Id"; 199 return "User Id";
200 case LSID: 200 case LSID:
201 return "Lsid (Hash)"; 201 return "Lsid (Hash)";
202 case SID: 202 case SID:
203 return "Sid (Hash)"; 203 return "Sid (Hash)";
204 case UNTIMED_FIELDS_END: 204 case UNTIMED_FIELDS_END:
205 NOTREACHED(); 205 NOTREACHED();
206 return ""; 206 return std::string();
207 } 207 }
208 NOTREACHED(); 208 NOTREACHED();
209 return ""; 209 return std::string();
210 } 210 }
211 211
212 TimedSigninStatusValue SigninStatusFieldToLabel( 212 TimedSigninStatusValue SigninStatusFieldToLabel(
213 TimedSigninStatusField field) { 213 TimedSigninStatusField field) {
214 switch (field) { 214 switch (field) {
215 case SIGNIN_TYPE: 215 case SIGNIN_TYPE:
216 return TimedSigninStatusValue("Type", "Time"); 216 return TimedSigninStatusValue("Type", "Time");
217 case CLIENT_LOGIN_STATUS: 217 case CLIENT_LOGIN_STATUS:
218 return TimedSigninStatusValue("Last OnClientLogin Status", 218 return TimedSigninStatusValue("Last OnClientLogin Status",
219 "Last OnClientLogin Time"); 219 "Last OnClientLogin Time");
220 case OAUTH_LOGIN_STATUS: 220 case OAUTH_LOGIN_STATUS:
221 return TimedSigninStatusValue("Last OnOAuthLogin Status", 221 return TimedSigninStatusValue("Last OnOAuthLogin Status",
222 "Last OnOAuthLogin Time"); 222 "Last OnOAuthLogin Time");
223 223
224 case GET_USER_INFO_STATUS: 224 case GET_USER_INFO_STATUS:
225 return TimedSigninStatusValue("Last OnGetUserInfo Status", 225 return TimedSigninStatusValue("Last OnGetUserInfo Status",
226 "Last OnGetUserInfo Time"); 226 "Last OnGetUserInfo Time");
227 case TIMED_FIELDS_END: 227 case TIMED_FIELDS_END:
228 NOTREACHED(); 228 NOTREACHED();
229 return TimedSigninStatusValue("Error", ""); 229 return TimedSigninStatusValue("Error", std::string());
230 } 230 }
231 NOTREACHED(); 231 NOTREACHED();
232 return TimedSigninStatusValue("Error", ""); 232 return TimedSigninStatusValue("Error", std::string());
233 } 233 }
234 234
235 } // namespace 235 } // namespace
236 236
237 scoped_ptr<DictionaryValue> SigninStatus::ToValue() { 237 scoped_ptr<DictionaryValue> SigninStatus::ToValue() {
238 scoped_ptr<DictionaryValue> signin_status(new DictionaryValue()); 238 scoped_ptr<DictionaryValue> signin_status(new DictionaryValue());
239 ListValue* signin_info = new ListValue(); 239 ListValue* signin_info = new ListValue();
240 signin_status->Set("signin_info", signin_info); 240 signin_status->Set("signin_info", signin_info);
241 241
242 // A summary of signin related info first. 242 // A summary of signin related info first.
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
284 for (std::map<std::string, TokenInfo>::iterator it = token_info_map.begin(); 284 for (std::map<std::string, TokenInfo>::iterator it = token_info_map.begin();
285 it != token_info_map.end(); ++it) { 285 it != token_info_map.end(); ++it) {
286 DictionaryValue* token_info = it->second.ToValue(); 286 DictionaryValue* token_info = it->second.ToValue();
287 token_details->Append(token_info); 287 token_details->Append(token_info);
288 } 288 }
289 289
290 return signin_status.Pass(); 290 return signin_status.Pass();
291 } 291 }
292 292
293 } // namespace signin_internals_util 293 } // namespace signin_internals_util
OLDNEW
« no previous file with comments | « chrome/browser/signin/oauth2_token_service_unittest.cc ('k') | chrome/browser/signin/signin_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698