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

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

Issue 120983002: Update some uses of UTF conversions in chrome/browser to use the base:: namespace. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 12 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/about_signin_internals.h" 5 #include "chrome/browser/signin/about_signin_internals.h"
6 6
7 #include "base/debug/trace_event.h" 7 #include "base/debug/trace_event.h"
8 #include "base/hash.h" 8 #include "base/hash.h"
9 #include "base/i18n/time_formatting.h" 9 #include "base/i18n/time_formatting.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
52 } 52 }
53 53
54 void AboutSigninInternals::NotifySigninValueChanged( 54 void AboutSigninInternals::NotifySigninValueChanged(
55 const TimedSigninStatusField& field, 55 const TimedSigninStatusField& field,
56 const std::string& value) { 56 const std::string& value) {
57 unsigned int field_index = field - TIMED_FIELDS_BEGIN; 57 unsigned int field_index = field - TIMED_FIELDS_BEGIN;
58 DCHECK(field_index >= 0 && 58 DCHECK(field_index >= 0 &&
59 field_index < signin_status_.timed_signin_fields.size()); 59 field_index < signin_status_.timed_signin_fields.size());
60 60
61 Time now = Time::NowFromSystemTime(); 61 Time now = Time::NowFromSystemTime();
62 std::string time_as_str = UTF16ToUTF8(base::TimeFormatFriendlyDate(now)); 62 std::string time_as_str =
63 base::UTF16ToUTF8(base::TimeFormatFriendlyDate(now));
63 TimedSigninStatusValue timed_value(value, time_as_str); 64 TimedSigninStatusValue timed_value(value, time_as_str);
64 65
65 signin_status_.timed_signin_fields[field_index] = timed_value; 66 signin_status_.timed_signin_fields[field_index] = timed_value;
66 67
67 // Also persist these values in the prefs. 68 // Also persist these values in the prefs.
68 const std::string value_pref = SigninStatusFieldToString(field) + ".value"; 69 const std::string value_pref = SigninStatusFieldToString(field) + ".value";
69 const std::string time_pref = SigninStatusFieldToString(field) + ".time"; 70 const std::string time_pref = SigninStatusFieldToString(field) + ".time";
70 profile_->GetPrefs()->SetString(value_pref.c_str(), value); 71 profile_->GetPrefs()->SetString(value_pref.c_str(), value);
71 profile_->GetPrefs()->SetString(time_pref.c_str(), time_as_str); 72 profile_->GetPrefs()->SetString(time_pref.c_str(), time_as_str);
72 73
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
133 } 134 }
134 135
135 Time AboutSigninInternals::GetTokenTime( 136 Time AboutSigninInternals::GetTokenTime(
136 const std::string& token_name) const { 137 const std::string& token_name) const {
137 TokenInfoMap::const_iterator iter = 138 TokenInfoMap::const_iterator iter =
138 signin_status_.token_info_map.find(token_name); 139 signin_status_.token_info_map.find(token_name);
139 if (iter == signin_status_.token_info_map.end()) 140 if (iter == signin_status_.token_info_map.end())
140 return base::Time(); 141 return base::Time();
141 return base::Time::FromInternalValue(iter->second.time_internal); 142 return base::Time::FromInternalValue(iter->second.time_internal);
142 } 143 }
OLDNEW
« no previous file with comments | « chrome/browser/shell_integration_win_unittest.cc ('k') | chrome/browser/signin/signin_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698