OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/file_system_provider/provided_file_system.h" | 5 #include "chrome/browser/chromeos/file_system_provider/provided_file_system.h" |
6 | 6 |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "base/debug/trace_event.h" | 9 #include "base/debug/trace_event.h" |
10 #include "base/files/file.h" | 10 #include "base/files/file.h" |
(...skipping 458 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
469 weak_ptr_factory_.GetWeakPtr(), | 469 weak_ptr_factory_.GetWeakPtr(), |
470 observed_path, | 470 observed_path, |
471 change_type, | 471 change_type, |
472 base::Passed(&child_changes), | 472 base::Passed(&child_changes), |
473 it->second.last_tag, | 473 it->second.last_tag, |
474 tag))); | 474 tag))); |
475 | 475 |
476 FOR_EACH_OBSERVER(ProvidedFileSystemObserver, | 476 FOR_EACH_OBSERVER(ProvidedFileSystemObserver, |
477 observers_, | 477 observers_, |
478 OnObservedEntryChanged(file_system_info_, | 478 OnObservedEntryChanged(file_system_info_, |
479 observed_path, | 479 it->second, |
480 change_type, | 480 change_type, |
481 child_changes_ref, | 481 child_changes_ref, |
482 auto_updater->CreateCallback())); | 482 auto_updater->CreateCallback())); |
483 | 483 |
484 return true; | 484 return true; |
485 } | 485 } |
486 | 486 |
487 base::WeakPtr<ProvidedFileSystemInterface> ProvidedFileSystem::GetWeakPtr() { | 487 base::WeakPtr<ProvidedFileSystemInterface> ProvidedFileSystem::GetWeakPtr() { |
488 return weak_ptr_factory_.GetWeakPtr(); | 488 return weak_ptr_factory_.GetWeakPtr(); |
489 } | 489 } |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
542 return; | 542 return; |
543 | 543 |
544 // It's illegal to provide a tag which is not unique. As for now only an error | 544 // It's illegal to provide a tag which is not unique. As for now only an error |
545 // message is printed, but we may want to pass the error to the providing | 545 // message is printed, but we may want to pass the error to the providing |
546 // extension. TODO(mtomasz): Consider it. | 546 // extension. TODO(mtomasz): Consider it. |
547 if (!tag.empty() && tag == it->second.last_tag) | 547 if (!tag.empty() && tag == it->second.last_tag) |
548 LOG(ERROR) << "Tag specified, but same as the previous one."; | 548 LOG(ERROR) << "Tag specified, but same as the previous one."; |
549 | 549 |
550 it->second.last_tag = tag; | 550 it->second.last_tag = tag; |
551 | 551 |
552 FOR_EACH_OBSERVER( | 552 FOR_EACH_OBSERVER(ProvidedFileSystemObserver, |
553 ProvidedFileSystemObserver, | 553 observers_, |
554 observers_, | 554 OnObservedEntryTagUpdated(file_system_info_, it->second)); |
555 OnObservedEntryTagUpdated(file_system_info_, observed_path, tag)); | |
556 | 555 |
557 // If the observed entry is deleted, then unobserve it. | 556 // If the observed entry is deleted, then unobserve it. |
558 if (change_type == ProvidedFileSystemObserver::DELETED) | 557 if (change_type == ProvidedFileSystemObserver::DELETED) |
559 UnobserveEntry(observed_path, base::Bind(&EmptyStatusCallback)); | 558 UnobserveEntry(observed_path, base::Bind(&EmptyStatusCallback)); |
560 } | 559 } |
561 | 560 |
562 } // namespace file_system_provider | 561 } // namespace file_system_provider |
563 } // namespace chromeos | 562 } // namespace chromeos |
OLD | NEW |