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/devtools/devtools_file_system_indexer.h" | 5 #include "chrome/browser/devtools/devtools_file_system_indexer.h" |
6 | 6 |
7 #include <iterator> | 7 #include <iterator> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/callback.h" | 10 #include "base/callback.h" |
11 #include "base/file_util.h" | |
12 #include "base/files/file_enumerator.h" | 11 #include "base/files/file_enumerator.h" |
| 12 #include "base/files/file_util.h" |
13 #include "base/files/file_util_proxy.h" | 13 #include "base/files/file_util_proxy.h" |
14 #include "base/lazy_instance.h" | 14 #include "base/lazy_instance.h" |
15 #include "base/logging.h" | 15 #include "base/logging.h" |
16 #include "base/stl_util.h" | 16 #include "base/stl_util.h" |
17 #include "base/strings/utf_string_conversions.h" | 17 #include "base/strings/utf_string_conversions.h" |
18 #include "content/public/browser/browser_thread.h" | 18 #include "content/public/browser/browser_thread.h" |
19 | 19 |
20 using base::Bind; | 20 using base::Bind; |
21 using base::Callback; | 21 using base::Callback; |
22 using base::FileEnumerator; | 22 using base::FileEnumerator; |
(...skipping 461 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
484 vector<FilePath> file_paths = g_trigram_index.Get().Search(query); | 484 vector<FilePath> file_paths = g_trigram_index.Get().Search(query); |
485 vector<string> result; | 485 vector<string> result; |
486 FilePath path = FilePath::FromUTF8Unsafe(file_system_path); | 486 FilePath path = FilePath::FromUTF8Unsafe(file_system_path); |
487 vector<FilePath>::const_iterator it = file_paths.begin(); | 487 vector<FilePath>::const_iterator it = file_paths.begin(); |
488 for (; it != file_paths.end(); ++it) { | 488 for (; it != file_paths.end(); ++it) { |
489 if (path.IsParent(*it)) | 489 if (path.IsParent(*it)) |
490 result.push_back(it->AsUTF8Unsafe()); | 490 result.push_back(it->AsUTF8Unsafe()); |
491 } | 491 } |
492 BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, Bind(callback, result)); | 492 BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, Bind(callback, result)); |
493 } | 493 } |
OLD | NEW |