OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/app_search_provider.h" | 5 #include "chrome/browser/ui/app_list/search/app_search_provider.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
10 #include "chrome/browser/extensions/extension_service.h" | 10 #include "chrome/browser/extensions/extension_service.h" |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
83 result->set_title((*app_it)->indexed_name().text()); | 83 result->set_title((*app_it)->indexed_name().text()); |
84 result->UpdateFromLastLaunched(current_time, | 84 result->UpdateFromLastLaunched(current_time, |
85 (*app_it)->last_launch_time()); | 85 (*app_it)->last_launch_time()); |
86 } else { | 86 } else { |
87 TokenizedStringMatch match; | 87 TokenizedStringMatch match; |
88 if (!match.Calculate(query_terms, (*app_it)->indexed_name())) | 88 if (!match.Calculate(query_terms, (*app_it)->indexed_name())) |
89 continue; | 89 continue; |
90 | 90 |
91 result->UpdateFromMatch((*app_it)->indexed_name(), match); | 91 result->UpdateFromMatch((*app_it)->indexed_name(), match); |
92 } | 92 } |
93 Add(result.PassAs<SearchResult>()); | 93 Add(result.Pass()); |
94 } | 94 } |
95 } | 95 } |
96 | 96 |
97 void AppSearchProvider::AddApps(const extensions::ExtensionSet& extensions) { | 97 void AppSearchProvider::AddApps(const extensions::ExtensionSet& extensions) { |
98 extensions::ExtensionPrefs* prefs = extensions::ExtensionPrefs::Get(profile_); | 98 extensions::ExtensionPrefs* prefs = extensions::ExtensionPrefs::Get(profile_); |
99 for (extensions::ExtensionSet::const_iterator iter = extensions.begin(); | 99 for (extensions::ExtensionSet::const_iterator iter = extensions.begin(); |
100 iter != extensions.end(); ++iter) { | 100 iter != extensions.end(); ++iter) { |
101 const extensions::Extension* app = iter->get(); | 101 const extensions::Extension* app = iter->get(); |
102 | 102 |
103 if (!extensions::ui_util::ShouldDisplayInAppLauncher(app, profile_)) | 103 if (!extensions::ui_util::ShouldDisplayInAppLauncher(app, profile_)) |
(...skipping 22 matching lines...) Expand all Loading... |
126 } | 126 } |
127 | 127 |
128 void AppSearchProvider::OnExtensionUninstalled( | 128 void AppSearchProvider::OnExtensionUninstalled( |
129 content::BrowserContext* browser_context, | 129 content::BrowserContext* browser_context, |
130 const extensions::Extension* extension, | 130 const extensions::Extension* extension, |
131 extensions::UninstallReason reason) { | 131 extensions::UninstallReason reason) { |
132 RefreshApps(); | 132 RefreshApps(); |
133 } | 133 } |
134 | 134 |
135 } // namespace app_list | 135 } // namespace app_list |
OLD | NEW |