| 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/recommended_apps.h" | 5 #include "chrome/browser/ui/app_list/recommended_apps.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 63 void RecommendedApps::RemoveObserver(RecommendedAppsObserver* observer) { | 63 void RecommendedApps::RemoveObserver(RecommendedAppsObserver* observer) { |
| 64 observers_.RemoveObserver(observer); | 64 observers_.RemoveObserver(observer); |
| 65 } | 65 } |
| 66 | 66 |
| 67 void RecommendedApps::Update() { | 67 void RecommendedApps::Update() { |
| 68 ExtensionService* service = | 68 ExtensionService* service = |
| 69 extensions::ExtensionSystem::Get(profile_)->extension_service(); | 69 extensions::ExtensionSystem::Get(profile_)->extension_service(); |
| 70 extensions::ExtensionPrefs* prefs = service->extension_prefs(); | 70 extensions::ExtensionPrefs* prefs = service->extension_prefs(); |
| 71 | 71 |
| 72 std::vector<AppSortInfo> sorted_apps; | 72 std::vector<AppSortInfo> sorted_apps; |
| 73 const ExtensionSet* extensions = service->extensions(); | 73 const extensions::ExtensionSet* extensions = service->extensions(); |
| 74 for (ExtensionSet::const_iterator app = extensions->begin(); | 74 for (extensions::ExtensionSet::const_iterator app = extensions->begin(); |
| 75 app != extensions->end(); ++app) { | 75 app != extensions->end(); ++app) { |
| 76 if (!(*app)->ShouldDisplayInAppLauncher()) | 76 if (!(*app)->ShouldDisplayInAppLauncher()) |
| 77 continue; | 77 continue; |
| 78 | 78 |
| 79 sorted_apps.push_back( | 79 sorted_apps.push_back( |
| 80 AppSortInfo(app->get(), prefs->GetLastLaunchTime((*app)->id()))); | 80 AppSortInfo(app->get(), prefs->GetLastLaunchTime((*app)->id()))); |
| 81 } | 81 } |
| 82 | 82 |
| 83 std::sort(sorted_apps.begin(), sorted_apps.end(), &AppLaunchedMoreRecent); | 83 std::sort(sorted_apps.begin(), sorted_apps.end(), &AppLaunchedMoreRecent); |
| 84 | 84 |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 127 } | 127 } |
| 128 | 128 |
| 129 void RecommendedApps::OnAppsReordered() {} | 129 void RecommendedApps::OnAppsReordered() {} |
| 130 | 130 |
| 131 void RecommendedApps::OnAppInstalledToAppList( | 131 void RecommendedApps::OnAppInstalledToAppList( |
| 132 const std::string& extension_id) {} | 132 const std::string& extension_id) {} |
| 133 | 133 |
| 134 void RecommendedApps::OnShutdown() {} | 134 void RecommendedApps::OnShutdown() {} |
| 135 | 135 |
| 136 } // namespace app_list | 136 } // namespace app_list |
| OLD | NEW |