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

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

Issue 16207005: Fix remaining uses of WeakPtr<T>'s operator T* conversion (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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_service.h" 5 #include "chrome/browser/spellchecker/spellcheck_service.h"
6 6
7 #include "base/platform_file.h" 7 #include "base/platform_file.h"
8 #include "base/prefs/pref_member.h" 8 #include "base/prefs/pref_member.h"
9 #include "base/prefs/pref_service.h" 9 #include "base/prefs/pref_service.h"
10 #include "base/strings/string_split.h" 10 #include "base/strings/string_split.h"
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 prefs::kEnableContinuousSpellcheck, 65 prefs::kEnableContinuousSpellcheck,
66 base::Bind(&SpellcheckService::InitForAllRenderers, 66 base::Bind(&SpellcheckService::InitForAllRenderers,
67 base::Unretained(this))); 67 base::Unretained(this)));
68 68
69 OnSpellCheckDictionaryChanged(); 69 OnSpellCheckDictionaryChanged();
70 70
71 custom_dictionary_.reset(new SpellcheckCustomDictionary(profile_->GetPath())); 71 custom_dictionary_.reset(new SpellcheckCustomDictionary(profile_->GetPath()));
72 custom_dictionary_->AddObserver(this); 72 custom_dictionary_->AddObserver(this);
73 custom_dictionary_->Load(); 73 custom_dictionary_->Load();
74 74
75 registrar_.Add(weak_ptr_factory_.GetWeakPtr(), 75 registrar_.Add(this,
76 content::NOTIFICATION_RENDERER_PROCESS_CREATED, 76 content::NOTIFICATION_RENDERER_PROCESS_CREATED,
77 content::NotificationService::AllSources()); 77 content::NotificationService::AllSources());
78 } 78 }
79 79
80 SpellcheckService::~SpellcheckService() { 80 SpellcheckService::~SpellcheckService() {
81 // Remove pref observers 81 // Remove pref observers
82 pref_change_registrar_.RemoveAll(); 82 pref_change_registrar_.RemoveAll();
83 } 83 }
84 84
85 // static 85 // static
(...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after
304 dictionary, &language_code, &country_code); 304 dictionary, &language_code, &country_code);
305 feedback_sender_->OnLanguageCountryChange(language_code, country_code); 305 feedback_sender_->OnLanguageCountryChange(language_code, country_code);
306 } 306 }
307 307
308 void SpellcheckService::OnUseSpellingServiceChanged() { 308 void SpellcheckService::OnUseSpellingServiceChanged() {
309 bool enabled = pref_change_registrar_.prefs()->GetBoolean( 309 bool enabled = pref_change_registrar_.prefs()->GetBoolean(
310 prefs::kSpellCheckUseSpellingService); 310 prefs::kSpellCheckUseSpellingService);
311 if (metrics_) 311 if (metrics_)
312 metrics_->RecordSpellingServiceStats(enabled); 312 metrics_->RecordSpellingServiceStats(enabled);
313 } 313 }
OLDNEW
« no previous file with comments | « chrome/browser/spellchecker/spellcheck_hunspell_dictionary.cc ('k') | chrome/browser/sync/profile_sync_service_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698