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

Side by Side Diff: chrome/browser/spellcheck_host.cc

Issue 6246036: FilePath: Remove most of ToWStringHack, adding a LossyDisplayName() (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 10 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) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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/spellcheck_host.h" 5 #include "chrome/browser/spellcheck_host.h"
6 6
7 #include <fcntl.h> 7 #include <fcntl.h>
8 8
9 #include "base/file_util.h" 9 #include "base/file_util.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after
226 226
227 if (!request_context_getter_) { 227 if (!request_context_getter_) {
228 InitializeOnFileThread(); 228 InitializeOnFileThread();
229 return; 229 return;
230 } 230 }
231 231
232 // Determine URL of file to download. 232 // Determine URL of file to download.
233 static const char kDownloadServerUrl[] = 233 static const char kDownloadServerUrl[] =
234 "http://cache.pack.google.com/edgedl/chrome/dict/"; 234 "http://cache.pack.google.com/edgedl/chrome/dict/";
235 GURL url = GURL(std::string(kDownloadServerUrl) + 235 GURL url = GURL(std::string(kDownloadServerUrl) +
236 StringToLowerASCII(WideToUTF8( 236 StringToLowerASCII(UTF16ToUTF8(
237 bdict_file_path_.BaseName().ToWStringHack()))); 237 bdict_file_path_.BaseName().LossyDisplayName())));
Avi (use Gerrit) 2011/02/01 22:46:25 Whoa. LossyDisplayName is for display, not as a ge
238 fetcher_.reset(new URLFetcher(url, URLFetcher::GET, this)); 238 fetcher_.reset(new URLFetcher(url, URLFetcher::GET, this));
239 fetcher_->set_request_context(request_context_getter_); 239 fetcher_->set_request_context(request_context_getter_);
240 tried_to_download_ = true; 240 tried_to_download_ = true;
241 fetcher_->Start(); 241 fetcher_->Start();
242 request_context_getter_ = NULL; 242 request_context_getter_ = NULL;
243 } 243 }
244 244
245 void SpellCheckHost::WriteWordToCustomDictionary(const std::string& word) { 245 void SpellCheckHost::WriteWordToCustomDictionary(const std::string& word) {
246 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); 246 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE));
247 247
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
320 BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, 320 BrowserThread::PostTask(BrowserThread::UI, FROM_HERE,
321 NewRunnableMethod(this, 321 NewRunnableMethod(this,
322 &SpellCheckHost::InformObserverOfInitialization)); 322 &SpellCheckHost::InformObserverOfInitialization));
323 return; 323 return;
324 } 324 }
325 } 325 }
326 326
327 data_.clear(); 327 data_.clear();
328 Initialize(); 328 Initialize();
329 } 329 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698