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

Unified Diff: chrome/browser/extensions/api/language_settings_private/language_settings_private_delegate.cc

Issue 1825913002: [Extensions] Convert APIs to use movable types [7] (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Steven's Created 4 years, 9 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/extensions/api/language_settings_private/language_settings_private_delegate.cc
diff --git a/chrome/browser/extensions/api/language_settings_private/language_settings_private_delegate.cc b/chrome/browser/extensions/api/language_settings_private/language_settings_private_delegate.cc
index c2947e11f783e76e1c8e9b4c93e7882035fbc619..718a19c8aaa644cef8548fb9f76ffe242b61c723 100644
--- a/chrome/browser/extensions/api/language_settings_private/language_settings_private_delegate.cc
+++ b/chrome/browser/extensions/api/language_settings_private/language_settings_private_delegate.cc
@@ -70,21 +70,20 @@ LanguageSettingsPrivateDelegate* LanguageSettingsPrivateDelegate::Create(
return new LanguageSettingsPrivateDelegate(context);
}
-ScopedVector<language_settings_private::SpellcheckDictionaryStatus>
+std::vector<language_settings_private::SpellcheckDictionaryStatus>
LanguageSettingsPrivateDelegate::GetHunspellDictionaryStatuses() {
- ScopedVector<language_settings_private::SpellcheckDictionaryStatus> statuses;
+ std::vector<language_settings_private::SpellcheckDictionaryStatus> statuses;
for (const auto& dictionary : GetHunspellDictionaries()) {
if (!dictionary)
continue;
- scoped_ptr<language_settings_private::SpellcheckDictionaryStatus> status(
- new language_settings_private::SpellcheckDictionaryStatus());
- status->language_code = dictionary->GetLanguage();
- status->is_ready = dictionary->IsReady();
- if (!status->is_ready) {
+ language_settings_private::SpellcheckDictionaryStatus status;
+ status.language_code = dictionary->GetLanguage();
+ status.is_ready = dictionary->IsReady();
+ if (!status.is_ready) {
if (dictionary->IsDownloadInProgress())
- status->is_downloading.reset(new bool(true));
+ status.is_downloading.reset(new bool(true));
if (dictionary->IsDownloadFailure())
- status->download_failed.reset(new bool(true));
+ status.download_failed.reset(new bool(true));
}
statuses.push_back(std::move(status));
}
@@ -235,18 +234,12 @@ void LanguageSettingsPrivateDelegate::OnSpellcheckDictionariesChanged() {
}
void LanguageSettingsPrivateDelegate::BroadcastDictionariesChangedEvent() {
- std::vector<linked_ptr<language_settings_private::SpellcheckDictionaryStatus>>
- broadcast_statuses;
- ScopedVector<language_settings_private::SpellcheckDictionaryStatus> statuses =
+ std::vector<language_settings_private::SpellcheckDictionaryStatus> statuses =
GetHunspellDictionaryStatuses();
- for (language_settings_private::SpellcheckDictionaryStatus* status : statuses)
- broadcast_statuses.push_back(make_linked_ptr(status));
- statuses.weak_clear();
-
scoped_ptr<base::ListValue> args(
language_settings_private::OnSpellcheckDictionariesChanged::Create(
- broadcast_statuses));
+ statuses));
scoped_ptr<extensions::Event> extension_event(new extensions::Event(
events::LANGUAGE_SETTINGS_PRIVATE_ON_SPELLCHECK_DICTIONARIES_CHANGED,
language_settings_private::OnSpellcheckDictionariesChanged::kEventName,

Powered by Google App Engine
This is Rietveld 408576698