| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/browsing_data/hosted_apps_counter.h" | 5 #include "chrome/browser/browsing_data/hosted_apps_counter.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/memory/ptr_util.h" | 10 #include "base/memory/ptr_util.h" |
| (...skipping 23 matching lines...) Expand all Loading... |
| 34 if (extension->is_hosted_app()) | 34 if (extension->is_hosted_app()) |
| 35 names.push_back(extension->short_name()); | 35 names.push_back(extension->short_name()); |
| 36 } | 36 } |
| 37 | 37 |
| 38 count = names.size(); | 38 count = names.size(); |
| 39 | 39 |
| 40 // Give the first two names (alphabetically) as examples. | 40 // Give the first two names (alphabetically) as examples. |
| 41 std::sort(names.begin(), names.end()); | 41 std::sort(names.begin(), names.end()); |
| 42 names.resize(std::min<size_t>(2u, names.size())); | 42 names.resize(std::min<size_t>(2u, names.size())); |
| 43 | 43 |
| 44 ReportResult(base::WrapUnique(new HostedAppsResult(this, count, names))); | 44 ReportResult(base::MakeUnique<HostedAppsResult>(this, count, names)); |
| 45 } | 45 } |
| 46 | 46 |
| 47 // HostedAppsCounter::HostedAppsResult ----------------------------------------- | 47 // HostedAppsCounter::HostedAppsResult ----------------------------------------- |
| 48 | 48 |
| 49 HostedAppsCounter::HostedAppsResult::HostedAppsResult( | 49 HostedAppsCounter::HostedAppsResult::HostedAppsResult( |
| 50 const HostedAppsCounter* source, | 50 const HostedAppsCounter* source, |
| 51 ResultInt num_apps, | 51 ResultInt num_apps, |
| 52 const std::vector<std::string>& examples) | 52 const std::vector<std::string>& examples) |
| 53 : FinishedResult(source, num_apps), examples_(examples) {} | 53 : FinishedResult(source, num_apps), examples_(examples) {} |
| 54 | 54 |
| 55 HostedAppsCounter::HostedAppsResult::~HostedAppsResult() {} | 55 HostedAppsCounter::HostedAppsResult::~HostedAppsResult() {} |
| OLD | NEW |