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

Side by Side Diff: chrome/browser/spellchecker/spellcheck_hunspell_dictionary.cc

Issue 14113053: chrome: Use base::MessageLoop. (Part 3) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase again Created 7 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
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/spellchecker/spellcheck_hunspell_dictionary.h" 5 #include "chrome/browser/spellchecker/spellcheck_hunspell_dictionary.h"
6 6
7 #include "base/file_util.h" 7 #include "base/file_util.h"
8 #include "base/files/memory_mapped_file.h" 8 #include "base/files/memory_mapped_file.h"
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/message_loop.h" 10 #include "base/message_loop.h"
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after
175 } 175 }
176 176
177 void SpellcheckHunspellDictionary::Load() { 177 void SpellcheckHunspellDictionary::Load() {
178 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 178 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
179 179
180 #if defined(OS_MACOSX) 180 #if defined(OS_MACOSX)
181 if (spellcheck_mac::SpellCheckerAvailable() && 181 if (spellcheck_mac::SpellCheckerAvailable() &&
182 spellcheck_mac::PlatformSupportsLanguage(language_)) { 182 spellcheck_mac::PlatformSupportsLanguage(language_)) {
183 use_platform_spellchecker_ = true; 183 use_platform_spellchecker_ = true;
184 spellcheck_mac::SetLanguage(language_); 184 spellcheck_mac::SetLanguage(language_);
185 MessageLoop::current()->PostTask(FROM_HERE, 185 base::MessageLoop::current()->PostTask(FROM_HERE,
186 base::Bind( 186 base::Bind(
187 &SpellcheckHunspellDictionary::InformListenersOfInitialization, 187 &SpellcheckHunspellDictionary::InformListenersOfInitialization,
188 weak_ptr_factory_.GetWeakPtr())); 188 weak_ptr_factory_.GetWeakPtr()));
189 return; 189 return;
190 } 190 }
191 #endif // OS_MACOSX 191 #endif // OS_MACOSX
192 192
193 BrowserThread::PostTaskAndReplyWithResult( 193 BrowserThread::PostTaskAndReplyWithResult(
194 BrowserThread::FILE, 194 BrowserThread::FILE,
195 FROM_HERE, 195 FROM_HERE,
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after
356 void SpellcheckHunspellDictionary::InformListenersOfInitialization() { 356 void SpellcheckHunspellDictionary::InformListenersOfInitialization() {
357 FOR_EACH_OBSERVER(Observer, observers_, OnHunspellDictionaryInitialized()); 357 FOR_EACH_OBSERVER(Observer, observers_, OnHunspellDictionaryInitialized());
358 } 358 }
359 359
360 void SpellcheckHunspellDictionary::InformListenersOfDownloadFailure() { 360 void SpellcheckHunspellDictionary::InformListenersOfDownloadFailure() {
361 download_status_ = DOWNLOAD_FAILED; 361 download_status_ = DOWNLOAD_FAILED;
362 FOR_EACH_OBSERVER(Observer, 362 FOR_EACH_OBSERVER(Observer,
363 observers_, 363 observers_,
364 OnHunspellDictionaryDownloadFailure()); 364 OnHunspellDictionaryDownloadFailure());
365 } 365 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698