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

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

Issue 2063863002: Use DCHECKs when observing only a single notification. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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
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 <set> 7 #include <set>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/strings/string_split.h" 10 #include "base/strings/string_split.h"
(...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after
255 } 255 }
256 256
257 bool SpellcheckService::UnloadExternalDictionary( 257 bool SpellcheckService::UnloadExternalDictionary(
258 const std::string& /* path */) { 258 const std::string& /* path */) {
259 return false; 259 return false;
260 } 260 }
261 261
262 void SpellcheckService::Observe(int type, 262 void SpellcheckService::Observe(int type,
263 const content::NotificationSource& source, 263 const content::NotificationSource& source,
264 const content::NotificationDetails& details) { 264 const content::NotificationDetails& details) {
265 DCHECK(type == content::NOTIFICATION_RENDERER_PROCESS_CREATED); 265 DCHECK_EQ(content::NOTIFICATION_RENDERER_PROCESS_CREATED, type);
266 content::RenderProcessHost* process = 266 InitForRenderer(content::Source<content::RenderProcessHost>(source).ptr());
267 content::Source<content::RenderProcessHost>(source).ptr();
268 InitForRenderer(process);
269 } 267 }
270 268
271 void SpellcheckService::OnCustomDictionaryLoaded() { 269 void SpellcheckService::OnCustomDictionaryLoaded() {
272 InitForAllRenderers(); 270 InitForAllRenderers();
273 } 271 }
274 272
275 void SpellcheckService::OnCustomDictionaryChanged( 273 void SpellcheckService::OnCustomDictionaryChanged(
276 const SpellcheckCustomDictionary::Change& dictionary_change) { 274 const SpellcheckCustomDictionary::Change& dictionary_change) {
277 for (content::RenderProcessHost::iterator i( 275 for (content::RenderProcessHost::iterator i(
278 content::RenderProcessHost::AllHostsIterator()); 276 content::RenderProcessHost::AllHostsIterator());
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
378 chrome::spellcheck_common::GetISOLanguageCountryCodeFromLocale( 376 chrome::spellcheck_common::GetISOLanguageCountryCodeFromLocale(
379 feedback_language, &language_code, &country_code); 377 feedback_language, &language_code, &country_code);
380 feedback_sender_->OnLanguageCountryChange(language_code, country_code); 378 feedback_sender_->OnLanguageCountryChange(language_code, country_code);
381 if (SpellingServiceClient::IsAvailable( 379 if (SpellingServiceClient::IsAvailable(
382 context_, SpellingServiceClient::SPELLCHECK)) { 380 context_, SpellingServiceClient::SPELLCHECK)) {
383 feedback_sender_->StartFeedbackCollection(); 381 feedback_sender_->StartFeedbackCollection();
384 } else { 382 } else {
385 feedback_sender_->StopFeedbackCollection(); 383 feedback_sender_->StopFeedbackCollection();
386 } 384 }
387 } 385 }
OLDNEW
« no previous file with comments | « chrome/browser/service_process/service_process_control.cc ('k') | chrome/browser/ssl/captive_portal_metrics_recorder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698