| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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.h" | 5 #include "chrome/browser/spellchecker.h" |
| 6 #include "base/basictypes.h" | 6 #include "base/basictypes.h" |
| 7 #include "base/compiler_specific.h" | 7 #include "base/compiler_specific.h" |
| 8 #include "base/file_util.h" | 8 #include "base/file_util.h" |
| 9 #include "base/histogram.h" | 9 #include "base/histogram.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 367 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 378 const FilePath& custom_dictionary_file_name) | 378 const FilePath& custom_dictionary_file_name) |
| 379 : custom_dictionary_file_name_(custom_dictionary_file_name), | 379 : custom_dictionary_file_name_(custom_dictionary_file_name), |
| 380 tried_to_init_(false), | 380 tried_to_init_(false), |
| 381 #ifndef NDEBUG | 381 #ifndef NDEBUG |
| 382 worker_loop_(NULL), | 382 worker_loop_(NULL), |
| 383 #endif | 383 #endif |
| 384 tried_to_download_(false), | 384 tried_to_download_(false), |
| 385 file_loop_(NULL), | 385 file_loop_(NULL), |
| 386 url_request_context_(request_context), | 386 url_request_context_(request_context), |
| 387 dic_is_downloading_(false), | 387 dic_is_downloading_(false), |
| 388 ALLOW_THIS_IN_INITIALIZER_LIST(dic_download_state_changer_factory_(this))
{ | 388 ALLOW_THIS_IN_INITIALIZER_LIST( |
| 389 dic_download_state_changer_factory_(this)) { |
| 389 // Remember UI loop to later use this as a proxy to get IO loop. | 390 // Remember UI loop to later use this as a proxy to get IO loop. |
| 390 ui_loop_ = MessageLoop::current(); | 391 ui_loop_ = MessageLoop::current(); |
| 391 | 392 |
| 392 // Get File Loop - hunspell gets initialized here. | 393 // Get File Loop - hunspell gets initialized here. |
| 393 base::Thread* file_thread = g_browser_process->file_thread(); | 394 base::Thread* file_thread = g_browser_process->file_thread(); |
| 394 if (file_thread) | 395 if (file_thread) |
| 395 file_loop_ = file_thread->message_loop(); | 396 file_loop_ = file_thread->message_loop(); |
| 396 | 397 |
| 397 // Get the path to the spellcheck file. | 398 // Get the path to the spellcheck file. |
| 398 bdict_file_name_ = GetVersionedFileName(language, dict_dir); | 399 bdict_file_name_ = GetVersionedFileName(language, dict_dir); |
| (...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 621 hunspell_->put_word(word_to_add.c_str()); | 622 hunspell_->put_word(word_to_add.c_str()); |
| 622 | 623 |
| 623 // Now add the word to the custom dictionary file. | 624 // Now add the word to the custom dictionary file. |
| 624 Task* write_word_task = | 625 Task* write_word_task = |
| 625 new AddWordToCustomDictionaryTask(custom_dictionary_file_name_, word); | 626 new AddWordToCustomDictionaryTask(custom_dictionary_file_name_, word); |
| 626 if (file_loop_) | 627 if (file_loop_) |
| 627 file_loop_->PostTask(FROM_HERE, write_word_task); | 628 file_loop_->PostTask(FROM_HERE, write_word_task); |
| 628 else | 629 else |
| 629 write_word_task->Run(); | 630 write_word_task->Run(); |
| 630 } | 631 } |
| OLD | NEW |