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

Side by Side Diff: chrome/browser/sync/glue/synced_device_tracker.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/sync/glue/synced_device_tracker.h" 5 #include "chrome/browser/sync/glue/synced_device_tracker.h"
6 6
7 #include "base/strings/stringprintf.h" 7 #include "base/strings/stringprintf.h"
8 #include "base/strings/utf_string_conversions.h" 8 #include "base/strings/utf_string_conversions.h"
9 #include "chrome/browser/sync/glue/device_info.h" 9 #include "chrome/browser/sync/glue/device_info.h"
10 #include "sync/internal_api/public/base/model_type.h" 10 #include "sync/internal_api/public/base/model_type.h"
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after
172 172
173 void SyncedDeviceTracker::WriteDeviceInfo( 173 void SyncedDeviceTracker::WriteDeviceInfo(
174 const sync_pb::DeviceInfoSpecifics& specifics, 174 const sync_pb::DeviceInfoSpecifics& specifics,
175 const std::string& tag) { 175 const std::string& tag) {
176 syncer::WriteTransaction trans(FROM_HERE, user_share_); 176 syncer::WriteTransaction trans(FROM_HERE, user_share_);
177 syncer::WriteNode node(&trans); 177 syncer::WriteNode node(&trans);
178 178
179 if (node.InitByClientTagLookup(syncer::DEVICE_INFO, tag) == 179 if (node.InitByClientTagLookup(syncer::DEVICE_INFO, tag) ==
180 syncer::BaseNode::INIT_OK) { 180 syncer::BaseNode::INIT_OK) {
181 node.SetDeviceInfoSpecifics(specifics); 181 node.SetDeviceInfoSpecifics(specifics);
182 node.SetTitle(UTF8ToWide(specifics.client_name())); 182 node.SetTitle(base::UTF8ToWide(specifics.client_name()));
183 } else { 183 } else {
184 syncer::ReadNode type_root(&trans); 184 syncer::ReadNode type_root(&trans);
185 syncer::BaseNode::InitByLookupResult type_root_lookup_result = 185 syncer::BaseNode::InitByLookupResult type_root_lookup_result =
186 type_root.InitByTagLookup(ModelTypeToRootTag(syncer::DEVICE_INFO)); 186 type_root.InitByTagLookup(ModelTypeToRootTag(syncer::DEVICE_INFO));
187 DCHECK_EQ(syncer::BaseNode::INIT_OK, type_root_lookup_result); 187 DCHECK_EQ(syncer::BaseNode::INIT_OK, type_root_lookup_result);
188 188
189 syncer::WriteNode new_node(&trans); 189 syncer::WriteNode new_node(&trans);
190 syncer::WriteNode::InitUniqueByCreationResult create_result = 190 syncer::WriteNode::InitUniqueByCreationResult create_result =
191 new_node.InitUniqueByCreation(syncer::DEVICE_INFO, 191 new_node.InitUniqueByCreation(syncer::DEVICE_INFO,
192 type_root, 192 type_root,
193 tag); 193 tag);
194 DCHECK_EQ(syncer::WriteNode::INIT_SUCCESS, create_result); 194 DCHECK_EQ(syncer::WriteNode::INIT_SUCCESS, create_result);
195 new_node.SetDeviceInfoSpecifics(specifics); 195 new_node.SetDeviceInfoSpecifics(specifics);
196 new_node.SetTitle(UTF8ToWide(specifics.client_name())); 196 new_node.SetTitle(base::UTF8ToWide(specifics.client_name()));
197 } 197 }
198 } 198 }
199 199
200 } // namespace browser_sync 200 } // namespace browser_sync
OLDNEW
« no previous file with comments | « chrome/browser/sync/glue/session_sync_test_helper.cc ('k') | chrome/browser/sync/glue/synced_session_tracker.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698