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/android/popular_sites.h" | 5 #include "chrome/browser/android/popular_sites.h" |
6 | 6 |
| 7 #include <stddef.h> |
| 8 |
7 #include "base/bind.h" | 9 #include "base/bind.h" |
8 #include "base/command_line.h" | 10 #include "base/command_line.h" |
9 #include "base/files/file_path.h" | 11 #include "base/files/file_path.h" |
10 #include "base/files/file_util.h" | 12 #include "base/files/file_util.h" |
11 #include "base/json/json_reader.h" | 13 #include "base/json/json_reader.h" |
12 #include "base/path_service.h" | 14 #include "base/path_service.h" |
13 #include "base/prefs/pref_service.h" | 15 #include "base/prefs/pref_service.h" |
14 #include "base/strings/string_util.h" | 16 #include "base/strings/string_util.h" |
15 #include "base/strings/stringprintf.h" | 17 #include "base/strings/stringprintf.h" |
16 #include "base/task_runner_util.h" | 18 #include "base/task_runner_util.h" |
(...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
275 base::Bind(&PopularSites::OnJsonParsed, weak_ptr_factory_.GetWeakPtr())); | 277 base::Bind(&PopularSites::OnJsonParsed, weak_ptr_factory_.GetWeakPtr())); |
276 } | 278 } |
277 | 279 |
278 void PopularSites::OnJsonParsed(scoped_ptr<std::vector<Site>> sites) { | 280 void PopularSites::OnJsonParsed(scoped_ptr<std::vector<Site>> sites) { |
279 if (sites) | 281 if (sites) |
280 sites_.swap(*sites); | 282 sites_.swap(*sites); |
281 else | 283 else |
282 sites_.clear(); | 284 sites_.clear(); |
283 callback_.Run(!!sites); | 285 callback_.Run(!!sites); |
284 } | 286 } |
OLD | NEW |