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

Side by Side Diff: chrome/browser/ui/app_list/search/launcher_search/launcher_search_provider.cc

Issue 1865213004: Convert //chrome/browser/ui from scoped_ptr to std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 8 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/ui/app_list/search/launcher_search/launcher_search_prov ider.h" 5 #include "chrome/browser/ui/app_list/search/launcher_search/launcher_search_prov ider.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/memory/ptr_util.h"
9 #include "base/stl_util.h" 10 #include "base/stl_util.h"
10 #include "base/strings/utf_string_conversions.h" 11 #include "base/strings/utf_string_conversions.h"
11 #include "chrome/browser/chromeos/launcher_search_provider/launcher_search_provi der_service.h" 12 #include "chrome/browser/chromeos/launcher_search_provider/launcher_search_provi der_service.h"
12 13
13 using chromeos::launcher_search_provider::Service; 14 using chromeos::launcher_search_provider::Service;
14 15
15 namespace app_list { 16 namespace app_list {
16 17
17 namespace { 18 namespace {
18 19
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
54 if (service->IsQueryRunning()) 55 if (service->IsQueryRunning())
55 service->OnQueryEnded(); 56 service->OnQueryEnded();
56 } 57 }
57 58
58 void LauncherSearchProvider::SetSearchResults( 59 void LauncherSearchProvider::SetSearchResults(
59 const extensions::ExtensionId& extension_id, 60 const extensions::ExtensionId& extension_id,
60 ScopedVector<LauncherSearchResult> results) { 61 ScopedVector<LauncherSearchResult> results) {
61 DCHECK(Service::Get(profile_)->IsQueryRunning()); 62 DCHECK(Service::Get(profile_)->IsQueryRunning());
62 63
63 // Add this extension's results (erasing any existing results). 64 // Add this extension's results (erasing any existing results).
64 extension_results_[extension_id] = make_scoped_ptr( 65 extension_results_[extension_id] = base::WrapUnique(
65 new ScopedVector<LauncherSearchResult>(std::move(results))); 66 new ScopedVector<LauncherSearchResult>(std::move(results)));
66 67
67 // Update results with other extension results. 68 // Update results with other extension results.
68 ClearResults(); 69 ClearResults();
69 for (const auto& item : extension_results_) { 70 for (const auto& item : extension_results_) {
70 for (const auto* result : *item.second) 71 for (const auto* result : *item.second)
71 Add(result->Duplicate()); 72 Add(result->Duplicate());
72 } 73 }
73 } 74 }
74 75
(...skipping 10 matching lines...) Expand all
85 } 86 }
86 87
87 void LauncherSearchProvider::StartInternal(const base::string16& query) { 88 void LauncherSearchProvider::StartInternal(const base::string16& query) {
88 if (!query.empty()) { 89 if (!query.empty()) {
89 Service::Get(profile_)->OnQueryStarted(this, base::UTF16ToUTF8(query), 90 Service::Get(profile_)->OnQueryStarted(this, base::UTF16ToUTF8(query),
90 kLauncherSearchProviderMaxResults); 91 kLauncherSearchProviderMaxResults);
91 } 92 }
92 } 93 }
93 94
94 } // namespace app_list 95 } // namespace app_list
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698