| 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/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/message_loop/message_loop.h" | 10 #include "base/message_loop/message_loop.h" |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 | 25 |
| 26 using extensions::ExtensionRegistry; | 26 using extensions::ExtensionRegistry; |
| 27 | 27 |
| 28 namespace app_list { | 28 namespace app_list { |
| 29 | 29 |
| 30 class AppSearchProvider::App { | 30 class AppSearchProvider::App { |
| 31 public: | 31 public: |
| 32 explicit App(const extensions::Extension* extension, | 32 explicit App(const extensions::Extension* extension, |
| 33 const base::Time& last_launch_time) | 33 const base::Time& last_launch_time) |
| 34 : app_id_(extension->id()), | 34 : app_id_(extension->id()), |
| 35 indexed_name_(base::UTF8ToUTF16(extension->name())), | 35 indexed_name_(base::UTF8ToUTF16(extension->short_name())), |
| 36 last_launch_time_(last_launch_time) {} | 36 last_launch_time_(last_launch_time) {} |
| 37 ~App() {} | 37 ~App() {} |
| 38 | 38 |
| 39 const std::string& app_id() const { return app_id_; } | 39 const std::string& app_id() const { return app_id_; } |
| 40 const TokenizedString& indexed_name() const { return indexed_name_; } | 40 const TokenizedString& indexed_name() const { return indexed_name_; } |
| 41 const base::Time& last_launch_time() const { return last_launch_time_; } | 41 const base::Time& last_launch_time() const { return last_launch_time_; } |
| 42 | 42 |
| 43 private: | 43 private: |
| 44 const std::string app_id_; | 44 const std::string app_id_; |
| 45 TokenizedString indexed_name_; | 45 TokenizedString indexed_name_; |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 152 RefreshApps(); | 152 RefreshApps(); |
| 153 if (!update_results_factory_.HasWeakPtrs()) { | 153 if (!update_results_factory_.HasWeakPtrs()) { |
| 154 base::MessageLoop::current()->PostTask( | 154 base::MessageLoop::current()->PostTask( |
| 155 FROM_HERE, | 155 FROM_HERE, |
| 156 base::Bind(&AppSearchProvider::UpdateResults, | 156 base::Bind(&AppSearchProvider::UpdateResults, |
| 157 update_results_factory_.GetWeakPtr())); | 157 update_results_factory_.GetWeakPtr())); |
| 158 } | 158 } |
| 159 } | 159 } |
| 160 | 160 |
| 161 } // namespace app_list | 161 } // namespace app_list |
| OLD | NEW |