| 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/chromeos/drive/file_write_watcher.h" | 5 #include "chrome/browser/chromeos/drive/file_write_watcher.h" |
| 6 | 6 |
| 7 #include <map> | 7 #include <map> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| 11 #include "base/callback.h" | 11 #include "base/callback.h" |
| 12 #include "base/files/file_path_watcher.h" | 12 #include "base/files/file_path_watcher.h" |
| 13 #include "base/stl_util.h" | 13 #include "base/stl_util.h" |
| 14 #include "base/timer/timer.h" | 14 #include "base/timer/timer.h" |
| 15 #include "chrome/browser/chromeos/drive/logging.h" | 15 #include "chrome/browser/chromeos/drive/logging.h" |
| 16 #include "chrome/browser/google_apis/task_util.h" | |
| 17 #include "content/public/browser/browser_thread.h" | 16 #include "content/public/browser/browser_thread.h" |
| 17 #include "google_apis/drive/task_util.h" |
| 18 | 18 |
| 19 using content::BrowserThread; | 19 using content::BrowserThread; |
| 20 | 20 |
| 21 namespace drive { | 21 namespace drive { |
| 22 namespace internal { | 22 namespace internal { |
| 23 | 23 |
| 24 namespace { | 24 namespace { |
| 25 const int64 kWriteEventDelayInSeconds = 5; | 25 const int64 kWriteEventDelayInSeconds = 5; |
| 26 } // namespace | 26 } // namespace |
| 27 | 27 |
| (...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 206 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 206 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 207 watcher_impl_->StartWatch(file_path, on_start_callback, on_write_callback); | 207 watcher_impl_->StartWatch(file_path, on_start_callback, on_write_callback); |
| 208 } | 208 } |
| 209 | 209 |
| 210 void FileWriteWatcher::DisableDelayForTesting() { | 210 void FileWriteWatcher::DisableDelayForTesting() { |
| 211 watcher_impl_->set_delay(base::TimeDelta()); | 211 watcher_impl_->set_delay(base::TimeDelta()); |
| 212 } | 212 } |
| 213 | 213 |
| 214 } // namespace internal | 214 } // namespace internal |
| 215 } // namespace drive | 215 } // namespace drive |
| OLD | NEW |