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

Side by Side Diff: chrome/browser/extensions/api/language_settings_private/language_settings_private_delegate.cc

Issue 2172043002: chrome/browser/extensions: Change auto to not deduce raw pointers. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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/extensions/api/language_settings_private/language_setti ngs_private_delegate.h" 5 #include "chrome/browser/extensions/api/language_settings_private/language_setti ngs_private_delegate.h"
6 6
7 #include <memory> 7 #include <memory>
8 #include <string> 8 #include <string>
9 #include <utility> 9 #include <utility>
10 #include <vector> 10 #include <vector>
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after
175 if (was_listening) 175 if (was_listening)
176 RemoveDictionaryObservers(); 176 RemoveDictionaryObservers();
177 hunspell_dictionaries_.clear(); 177 hunspell_dictionaries_.clear();
178 SpellcheckService* service = SpellcheckServiceFactory::GetForContext( 178 SpellcheckService* service = SpellcheckServiceFactory::GetForContext(
179 context_); 179 context_);
180 if (!custom_dictionary_) 180 if (!custom_dictionary_)
181 custom_dictionary_ = service->GetCustomDictionary(); 181 custom_dictionary_ = service->GetCustomDictionary();
182 182
183 const ScopedVector<SpellcheckHunspellDictionary>& dictionaries( 183 const ScopedVector<SpellcheckHunspellDictionary>& dictionaries(
184 service->GetHunspellDictionaries()); 184 service->GetHunspellDictionaries());
185 for (const auto& dictionary : dictionaries) { 185 for (auto* dictionary : dictionaries) {
186 hunspell_dictionaries_.push_back(dictionary->AsWeakPtr()); 186 hunspell_dictionaries_.push_back(dictionary->AsWeakPtr());
187 if (should_listen) 187 if (should_listen)
188 dictionary->AddObserver(this); 188 dictionary->AddObserver(this);
189 } 189 }
190 } 190 }
191 191
192 const LanguageSettingsPrivateDelegate::WeakDictionaries& 192 const LanguageSettingsPrivateDelegate::WeakDictionaries&
193 LanguageSettingsPrivateDelegate::GetHunspellDictionaries() { 193 LanguageSettingsPrivateDelegate::GetHunspellDictionaries() {
194 // If there are no hunspell dictionaries, or the first is invalid, refresh. 194 // If there are no hunspell dictionaries, or the first is invalid, refresh.
195 if (hunspell_dictionaries_.empty() || !hunspell_dictionaries_.front()) 195 if (hunspell_dictionaries_.empty() || !hunspell_dictionaries_.front())
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
248 } 248 }
249 249
250 void LanguageSettingsPrivateDelegate::RemoveDictionaryObservers() { 250 void LanguageSettingsPrivateDelegate::RemoveDictionaryObservers() {
251 for (const auto& dictionary : hunspell_dictionaries_) { 251 for (const auto& dictionary : hunspell_dictionaries_) {
252 if (dictionary) 252 if (dictionary)
253 dictionary->RemoveObserver(this); 253 dictionary->RemoveObserver(this);
254 } 254 }
255 } 255 }
256 256
257 } // namespace extensions 257 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/browser/extensions/api/file_system/file_system_api.cc ('k') | chrome/browser/extensions/api/tabs/tabs_api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698